summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/unittests/IR/DominatorTreeTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/llvm/unittests/IR/DominatorTreeTest.cpp')
-rw-r--r--gnu/llvm/unittests/IR/DominatorTreeTest.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/gnu/llvm/unittests/IR/DominatorTreeTest.cpp b/gnu/llvm/unittests/IR/DominatorTreeTest.cpp
index 3aef4d64cbc..6c49deb32d9 100644
--- a/gnu/llvm/unittests/IR/DominatorTreeTest.cpp
+++ b/gnu/llvm/unittests/IR/DominatorTreeTest.cpp
@@ -29,7 +29,8 @@ namespace llvm {
bool runOnFunction(Function &F) override {
DominatorTree *DT =
&getAnalysis<DominatorTreeWrapperPass>().getDomTree();
- PostDominatorTree *PDT = &getAnalysis<PostDominatorTree>();
+ PostDominatorTree *PDT =
+ &getAnalysis<PostDominatorTreeWrapperPass>().getPostDomTree();
Function::iterator FI = F.begin();
BasicBlock *BB0 = &*FI++;
@@ -206,7 +207,7 @@ namespace llvm {
}
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequired<DominatorTreeWrapperPass>();
- AU.addRequired<PostDominatorTree>();
+ AU.addRequired<PostDominatorTreeWrapperPass>();
}
DPass() : FunctionPass(ID) {
initializeDPassPass(*PassRegistry::getPassRegistry());
@@ -214,7 +215,7 @@ namespace llvm {
};
char DPass::ID = 0;
- std::unique_ptr<Module> makeLLVMModule(DPass *P) {
+ std::unique_ptr<Module> makeLLVMModule(LLVMContext &Context, DPass *P) {
const char *ModuleStrig =
"declare i32 @g()\n" \
"define void @f(i32 %x) personality i32 ()* @g {\n" \
@@ -238,14 +239,14 @@ namespace llvm {
" %y9 = phi i32 [0, %bb2], [%y4, %bb1]\n"
" ret void\n" \
"}\n";
- LLVMContext &C = getGlobalContext();
SMDiagnostic Err;
- return parseAssemblyString(ModuleStrig, Err, C);
+ return parseAssemblyString(ModuleStrig, Err, Context);
}
TEST(DominatorTree, Unreachable) {
DPass *P = new DPass();
- std::unique_ptr<Module> M = makeLLVMModule(P);
+ LLVMContext Context;
+ std::unique_ptr<Module> M = makeLLVMModule(Context, P);
legacy::PassManager Passes;
Passes.add(P);
Passes.run(*M);
@@ -255,5 +256,5 @@ namespace llvm {
INITIALIZE_PASS_BEGIN(DPass, "dpass", "dpass", false, false)
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
-INITIALIZE_PASS_DEPENDENCY(PostDominatorTree)
+INITIALIZE_PASS_DEPENDENCY(PostDominatorTreeWrapperPass)
INITIALIZE_PASS_END(DPass, "dpass", "dpass", false, false)