about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorRichard Trembecký <richardt@centrum.sk>2016-05-04 15:21:45 +0200
committerMartinNowack <martin.nowack@gmail.com>2018-07-12 23:25:49 +0100
commit2868f6a64cae3a11db3282247253a7a9556ee5a8 (patch)
tree35f606883cecf452e818fcc960ed78f451fc8b0f
parent9968c00bdd7626249b6bd3f4df3f00da7406b0c1 (diff)
downloadklee-2868f6a64cae3a11db3282247253a7a9556ee5a8.tar.gz
llvm38: no more implicit iterators
LLVM commit eac309550f25 removed implicit iterator conversions. So we
have to get the iterators explicitly now.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
-rw-r--r--lib/Core/StatsTracker.cpp4
-rw-r--r--lib/Module/IntrinsicCleaner.cpp4
-rw-r--r--lib/Module/LowerSwitch.cpp8
3 files changed, 16 insertions, 0 deletions
diff --git a/lib/Core/StatsTracker.cpp b/lib/Core/StatsTracker.cpp
index 725cfd56..97e7fccb 100644
--- a/lib/Core/StatsTracker.cpp
+++ b/lib/Core/StatsTracker.cpp
@@ -636,7 +636,11 @@ static std::vector<Instruction*> getSuccs(Instruction *i) {
     for (succ_iterator it = succ_begin(bb), ie = succ_end(bb); it != ie; ++it)
       res.push_back(&*(it->begin()));
   } else {
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8)
+    res.push_back(&*(++(i->getIterator())));
+#else
     res.push_back(&*(++BasicBlock::iterator(i)));
+#endif
   }
 
   return res;
diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp
index 3729ff82..0f7eb223 100644
--- a/lib/Module/IntrinsicCleaner.cpp
+++ b/lib/Module/IntrinsicCleaner.cpp
@@ -110,7 +110,11 @@ bool IntrinsicCleanerPass::runOnBasicBlock(BasicBlock &b, Module &M) {
       case Intrinsic::uadd_with_overflow:
       case Intrinsic::usub_with_overflow:
       case Intrinsic::umul_with_overflow: {
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8)
+        IRBuilder<> builder(ii->getParent(), ii->getIterator());
+#else
         IRBuilder<> builder(ii->getParent(), ii);
+#endif
 
         Value *op1 = ii->getArgOperand(0);
         Value *op2 = ii->getArgOperand(1);
diff --git a/lib/Module/LowerSwitch.cpp b/lib/Module/LowerSwitch.cpp
index 0f4e8b1e..05688521 100644
--- a/lib/Module/LowerSwitch.cpp
+++ b/lib/Module/LowerSwitch.cpp
@@ -64,7 +64,11 @@ 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(F->getContext(), "NodeBlock");
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8)
+    Function::iterator FI = origBlock->getIterator();
+#else
     Function::iterator FI = origBlock;
+#endif
     F->getBasicBlockList().insert(++FI, newBlock);
     
     ICmpInst *cmpInst = 
@@ -101,7 +105,11 @@ void LowerSwitchPass::processSwitchInst(SwitchInst *SI) {
   // if-then statements go to this and the PHI nodes are happy.
   BasicBlock* newDefault = BasicBlock::Create(F->getContext(), "newDefault");
 
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8)
+  F->getBasicBlockList().insert(defaultBlock->getIterator(), newDefault);
+#else
   F->getBasicBlockList().insert(defaultBlock, newDefault);
+#endif
   BranchInst::Create(defaultBlock, newDefault);
 
   // If there is an entry in any PHI nodes for the default edge, make sure