mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-09 05:13:01 +00:00
[PM] Make LowerAtomic a FunctionPass.
Differential Revision: http://reviews.llvm.org/D20025 llvm-svn: 269322
This commit is contained in:
parent
b34fc361f4
commit
9f768c1e2c
@ -110,16 +110,27 @@ static bool LowerStoreInst(StoreInst *SI) {
|
||||
}
|
||||
|
||||
namespace {
|
||||
struct LowerAtomic : public BasicBlockPass {
|
||||
struct LowerAtomic : public FunctionPass {
|
||||
static char ID;
|
||||
LowerAtomic() : BasicBlockPass(ID) {
|
||||
|
||||
LowerAtomic() : FunctionPass(ID) {
|
||||
initializeLowerAtomicPass(*PassRegistry::getPassRegistry());
|
||||
}
|
||||
bool runOnBasicBlock(BasicBlock &BB) override {
|
||||
if (skipBasicBlock(BB))
|
||||
|
||||
bool runOnFunction(Function &F) override {
|
||||
if (skipFunction(F))
|
||||
return false;
|
||||
bool Changed = false;
|
||||
for (BasicBlock::iterator DI = BB.begin(), DE = BB.end(); DI != DE; ) {
|
||||
for (BasicBlock &BB: F) {
|
||||
Changed |= runOnBasicBlock(BB);
|
||||
}
|
||||
return Changed;
|
||||
}
|
||||
|
||||
private:
|
||||
bool runOnBasicBlock(BasicBlock &BB) {
|
||||
bool Changed = false;
|
||||
for (BasicBlock::iterator DI = BB.begin(), DE = BB.end(); DI != DE;) {
|
||||
Instruction *Inst = &*DI++;
|
||||
if (FenceInst *FI = dyn_cast<FenceInst>(Inst))
|
||||
Changed |= LowerFenceInst(FI);
|
||||
|
Loading…
Reference in New Issue
Block a user