-
Notifications
You must be signed in to change notification settings - Fork 3
/
llvm-11.patch
481 lines (447 loc) · 21.1 KB
/
llvm-11.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
# KLEE
diff --git a/klee/include/klee/Internal/Support/ModuleUtil.h b/klee/include/klee/Internal/Support/ModuleUtil.h
index e80fc673..a6c320ba 100644
--- a/klee/include/klee/Internal/Support/ModuleUtil.h
+++ b/klee/include/klee/Internal/Support/ModuleUtil.h
@@ -12,7 +12,7 @@
#include "klee/Config/Version.h"
-#include "llvm/IR/CallSite.h"
+#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Module.h"
#include <memory>
@@ -43,7 +43,7 @@ linkModules(std::vector<std::unique_ptr<llvm::Module>> &modules,
/// If `moduleIsFullyLinked` is set to true it will be assumed that the
/// module containing the `llvm::CallSite` is fully linked. This assumption
/// allows resolution of functions that are marked as overridable.
-llvm::Function *getDirectCallTarget(llvm::CallSite, bool moduleIsFullyLinked);
+llvm::Function *getDirectCallTarget(const llvm::CallBase&, bool moduleIsFullyLinked);
/// Return true iff the given Function value is used in something
/// other than a direct call (or a constant expression that
diff --git a/klee/include/klee/util/GetElementPtrTypeIterator.h b/klee/include/klee/util/GetElementPtrTypeIterator.h
index cdbc36bc..21be7ee7 100644
--- a/klee/include/klee/util/GetElementPtrTypeIterator.h
+++ b/klee/include/klee/util/GetElementPtrTypeIterator.h
@@ -65,8 +65,7 @@ class generic_gep_type_iterator
llvm::Type *operator*() const { return CurTy; }
llvm::Type *getIndexedType() const {
- llvm::CompositeType *CT = cast<llvm::CompositeType>(CurTy);
- return CT->getTypeAtIndex(getOperand());
+ return llvm::GetElementPtrInst::getTypeAtIndex(CurTy, getOperand());
}
// This is a non-standard operator->. It allows you to call methods on the
@@ -76,10 +75,12 @@ class generic_gep_type_iterator
llvm::Value *getOperand() const { return asValue(*OpIt); }
generic_gep_type_iterator& operator++() { // Preincrement
- if (llvm::CompositeType *CT = dyn_cast<llvm::CompositeType>(CurTy)) {
- CurTy = CT->getTypeAtIndex(getOperand());
+ if (llvm::isa<llvm::StructType>(CurTy) ||
+ llvm::isa<llvm::ArrayType>(CurTy) ||
+ llvm::isa<llvm::VectorType>(CurTy)) {
+ CurTy = llvm::GetElementPtrInst::getTypeAtIndex(CurTy, getOperand());
#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0)
- } else if (auto ptr = dyn_cast<llvm::PointerType>(CurTy)) {
+ } else if (auto ptr = llvm::dyn_cast<llvm::PointerType>(CurTy)) {
CurTy = ptr->getElementType();
#endif
} else {
diff --git a/klee/lib/Core/Executor.cpp b/klee/lib/Core/Executor.cpp
index 3748fdbf..4f6de3a7 100644
--- a/klee/lib/Core/Executor.cpp
+++ b/klee/lib/Core/Executor.cpp
@@ -55,7 +55,6 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.h"
-#include "llvm/IR/CallSite.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Function.h"
@@ -533,7 +532,7 @@ Executor::setModule(std::vector<std::unique_ptr<llvm::Module>> &modules,
SmallString<128> LibPath(opts.LibraryDir);
llvm::sys::path::append(LibPath, "libkleeRuntimeIntrinsic.bca");
std::string error;
- if (!klee::loadFile(LibPath.str(), modules[0]->getContext(), modules,
+ if (!klee::loadFile(LibPath.c_str(), modules[0]->getContext(), modules,
error)) {
klee_error("Could not load KLEE intrinsic file %s", LibPath.c_str());
}
@@ -672,7 +671,7 @@ void Executor::initializeGlobals(ExecutionState &state) {
// not defined in this module; if it isn't resolvable then it
// should be null.
if (f->hasExternalWeakLinkage() &&
- !externalDispatcher->resolveSymbol(f->getName())) {
+ !externalDispatcher->resolveSymbol(f->getName().str())) {
// insert nullptr
globalAddresses.emplace(f, KValue(Expr::createPointer(0)));
} else {
@@ -770,7 +769,7 @@ void Executor::initializeGlobals(ExecutionState &state) {
if (i->getName() == "__dso_handle") {
addr = &__dso_handle; // wtf ?
} else {
- addr = externalDispatcher->resolveSymbol(i->getName());
+ addr = externalDispatcher->resolveSymbol(i->getName().str());
}
if (!addr)
klee_error("unable to load symbol(%s) while initializing globals.",
@@ -1803,8 +1802,7 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
Expr::Width to = getWidthForLLVMType(t);
if (from != to) {
- CallSite cs = (isa<InvokeInst>(caller) ? CallSite(cast<InvokeInst>(caller)) :
- CallSite(cast<CallInst>(caller)));
+ CallBase &cs = cast<CallBase>(*caller);
// XXX need to check other param attrs ?
#if LLVM_VERSION_CODE >= LLVM_VERSION(5, 0)
@@ -2064,10 +2062,10 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
// Ignore debug intrinsic calls
if (isa<DbgInfoIntrinsic>(i))
break;
- CallSite cs(i);
+ CallBase &cs = cast<CallBase>(*i);
unsigned numArgs = cs.arg_size();
- Value *fp = cs.getCalledValue();
+ Value *fp = cs.getCalledOperand();
Function *f = getTargetFunction(fp, state);
if (isa<InlineAsm>(fp)) {
@@ -2848,7 +2846,21 @@ void Executor::computeOffsets(KGEPInstruction *kgepi, TypeIt ib, TypeIt ie) {
uint64_t addend = sl->getElementOffset((unsigned) ci->getZExtValue());
constantOffset = constantOffset->Add(ConstantExpr::alloc(addend,
Context::get().getPointerWidth()));
- } else if (const auto set = dyn_cast<SequentialType>(*ii)) {
+ } else if (const auto set = dyn_cast<ArrayType>(*ii)) {
+ uint64_t elementSize =
+ kmodule->targetData->getTypeStoreSize(set->getElementType());
+ Value *operand = ii.getOperand();
+ if (Constant *c = dyn_cast<Constant>(operand)) {
+ ref<ConstantExpr> index =
+ cast<ConstantExpr>(evalConstant(c).getValue())->SExt(Context::get().getPointerWidth());
+ ref<ConstantExpr> addend =
+ index->Mul(ConstantExpr::alloc(elementSize,
+ Context::get().getPointerWidth()));
+ constantOffset = constantOffset->Add(addend);
+ } else {
+ kgepi->indices.push_back(std::make_pair(index, elementSize));
+ }
+ } else if (const auto set = dyn_cast<VectorType>(*ii)) {
uint64_t elementSize =
kmodule->targetData->getTypeStoreSize(set->getElementType());
Value *operand = ii.getOperand();
@@ -3559,13 +3571,13 @@ void Executor::callExternalFunction(ExecutionState &state,
return;
if (ExternalCalls == ExternalCallPolicy::Pure &&
- nokExternals.count(function->getName()) > 0) {
+ nokExternals.count(function->getName().str()) > 0) {
terminateStateOnError(state, "failed external call", User);
return;
}
if (ExternalCalls == ExternalCallPolicy::None
- && !okExternals.count(function->getName())) {
+ && !okExternals.count(function->getName().str())) {
klee_warning("Disallowed call to external function: %s\n",
function->getName().str().c_str());
terminateStateOnError(state, "external calls disallowed", User);
@@ -3573,7 +3585,7 @@ void Executor::callExternalFunction(ExecutionState &state,
}
if (ExternalCalls == ExternalCallPolicy::Pure
- && !okExternals.count(function->getName())) {
+ && !okExternals.count(function->getName().str())) {
auto retTy = function->getReturnType();
if (retTy->isVoidTy()) {
@@ -4553,33 +4565,30 @@ size_t Executor::getAllocationAlignment(const llvm::Value *allocSite) const {
size_t alignment = 0;
llvm::Type *type = NULL;
std::string allocationSiteName(allocSite->getName().str());
- if (const GlobalValue *GV = dyn_cast<GlobalValue>(allocSite)) {
- alignment = GV->getAlignment();
- if (const GlobalVariable *globalVar = dyn_cast<GlobalVariable>(GV)) {
+ if (const GlobalObject *GO = dyn_cast<GlobalObject>(allocSite)) {
+ alignment = GO->getAlignment();
+ if (const GlobalVariable *globalVar = dyn_cast<GlobalVariable>(GO)) {
// All GlobalVariables's have pointer type
llvm::PointerType *ptrType =
dyn_cast<llvm::PointerType>(globalVar->getType());
assert(ptrType && "globalVar's type is not a pointer");
type = ptrType->getElementType();
} else {
- type = GV->getType();
+ type = GO->getType();
}
} else if (const AllocaInst *AI = dyn_cast<AllocaInst>(allocSite)) {
alignment = AI->getAlignment();
type = AI->getAllocatedType();
} else if (isa<InvokeInst>(allocSite) || isa<CallInst>(allocSite)) {
// FIXME: Model the semantics of the call to use the right alignment
- llvm::Value *allocSiteNonConst = const_cast<llvm::Value *>(allocSite);
- const CallSite cs = (isa<InvokeInst>(allocSiteNonConst)
- ? CallSite(cast<InvokeInst>(allocSiteNonConst))
- : CallSite(cast<CallInst>(allocSiteNonConst)));
+ const CallBase &cs = cast<CallBase>(*allocSite);
llvm::Function *fn =
klee::getDirectCallTarget(cs, /*moduleIsFullyLinked=*/true);
if (fn)
allocationSiteName = fn->getName().str();
if (allocationSiteName.compare(0, 17, "__VERIFIER_nondet") == 0) {
- type = cast<CallInst>(cs.getInstruction())->getType();
+ type = cast<CallInst>(allocSite)->getType();
alignment = 0;
} else {
klee_warning_once(fn != NULL ? fn : allocSite,
diff --git a/klee/lib/Core/ExternalDispatcher.cpp b/klee/lib/Core/ExternalDispatcher.cpp
index 2b537b7d..dc1fb0ad 100644
--- a/klee/lib/Core/ExternalDispatcher.cpp
+++ b/klee/lib/Core/ExternalDispatcher.cpp
@@ -10,7 +10,6 @@
#include "ExternalDispatcher.h"
#include "klee/Config/Version.h"
-#include "llvm/IR/CallSite.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/IRBuilder.h"
@@ -196,7 +195,7 @@ bool ExternalDispatcherImpl::executeCall(Function *f, Instruction *i,
std::move(dispatchModuleUniq)); // MCJIT takes ownership
// Force code generation
uint64_t fnAddr =
- executionEngine->getFunctionAddress(dispatcher->getName());
+ executionEngine->getFunctionAddress(dispatcher->getName().str());
executionEngine->finalizeObject();
assert(fnAddr && "failed to get function address");
(void)fnAddr;
@@ -253,16 +252,10 @@ bool ExternalDispatcherImpl::runProtectedCall(Function *f, uint64_t *args) {
Function *ExternalDispatcherImpl::createDispatcher(Function *target,
Instruction *inst,
Module *module) {
- if (!resolveSymbol(target->getName()))
+ if (!resolveSymbol(target->getName().str()))
return 0;
- CallSite cs;
- if (inst->getOpcode() == Instruction::Call) {
- cs = CallSite(cast<CallInst>(inst));
- } else {
- cs = CallSite(cast<InvokeInst>(inst));
- }
-
+ CallBase &cs = cast<CallBase>(*inst);
Value **args = new Value *[cs.arg_size()];
std::vector<Type *> nullary;
@@ -292,8 +285,7 @@ Function *ExternalDispatcherImpl::createDispatcher(Function *target,
// Each argument will be passed by writing it into gTheArgsP[i].
unsigned i = 0, idx = 2;
- for (CallSite::arg_iterator ai = cs.arg_begin(), ae = cs.arg_end(); ai != ae;
- ++ai, ++i) {
+ for (auto ai = cs.arg_begin(), ae = cs.arg_end(); ai != ae; ++ai, ++i) {
// Determine the type the argument will be passed as. This accommodates for
// the corresponding code in Executor.cpp for handling calls to bitcasted
// functions.
diff --git a/klee/lib/Core/Searcher.cpp b/klee/lib/Core/Searcher.cpp
index 0d5d61e2..385f285f 100644
--- a/klee/lib/Core/Searcher.cpp
+++ b/klee/lib/Core/Searcher.cpp
@@ -25,7 +25,6 @@
#include "klee/Internal/Support/ModuleUtil.h"
#include "klee/Internal/System/Time.h"
#include "klee/Internal/Support/ErrorHandling.h"
-#include "llvm/IR/CallSite.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
diff --git a/klee/lib/Core/StatsTracker.cpp b/klee/lib/Core/StatsTracker.cpp
index 95305658..8a10dccb 100644
--- a/klee/lib/Core/StatsTracker.cpp
+++ b/klee/lib/Core/StatsTracker.cpp
@@ -27,7 +27,6 @@
#include "UserSearcher.h"
#include "llvm/IR/BasicBlock.h"
-#include "llvm/IR/CallSite.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
@@ -136,7 +135,7 @@ static bool instructionIsCoverable(Instruction *i) {
Instruction *prev = &*(--it);
if (isa<CallInst>(prev) || isa<InvokeInst>(prev)) {
Function *target =
- getDirectCallTarget(CallSite(prev), /*moduleIsFullyLinked=*/true);
+ getDirectCallTarget(cast<CallBase>(*prev), /*moduleIsFullyLinked=*/true);
if (target && target->doesNotReturn())
return false;
}
@@ -795,15 +794,14 @@ void StatsTracker::computeReachableUncovered() {
for (BasicBlock::iterator it = bbIt->begin(), ie = bbIt->end();
it != ie; ++it) {
Instruction *inst = &*it;
- if (isa<CallInst>(inst) || isa<InvokeInst>(inst)) {
- CallSite cs(inst);
- if (isa<InlineAsm>(cs.getCalledValue())) {
+ if (const CallBase *cs = dyn_cast<CallBase>(inst)) {
+ if (isa<InlineAsm>(cs->getCalledOperand())) {
// We can never call through here so assume no targets
// (which should be correct anyhow).
callTargets.insert(std::make_pair(inst,
std::vector<Function*>()));
} else if (Function *target = getDirectCallTarget(
- cs, /*moduleIsFullyLinked=*/true)) {
+ *cs, /*moduleIsFullyLinked=*/true)) {
callTargets[inst].push_back(target);
} else {
callTargets[inst] =
diff --git a/klee/lib/Module/InstructionInfoTable.cpp b/klee/lib/Module/InstructionInfoTable.cpp
index 48575c82..eda913f7 100644
--- a/klee/lib/Module/InstructionInfoTable.cpp
+++ b/klee/lib/Module/InstructionInfoTable.cpp
@@ -86,7 +86,7 @@ static std::string getFullPath(llvm::StringRef Directory,
llvm::SmallString<128> file_pathname(Directory);
llvm::sys::path::append(file_pathname, FileName);
- return file_pathname.str();
+ return file_pathname.c_str();
}
class DebugInfoExtractor {
diff --git a/klee/lib/Module/ModuleUtil.cpp b/klee/lib/Module/ModuleUtil.cpp
index 6adaee6d..132880d4 100644
--- a/klee/lib/Module/ModuleUtil.cpp
+++ b/klee/lib/Module/ModuleUtil.cpp
@@ -82,11 +82,11 @@ GetAllUndefinedSymbols(Module *M, std::set<std::string> &UndefinedSymbols) {
for (auto const &Function : *M) {
if (Function.hasName()) {
if (Function.isDeclaration())
- UndefinedSymbols.insert(Function.getName());
+ UndefinedSymbols.insert(Function.getName().str());
else if (!Function.hasLocalLinkage()) {
assert(!Function.hasDLLImportStorageClass() &&
"Found dllimported non-external symbol!");
- DefinedSymbols.insert(Function.getName());
+ DefinedSymbols.insert(Function.getName().str());
}
}
}
@@ -95,17 +95,17 @@ GetAllUndefinedSymbols(Module *M, std::set<std::string> &UndefinedSymbols) {
I != E; ++I)
if (I->hasName()) {
if (I->isDeclaration())
- UndefinedSymbols.insert(I->getName());
+ UndefinedSymbols.insert(I->getName().str());
else if (!I->hasLocalLinkage()) {
assert(!I->hasDLLImportStorageClass() && "Found dllimported non-external symbol!");
- DefinedSymbols.insert(I->getName());
+ DefinedSymbols.insert(I->getName().str());
}
}
for (Module::const_alias_iterator I = M->alias_begin(), E = M->alias_end();
I != E; ++I)
if (I->hasName())
- DefinedSymbols.insert(I->getName());
+ DefinedSymbols.insert(I->getName().str());
// Prune out any defined symbols from the undefined symbols set
@@ -251,8 +251,8 @@ klee::linkModules(std::vector<std::unique_ptr<llvm::Module>> &modules,
return composite;
}
-Function *klee::getDirectCallTarget(CallSite cs, bool moduleIsFullyLinked) {
- Value *v = cs.getCalledValue();
+Function *klee::getDirectCallTarget(const CallBase &cs, bool moduleIsFullyLinked) {
+ Value *v = cs.getCalledOperand();
bool viaConstantExpr = false;
// Walk through aliases and bitcasts to try to find
// the function being called.
@@ -287,14 +287,11 @@ Function *klee::getDirectCallTarget(CallSite cs, bool moduleIsFullyLinked) {
static bool valueIsOnlyCalled(const Value *v) {
for (auto user : v->users()) {
- if (const auto *instr = dyn_cast<Instruction>(user)) {
- // Make sure the instruction is a call or invoke.
- CallSite cs(const_cast<Instruction *>(instr));
- if (!cs) return false;
-
+ // Make sure the instruction is a call or invoke.
+ if (const auto *cs = dyn_cast<CallBase>(user)) {
// Make sure that the value is only the target of this call and
// not an argument.
- if (cs.hasArgument(v))
+ if (cs->hasArgument(v))
return false;
} else if (const auto *ce = dyn_cast<ConstantExpr>(user)) {
if (ce->getOpcode() == Instruction::BitCast)
diff --git a/klee/lib/Module/RaiseAsm.cpp b/klee/lib/Module/RaiseAsm.cpp
index b9131018..c3cab7ac 100644
--- a/klee/lib/Module/RaiseAsm.cpp
+++ b/klee/lib/Module/RaiseAsm.cpp
@@ -47,7 +47,7 @@ bool RaiseAsmPass::runOnInstruction(Module &M, Instruction *I) {
if (!ci)
return false;
- InlineAsm *ia = dyn_cast<InlineAsm>(ci->getCalledValue());
+ InlineAsm *ia = dyn_cast<InlineAsm>(ci->getCalledOperand());
if (!ia)
return false;
diff --git a/klee/tools/klee/main.cpp b/klee/tools/klee/main.cpp
index 093080f8..7933029b 100644
--- a/klee/tools/klee/main.cpp
+++ b/klee/tools/klee/main.cpp
@@ -481,7 +481,7 @@ void KleeHandler::setInterpreter(Interpreter *i) {
std::string KleeHandler::getOutputFilename(const std::string &filename) {
SmallString<128> path = m_outputDirectory;
sys::path::append(path,filename);
- return path.str();
+ return path.c_str();
}
std::unique_ptr<llvm::raw_fd_ostream>
@@ -953,7 +953,7 @@ std::string KleeHandler::getRunTimeLibraryPath(const char *argv0) {
KLEE_DEBUG_WITH_TYPE("klee_runtime", llvm::dbgs() <<
libDir.c_str() << "\n");
- return libDir.str();
+ return libDir.c_str();
}
//===----------------------------------------------------------------------===//
@@ -1217,7 +1217,7 @@ void externalsAndGlobalsCheck(const llvm::Module *m) {
for (BasicBlock::const_iterator it = bbIt->begin(), ie = bbIt->end();
it != ie; ++it) {
if (const CallInst *ci = dyn_cast<CallInst>(it)) {
- if (isa<InlineAsm>(ci->getCalledValue())) {
+ if (isa<InlineAsm>(ci->getCalledOperand())) {
klee_warning_once(&*fnIt,
"function \"%s\" has inline asm",
fnIt->getName().data());
@@ -1238,7 +1238,7 @@ void externalsAndGlobalsCheck(const llvm::Module *m) {
it = m->alias_begin(), ie = m->alias_end();
it != ie; ++it) {
std::map<std::string, bool>::iterator it2 =
- externals.find(it->getName());
+ externals.find(it->getName().str());
if (it2!=externals.end())
externals.erase(it2);
}
diff --git a/klee/lib/Module/KModule.cpp b/klee/lib/Module/KModule.cpp
index 90b7411d..c3f43976 100644
--- a/klee/lib/Module/KModule.cpp
+++ b/klee/lib/Module/KModule.cpp
@@ -27,7 +27,6 @@
#else
#include "llvm/Bitcode/ReaderWriter.h"
#endif
-#include "llvm/IR/CallSite.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
@@ -471,13 +470,13 @@ KFunction::KFunction(llvm::Function *_function,
instructionsMap[inst] = ki;
if (isa<CallInst>(it) || isa<InvokeInst>(it)) {
- CallSite cs(inst);
+ CallBase &cs = cast<CallBase>(*inst);
unsigned numArgs = cs.arg_size();
ki->operands = new int[numArgs+1];
- ki->operands[0] = getOperandNum(cs.getCalledValue(), registerMap, km,
+ ki->operands[0] = getOperandNum(cs.getCalledOperand(), registerMap, km,
ki);
for (unsigned j=0; j<numArgs; j++) {
- Value *v = cs.getArgument(j);
+ Value *v = cs.getArgOperand(j);
ki->operands[j+1] = getOperandNum(v, registerMap, km, ki);
}
} else {
diff --git a/klee/lib/Module/Optimize.cpp b/klee/lib/Module/Optimize.cpp
index 44708b1..9fd8e8a 100644
--- a/klee/lib/Module/Optimize.cpp
+++ b/klee/lib/Module/Optimize.cpp
@@ -108,7 +108,7 @@ static void AddStandardCompilePasses(legacy::PassManager &PM) {
addPass(PM, createPromoteMemoryToRegisterPass());// Kill useless allocas
addPass(PM, createGlobalOptimizerPass()); // Optimize out global vars
addPass(PM, createGlobalDCEPass()); // Remove unused fns and globs
- addPass(PM, createIPConstantPropagationPass());// IP Constant Propagation
+ addPass(PM, createSCCPPass()); // Constant prop with SCCP
addPass(PM, createDeadArgEliminationPass()); // Dead argument elimination
addPass(PM, createInstructionCombiningPass()); // Clean up after IPCP & DAE
addPass(PM, createCFGSimplificationPass()); // Clean up after IPCP & DAE