Skip to content

Commit 621fe56

Browse files
committed
Remove LLVMContext and its include.
llvm-svn: 89644
1 parent 5f76620 commit 621fe56

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "llvm/Transforms/Utils/Local.h"
2727
#include "llvm/Constants.h"
2828
#include "llvm/Instructions.h"
29-
#include "llvm/LLVMContext.h"
3029
#include "llvm/Module.h"
3130
#include "llvm/Attributes.h"
3231
#include "llvm/Support/CFG.h"
@@ -57,7 +56,7 @@ FunctionPass *llvm::createCFGSimplificationPass() {
5756

5857
/// ChangeToUnreachable - Insert an unreachable instruction before the specified
5958
/// instruction, making it and the rest of the code in the block dead.
60-
static void ChangeToUnreachable(Instruction *I, LLVMContext &Context) {
59+
static void ChangeToUnreachable(Instruction *I) {
6160
BasicBlock *BB = I->getParent();
6261
// Loop over all of the successors, removing BB's entry from any PHI
6362
// nodes.
@@ -95,8 +94,7 @@ static void ChangeToCall(InvokeInst *II) {
9594
}
9695

9796
static bool MarkAliveBlocks(BasicBlock *BB,
98-
SmallPtrSet<BasicBlock*, 128> &Reachable,
99-
LLVMContext &Context) {
97+
SmallPtrSet<BasicBlock*, 128> &Reachable) {
10098

10199
SmallVector<BasicBlock*, 128> Worklist;
102100
Worklist.push_back(BB);
@@ -119,7 +117,7 @@ static bool MarkAliveBlocks(BasicBlock *BB,
119117
// though.
120118
++BBI;
121119
if (!isa<UnreachableInst>(BBI)) {
122-
ChangeToUnreachable(BBI, Context);
120+
ChangeToUnreachable(BBI);
123121
Changed = true;
124122
}
125123
break;
@@ -135,7 +133,7 @@ static bool MarkAliveBlocks(BasicBlock *BB,
135133
if (isa<UndefValue>(Ptr) ||
136134
(isa<ConstantPointerNull>(Ptr) &&
137135
SI->getPointerAddressSpace() == 0)) {
138-
ChangeToUnreachable(SI, Context);
136+
ChangeToUnreachable(SI);
139137
Changed = true;
140138
break;
141139
}
@@ -161,7 +159,7 @@ static bool MarkAliveBlocks(BasicBlock *BB,
161159
/// otherwise.
162160
static bool RemoveUnreachableBlocksFromFn(Function &F) {
163161
SmallPtrSet<BasicBlock*, 128> Reachable;
164-
bool Changed = MarkAliveBlocks(F.begin(), Reachable, F.getContext());
162+
bool Changed = MarkAliveBlocks(F.begin(), Reachable);
165163

166164
// If there are unreachable blocks in the CFG...
167165
if (Reachable.size() == F.size())

0 commit comments

Comments
 (0)