about summary refs log tree commit diff homepage
path: root/lib/Module/KModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Module/KModule.cpp')
-rw-r--r--lib/Module/KModule.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp
index b16be68a..50bb28bb 100644
--- a/lib/Module/KModule.cpp
+++ b/lib/Module/KModule.cpp
@@ -475,13 +475,14 @@ KFunction::KFunction(llvm::Function *_function,
       if (isa<CallInst>(it) || isa<InvokeInst>(it)) {
 #if LLVM_VERSION_CODE >= LLVM_VERSION(8, 0)
         const CallBase &cs = cast<CallBase>(*inst);
+        Value *val = cs.getCalledOperand();
 #else
         const CallSite cs(inst);
+        Value *val = cs.getCalledValue();
 #endif
         unsigned numArgs = cs.arg_size();
         ki->operands = new int[numArgs+1];
-        ki->operands[0] = getOperandNum(cs.getCalledValue(), registerMap, km,
-                                        ki);
+        ki->operands[0] = getOperandNum(val, registerMap, km, ki);
         for (unsigned j=0; j<numArgs; j++) {
           Value *v = cs.getArgOperand(j);
           ki->operands[j+1] = getOperandNum(v, registerMap, km, ki);