about summary refs log tree commit diff homepage
path: root/lib/Module/LowerSwitch.cpp
diff options
context:
space:
mode:
authorCristian Cadar <c.cadar@imperial.ac.uk>2017-02-27 14:47:33 +0000
committerGitHub <noreply@github.com>2017-02-27 14:47:33 +0000
commitbff9fb9277f890f2fd9b4acd3b9d5eed0e78f967 (patch)
tree29e23676c07a95e83c58b5bcb5f8fd4189efaf45 /lib/Module/LowerSwitch.cpp
parent1b67624c3a2fc1ca6f60d0a2b0f675d046dbba76 (diff)
parent4c8fabc7de30e17ef116b8f413f3a973c29cb56c (diff)
downloadklee-bff9fb9277f890f2fd9b4acd3b9d5eed0e78f967.tar.gz
Merge pull request #600 from jirislaby/no_global_context
llvm: stop using global context
Diffstat (limited to 'lib/Module/LowerSwitch.cpp')
-rw-r--r--lib/Module/LowerSwitch.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Module/LowerSwitch.cpp b/lib/Module/LowerSwitch.cpp
index a98b84ad..7f28748a 100644
--- a/lib/Module/LowerSwitch.cpp
+++ b/lib/Module/LowerSwitch.cpp
@@ -66,7 +66,7 @@ void LowerSwitchPass::switchConvert(CaseItr begin, CaseItr end,
   
   // iterate through all the cases, creating a new BasicBlock for each
   for (CaseItr it = begin; it < end; ++it) {
-    BasicBlock *newBlock = BasicBlock::Create(getGlobalContext(), "NodeBlock");
+    BasicBlock *newBlock = BasicBlock::Create(F->getContext(), "NodeBlock");
     Function::iterator FI = origBlock;
     F->getBasicBlockList().insert(++FI, newBlock);
     
@@ -102,7 +102,7 @@ void LowerSwitchPass::processSwitchInst(SwitchInst *SI) {
 
   // Create a new, empty default block so that the new hierarchy of
   // if-then statements go to this and the PHI nodes are happy.
-  BasicBlock* newDefault = BasicBlock::Create(getGlobalContext(), "newDefault");
+  BasicBlock* newDefault = BasicBlock::Create(F->getContext(), "newDefault");
 
   F->getBasicBlockList().insert(defaultBlock, newDefault);
   BranchInst::Create(defaultBlock, newDefault);