From 4c8fabc7de30e17ef116b8f413f3a973c29cb56c Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Wed, 22 Feb 2017 16:10:21 +0100 Subject: llvm: stop using global context It was marked as deprecated long time ago and finally removed in LLVM 3.9. Remove all uses of getGlobalContext and create our own context. Propagate it all over the code then. [v2] use ctx, not C as name Signed-off-by: Jiri Slaby --- lib/Module/LowerSwitch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Module/LowerSwitch.cpp') 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); -- cgit 1.4.1