9
9
#ifndef LLVM_SANDBOXIR_BASICBLOCK_H
10
10
#define LLVM_SANDBOXIR_BASICBLOCK_H
11
11
12
+ #include " llvm/Support/Compiler.h"
12
13
#include " llvm/IR/BasicBlock.h"
13
14
#include " llvm/SandboxIR/Value.h"
14
15
@@ -32,20 +33,20 @@ class BBIterator {
32
33
llvm::BasicBlock *BB;
33
34
llvm::BasicBlock::iterator It;
34
35
Context *Ctx;
35
- pointer getInstr (llvm::BasicBlock::iterator It) const ;
36
+ LLVM_ABI pointer getInstr (llvm::BasicBlock::iterator It) const ;
36
37
37
38
public:
38
39
BBIterator () : BB(nullptr ), Ctx(nullptr ) {}
39
40
BBIterator (llvm::BasicBlock *BB, llvm::BasicBlock::iterator It, Context *Ctx)
40
41
: BB(BB), It(It), Ctx(Ctx) {}
41
42
reference operator *() const { return *getInstr (It); }
42
- BBIterator &operator ++();
43
+ LLVM_ABI BBIterator &operator ++();
43
44
BBIterator operator ++(int ) {
44
45
auto Copy = *this ;
45
46
++*this ;
46
47
return Copy;
47
48
}
48
- BBIterator &operator --();
49
+ LLVM_ABI BBIterator &operator --();
49
50
BBIterator operator --(int ) {
50
51
auto Copy = *this ;
51
52
--*this ;
@@ -60,14 +61,14 @@ class BBIterator {
60
61
// / the instruction is not found in the IR-to-SandboxIR tables.
61
62
pointer get () const { return getInstr (It); }
62
63
// / \Returns the parent BB.
63
- BasicBlock *getNodeParent () const ;
64
+ LLVM_ABI BasicBlock *getNodeParent () const ;
64
65
};
65
66
66
67
// / Contains a list of sandboxir::Instruction's.
67
68
class BasicBlock : public Value {
68
69
// / Builds a graph that contains all values in \p BB in their original form
69
70
// / i.e., no vectorization is taking place here.
70
- void buildBasicBlockFromLLVMIR (llvm::BasicBlock *LLVMBB);
71
+ LLVM_ABI void buildBasicBlockFromLLVMIR (llvm::BasicBlock *LLVMBB);
71
72
friend class Context ; // For `buildBasicBlockFromIR`
72
73
friend class Instruction ; // For LLVM Val.
73
74
@@ -82,9 +83,9 @@ class BasicBlock : public Value {
82
83
static bool classof (const Value *From) {
83
84
return From->getSubclassID () == Value::ClassID::Block;
84
85
}
85
- Function *getParent () const ;
86
+ LLVM_ABI Function *getParent () const ;
86
87
using iterator = BBIterator;
87
- iterator begin () const ;
88
+ LLVM_ABI iterator begin () const ;
88
89
iterator end () const {
89
90
auto *BB = cast<llvm::BasicBlock>(Val);
90
91
return iterator (BB, BB->end (), &Ctx);
@@ -96,10 +97,10 @@ class BasicBlock : public Value {
96
97
return std::make_reverse_iterator (begin ());
97
98
}
98
99
Context &getContext () const { return Ctx; }
99
- Instruction *getTerminator () const ;
100
+ LLVM_ABI Instruction *getTerminator () const ;
100
101
bool empty () const { return begin () == end (); }
101
- Instruction &front () const ;
102
- Instruction &back () const ;
102
+ LLVM_ABI Instruction &front () const ;
103
+ LLVM_ABI Instruction &back () const ;
103
104
104
105
#ifndef NDEBUG
105
106
void verify () const final ;
0 commit comments