about summary refs log tree commit diff homepage
path: root/lib/Module
diff options
context:
space:
mode:
authorStepan Dyatkovskiy <stpworld@narod.ru>2012-02-01 19:31:42 +0000
committerStepan Dyatkovskiy <stpworld@narod.ru>2012-02-01 19:31:42 +0000
commit6adac1d681f328b1737acfa38f221ce2f3b20ef1 (patch)
tree339c8a169b46758e6a3b8b8d62deffc27f14bdcc /lib/Module
parent5fa73a2145c1150c826e8d8de65ff3c7b3da962c (diff)
downloadklee-6adac1d681f328b1737acfa38f221ce2f3b20ef1.tar.gz
Second compatability fix for SwitchInst refactoring (added compatability with llvm versions < 3.1).
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@149528 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Module')
-rw-r--r--lib/Module/LowerSwitch.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Module/LowerSwitch.cpp b/lib/Module/LowerSwitch.cpp
index 852603b8..fb37da86 100644
--- a/lib/Module/LowerSwitch.cpp
+++ b/lib/Module/LowerSwitch.cpp
@@ -115,9 +115,16 @@ void LowerSwitchPass::processSwitchInst(SwitchInst *SI) {
   }
   
   CaseVector cases;
+  
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 1)
   for (unsigned i = 0; i < SI->getNumCases(); ++i)
     cases.push_back(SwitchCase(SI->getCaseValue(i),
                                SI->getCaseSuccessor(i)));
+#else
+  for (unsigned i = 1; i < SI->getNumSuccessors(); ++i)  
+    cases.push_back(SwitchCase(SI->getSuccessorValue(i),
+                               SI->getSuccessor(i)));
+#endif
   
   // reverse cases, as switchConvert constructs a chain of
   //   basic blocks by appending to the front. if we reverse,