Skip to content

Commit 550c17a

Browse files
committed
move to cpp file
Signed-off-by: Nathan Gauër <[email protected]>
1 parent 817fd98 commit 550c17a

File tree

2 files changed

+26
-27
lines changed

2 files changed

+26
-27
lines changed

llvm/include/llvm/Transforms/Scalar/Reg2Mem.h

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@
1313
#ifndef LLVM_TRANSFORMS_SCALAR_REG2MEM_H
1414
#define LLVM_TRANSFORMS_SCALAR_REG2MEM_H
1515

16-
#include "llvm/Analysis/LoopInfo.h"
17-
#include "llvm/IR/Dominators.h"
1816
#include "llvm/IR/PassManager.h"
19-
#include "llvm/InitializePasses.h"
20-
#include "llvm/Pass.h"
2117

2218
namespace llvm {
2319

@@ -26,27 +22,6 @@ class RegToMemPass : public PassInfoMixin<RegToMemPass> {
2622
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
2723
};
2824

29-
class RegToMemWrapperPass : public FunctionPass {
30-
public:
31-
static char ID;
32-
33-
RegToMemWrapperPass();
34-
35-
void getAnalysisUsage(AnalysisUsage &AU) const override {
36-
AU.setPreservesAll();
37-
38-
AU.addPreserved<DominatorTreeWrapperPass>();
39-
AU.addRequired<DominatorTreeWrapperPass>();
40-
41-
AU.addPreserved<LoopInfoWrapperPass>();
42-
AU.addRequired<LoopInfoWrapperPass>();
43-
}
44-
45-
bool runOnFunction(Function &F) override;
46-
};
47-
48-
FunctionPass *createRegToMemWrapperPass();
49-
5025
} // end namespace llvm
5126

5227
#endif // LLVM_TRANSFORMS_SCALAR_REG2MEM_H

llvm/lib/Transforms/Scalar/Reg2Mem.cpp

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "llvm/Transforms/Scalar/Reg2Mem.h"
1919
#include "llvm/ADT/Statistic.h"
2020
#include "llvm/Analysis/LoopInfo.h"
21+
#include "llvm/InitializePasses.h"
2122
#include "llvm/IR/BasicBlock.h"
2223
#include "llvm/IR/CFG.h"
2324
#include "llvm/IR/Dominators.h"
@@ -107,13 +108,36 @@ PreservedAnalyses RegToMemPass::run(Function &F, FunctionAnalysisManager &AM) {
107108
}
108109

109110
namespace llvm {
111+
110112
void initializeRegToMemWrapperPassPass(PassRegistry &);
113+
114+
class RegToMemWrapperPass : public FunctionPass {
115+
public:
116+
static char ID;
117+
118+
RegToMemWrapperPass();
119+
120+
void getAnalysisUsage(AnalysisUsage &AU) const override {
121+
AU.setPreservesAll();
122+
123+
AU.addPreserved<DominatorTreeWrapperPass>();
124+
AU.addRequired<DominatorTreeWrapperPass>();
125+
126+
AU.addPreserved<LoopInfoWrapperPass>();
127+
AU.addRequired<LoopInfoWrapperPass>();
128+
}
129+
130+
bool runOnFunction(Function &F) override;
131+
};
132+
133+
FunctionPass *createRegToMemWrapperPass();
134+
111135
} // namespace llvm
112136

113-
INITIALIZE_PASS_BEGIN(RegToMemWrapperPass, "reg-to-mem", "", true, true)
137+
INITIALIZE_PASS_BEGIN(RegToMemWrapperPass, "reg2mem", "", true, true)
114138
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass);
115139
INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass);
116-
INITIALIZE_PASS_END(RegToMemWrapperPass, "reg-to-mem", "", true, true)
140+
INITIALIZE_PASS_END(RegToMemWrapperPass, "reg2mem", "", true, true)
117141

118142
char RegToMemWrapperPass::ID = 0;
119143

0 commit comments

Comments
 (0)