Skip to content

Commit 8dfeb4e

Browse files
committed
Revert "[SandboxIR][NFC] Delete SandboxIR.h (llvm#110309)"
This reverts commit ca47f48.
1 parent ca47f48 commit 8dfeb4e

File tree

17 files changed

+212
-31
lines changed

17 files changed

+212
-31
lines changed

llvm/include/llvm/SandboxIR/Constant.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "llvm/IR/GlobalValue.h"
1919
#include "llvm/IR/GlobalVariable.h"
2020
#include "llvm/SandboxIR/Argument.h"
21-
#include "llvm/SandboxIR/BasicBlock.h"
2221
#include "llvm/SandboxIR/Context.h"
2322
#include "llvm/SandboxIR/Type.h"
2423
#include "llvm/SandboxIR/User.h"
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
//===- SandboxIR.h ----------------------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// Sandbox IR is a lightweight overlay transactional IR on top of LLVM IR.
10+
// Features:
11+
// - You can save/rollback the state of the IR at any time.
12+
// - Any changes made to Sandbox IR will automatically update the underlying
13+
// LLVM IR so both IRs are always in sync.
14+
// - Feels like LLVM IR, similar API.
15+
//
16+
// SandboxIR forms a class hierarchy that resembles that of LLVM IR
17+
// but is in the `sandboxir` namespace:
18+
//
19+
// namespace sandboxir {
20+
//
21+
// Value -+- Argument
22+
// |
23+
// +- BasicBlock
24+
// |
25+
// +- User ------+- Constant ------ Function
26+
// |
27+
// +- Instruction -+- BinaryOperator
28+
// |
29+
// +- BranchInst
30+
// |
31+
// +- CastInst --------+- AddrSpaceCastInst
32+
// | |
33+
// | +- BitCastInst
34+
// | |
35+
// | +- FPExtInst
36+
// | |
37+
// | +- FPToSIInst
38+
// | |
39+
// | +- FPToUIInst
40+
// | |
41+
// | +- FPTruncInst
42+
// | |
43+
// | +- IntToPtrInst
44+
// | |
45+
// | +- PtrToIntInst
46+
// | |
47+
// | +- SExtInst
48+
// | |
49+
// | +- SIToFPInst
50+
// | |
51+
// | +- TruncInst
52+
// | |
53+
// | +- UIToFPInst
54+
// | |
55+
// | +- ZExtInst
56+
// |
57+
// +- CallBase --------+- CallBrInst
58+
// | |
59+
// | +- CallInst
60+
// | |
61+
// | +- InvokeInst
62+
// |
63+
// +- CmpInst ---------+- ICmpInst
64+
// | |
65+
// | +- FCmpInst
66+
// |
67+
// +- ExtractElementInst
68+
// |
69+
// +- GetElementPtrInst
70+
// |
71+
// +- InsertElementInst
72+
// |
73+
// +- OpaqueInst
74+
// |
75+
// +- PHINode
76+
// |
77+
// +- ReturnInst
78+
// |
79+
// +- SelectInst
80+
// |
81+
// +- ShuffleVectorInst
82+
// |
83+
// +- ExtractValueInst
84+
// |
85+
// +- InsertValueInst
86+
// |
87+
// +- StoreInst
88+
// |
89+
// +- UnaryInstruction -+- LoadInst
90+
// | |
91+
// | +- CastInst
92+
// |
93+
// +- UnaryOperator
94+
// |
95+
// +- UnreachableInst
96+
//
97+
// Use
98+
//
99+
// } // namespace sandboxir
100+
//
101+
102+
#ifndef LLVM_SANDBOXIR_SANDBOXIR_H
103+
#define LLVM_SANDBOXIR_SANDBOXIR_H
104+
105+
#include "llvm/IR/Function.h"
106+
#include "llvm/IR/IRBuilder.h"
107+
#include "llvm/IR/Instruction.h"
108+
#include "llvm/IR/IntrinsicInst.h"
109+
#include "llvm/IR/PatternMatch.h"
110+
#include "llvm/IR/User.h"
111+
#include "llvm/IR/Value.h"
112+
#include "llvm/SandboxIR/Argument.h"
113+
#include "llvm/SandboxIR/BasicBlock.h"
114+
#include "llvm/SandboxIR/Constant.h"
115+
#include "llvm/SandboxIR/Context.h"
116+
#include "llvm/SandboxIR/Module.h"
117+
#include "llvm/SandboxIR/Tracker.h"
118+
#include "llvm/SandboxIR/Type.h"
119+
#include "llvm/SandboxIR/Use.h"
120+
#include "llvm/SandboxIR/User.h"
121+
#include "llvm/SandboxIR/Value.h"
122+
#include "llvm/Support/raw_ostream.h"
123+
#include <iterator>
124+
125+
namespace llvm {
126+
127+
namespace sandboxir {
128+
129+
class BasicBlock;
130+
class ConstantInt;
131+
class ConstantFP;
132+
class ConstantAggregateZero;
133+
class ConstantPointerNull;
134+
class PoisonValue;
135+
class BlockAddress;
136+
class DSOLocalEquivalent;
137+
class ConstantTokenNone;
138+
class GlobalValue;
139+
class GlobalObject;
140+
class GlobalIFunc;
141+
class GlobalVariable;
142+
class GlobalAlias;
143+
class NoCFIValue;
144+
class ConstantPtrAuth;
145+
class ConstantExpr;
146+
class Context;
147+
class Function;
148+
class Module;
149+
class Instruction;
150+
class VAArgInst;
151+
class FreezeInst;
152+
class FenceInst;
153+
class SelectInst;
154+
class ExtractElementInst;
155+
class InsertElementInst;
156+
class ShuffleVectorInst;
157+
class ExtractValueInst;
158+
class InsertValueInst;
159+
class BranchInst;
160+
class UnaryInstruction;
161+
class LoadInst;
162+
class ReturnInst;
163+
class StoreInst;
164+
class User;
165+
class UnreachableInst;
166+
class Value;
167+
class CallBase;
168+
class CallInst;
169+
class InvokeInst;
170+
class CallBrInst;
171+
class LandingPadInst;
172+
class FuncletPadInst;
173+
class CatchPadInst;
174+
class CleanupPadInst;
175+
class CatchReturnInst;
176+
class CleanupReturnInst;
177+
class GetElementPtrInst;
178+
class CastInst;
179+
class PossiblyNonNegInst;
180+
class PtrToIntInst;
181+
class BitCastInst;
182+
class AllocaInst;
183+
class ResumeInst;
184+
class CatchSwitchInst;
185+
class SwitchInst;
186+
class UnaryOperator;
187+
class BinaryOperator;
188+
class PossiblyDisjointInst;
189+
class AtomicRMWInst;
190+
class AtomicCmpXchgInst;
191+
class CmpInst;
192+
class ICmpInst;
193+
class FCmpInst;
194+
195+
} // namespace sandboxir
196+
} // namespace llvm
197+
198+
#endif // LLVM_SANDBOXIR_SANDBOXIR_H

llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_INSTRINTERVAL_H
2121
#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_INSTRINTERVAL_H
2222

23-
#include "llvm/ADT/ArrayRef.h"
23+
#include "llvm/SandboxIR/SandboxIR.h"
2424
#include <iterator>
2525

2626
namespace llvm::sandboxir {

llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Legality.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_LEGALITY_H
1313
#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_LEGALITY_H
1414

15-
#include "llvm/ADT/ArrayRef.h"
15+
#include "llvm/SandboxIR/SandboxIR.h"
1616

1717
namespace llvm::sandboxir {
1818

1919
class LegalityAnalysis;
20-
class Value;
2120

2221
enum class LegalityResultID {
2322
Widen, ///> Vectorize by combining scalars to a vector.

llvm/lib/SandboxIR/Module.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "llvm/SandboxIR/Module.h"
10-
#include "llvm/SandboxIR/Constant.h"
11-
#include "llvm/SandboxIR/Context.h"
12-
#include "llvm/SandboxIR/Value.h"
10+
#include "llvm/SandboxIR/SandboxIR.h"
1311

1412
using namespace llvm::sandboxir;
1513

llvm/lib/SandboxIR/PassManager.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "llvm/SandboxIR/PassManager.h"
10+
#include "llvm/SandboxIR/SandboxIR.h"
1011

1112
using namespace llvm::sandboxir;
1213

llvm/lib/SandboxIR/SandboxIR.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#include "llvm/SandboxIR/SandboxIR.h"
910
#include "llvm/ADT/SmallPtrSet.h"
1011
#include "llvm/ADT/SmallVector.h"
1112
#include "llvm/IR/Constants.h"
1213
#include "llvm/SandboxIR/Argument.h"
1314
#include "llvm/SandboxIR/BasicBlock.h"
14-
#include "llvm/SandboxIR/Context.h"
15-
#include "llvm/SandboxIR/User.h"
1615
#include "llvm/Support/Debug.h"
1716
#include <sstream>
1817

llvm/lib/SandboxIR/Type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "llvm/SandboxIR/Type.h"
10-
#include "llvm/SandboxIR/Context.h"
10+
#include "llvm/SandboxIR/SandboxIR.h"
1111

1212
using namespace llvm::sandboxir;
1313

llvm/lib/SandboxIR/Value.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "llvm/SandboxIR/Value.h"
1010
#include "llvm/SandboxIR/Context.h"
11-
#include "llvm/SandboxIR/User.h"
11+
#include "llvm/SandboxIR/SandboxIR.h"
1212
#include <sstream>
1313

1414
namespace llvm::sandboxir {

llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#include "llvm/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.h"
1010
#include "llvm/Analysis/TargetTransformInfo.h"
11-
#include "llvm/SandboxIR/Constant.h"
1211
#include "llvm/SandboxIR/PassManager.h"
12+
#include "llvm/SandboxIR/SandboxIR.h"
1313
#include "llvm/Support/CommandLine.h"
1414
#include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h"
1515

llvm/unittests/SandboxIR/PassTest.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
#include "llvm/SandboxIR/Pass.h"
1010
#include "llvm/AsmParser/Parser.h"
1111
#include "llvm/IR/Module.h"
12-
#include "llvm/SandboxIR/Constant.h"
13-
#include "llvm/SandboxIR/Context.h"
1412
#include "llvm/SandboxIR/PassManager.h"
13+
#include "llvm/SandboxIR/SandboxIR.h"
1514
#include "llvm/Support/SourceMgr.h"
1615
#include "gtest/gtest.h"
1716

llvm/unittests/SandboxIR/RegionTest.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99
#include "llvm/SandboxIR/Region.h"
1010
#include "llvm/AsmParser/Parser.h"
11-
#include "llvm/SandboxIR/Constant.h"
12-
#include "llvm/SandboxIR/Context.h"
13-
#include "llvm/SandboxIR/Instruction.h"
11+
#include "llvm/SandboxIR/SandboxIR.h"
1412
#include "llvm/Support/SourceMgr.h"
1513
#include "gmock/gmock-matchers.h"
1614
#include "gtest/gtest.h"

llvm/unittests/SandboxIR/SandboxIRTest.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,15 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#include "llvm/SandboxIR/SandboxIR.h"
910
#include "llvm/AsmParser/Parser.h"
1011
#include "llvm/IR/BasicBlock.h"
1112
#include "llvm/IR/Constants.h"
1213
#include "llvm/IR/DataLayout.h"
1314
#include "llvm/IR/Function.h"
1415
#include "llvm/IR/Instruction.h"
1516
#include "llvm/IR/Module.h"
16-
#include "llvm/SandboxIR/BasicBlock.h"
17-
#include "llvm/SandboxIR/Constant.h"
18-
#include "llvm/SandboxIR/Instruction.h"
19-
#include "llvm/SandboxIR/Module.h"
2017
#include "llvm/SandboxIR/Utils.h"
21-
#include "llvm/SandboxIR/Value.h"
2218
#include "llvm/Support/SourceMgr.h"
2319
#include "gmock/gmock-matchers.h"
2420
#include "gtest/gtest.h"

llvm/unittests/SandboxIR/TypesTest.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
#include "llvm/IR/Function.h"
1515
#include "llvm/IR/Instruction.h"
1616
#include "llvm/IR/Module.h"
17-
#include "llvm/SandboxIR/Constant.h"
18-
#include "llvm/SandboxIR/Context.h"
17+
#include "llvm/SandboxIR/SandboxIR.h"
1918
#include "llvm/Support/SourceMgr.h"
2019
#include "gtest/gtest.h"
2120

llvm/unittests/SandboxIR/UtilsTest.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
#include "llvm/IR/Function.h"
1414
#include "llvm/IR/Instruction.h"
1515
#include "llvm/IR/Module.h"
16-
#include "llvm/SandboxIR/Constant.h"
17-
#include "llvm/SandboxIR/Context.h"
16+
#include "llvm/SandboxIR/SandboxIR.h"
1817
#include "llvm/Support/SourceMgr.h"
1918
#include "gtest/gtest.h"
2019

llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99
#include "llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h"
1010
#include "llvm/AsmParser/Parser.h"
11-
#include "llvm/SandboxIR/Constant.h"
12-
#include "llvm/SandboxIR/Context.h"
13-
#include "llvm/SandboxIR/Instruction.h"
11+
#include "llvm/SandboxIR/SandboxIR.h"
1412
#include "llvm/Support/SourceMgr.h"
1513
#include "gmock/gmock-matchers.h"
1614
#include "gtest/gtest.h"

llvm/unittests/Transforms/Vectorize/SandboxVectorizer/IntervalTest.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
#include "llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h"
1010
#include "llvm/AsmParser/Parser.h"
11-
#include "llvm/SandboxIR/Constant.h"
12-
#include "llvm/SandboxIR/Context.h"
1311
#include "llvm/SandboxIR/Instruction.h"
1412
#include "llvm/Support/SourceMgr.h"
1513
#include "gtest/gtest.h"

0 commit comments

Comments
 (0)