File tree 1 file changed +16
-5
lines changed
llvm/lib/Transforms/Scalar
1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -110,16 +110,27 @@ static bool LowerStoreInst(StoreInst *SI) {
110
110
}
111
111
112
112
namespace {
113
- struct LowerAtomic : public BasicBlockPass {
113
+ struct LowerAtomic : public FunctionPass {
114
114
static char ID;
115
- LowerAtomic () : BasicBlockPass(ID) {
115
+
116
+ LowerAtomic () : FunctionPass(ID) {
116
117
initializeLowerAtomicPass (*PassRegistry::getPassRegistry ());
117
118
}
118
- bool runOnBasicBlock (BasicBlock &BB) override {
119
- if (skipBasicBlock (BB))
119
+
120
+ bool runOnFunction (Function &F) override {
121
+ if (skipFunction (F))
120
122
return false ;
121
123
bool Changed = false ;
122
- for (BasicBlock::iterator DI = BB.begin (), DE = BB.end (); DI != DE; ) {
124
+ for (BasicBlock &BB: F) {
125
+ Changed |= runOnBasicBlock (BB);
126
+ }
127
+ return Changed;
128
+ }
129
+
130
+ private:
131
+ bool runOnBasicBlock (BasicBlock &BB) {
132
+ bool Changed = false ;
133
+ for (BasicBlock::iterator DI = BB.begin (), DE = BB.end (); DI != DE;) {
123
134
Instruction *Inst = &*DI++;
124
135
if (FenceInst *FI = dyn_cast<FenceInst>(Inst))
125
136
Changed |= LowerFenceInst (FI);
You can’t perform that action at this time.
0 commit comments