diff options
author | Frank Busse <bb0xfb@gmail.com> | 2022-06-14 11:27:30 +0100 |
---|---|---|
committer | MartinNowack <2443641+MartinNowack@users.noreply.github.com> | 2022-06-30 10:02:30 +0100 |
commit | 3a8b3bb1e8f8601e8a5598a652fad6d8d510fb30 (patch) | |
tree | 4f887b7925ed52ff01b03dfbb8397ec099447601 /lib | |
parent | 6cc8ee707c1b4337120aa2972e2ad13a4861bbc3 (diff) | |
download | klee-3a8b3bb1e8f8601e8a5598a652fad6d8d510fb30.tar.gz |
rename CallSite to CallBase
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Core/Executor.cpp | 28 | ||||
-rw-r--r-- | lib/Core/ExternalDispatcher.cpp | 6 | ||||
-rw-r--r-- | lib/Core/StatsTracker.cpp | 6 | ||||
-rw-r--r-- | lib/Module/KModule.cpp | 8 | ||||
-rw-r--r-- | lib/Module/ModuleUtil.cpp | 10 |
5 files changed, 29 insertions, 29 deletions
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index 529f8b43..11ad902e 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -1923,10 +1923,10 @@ void Executor::executeCall(ExecutionState &state, KInstruction *ki, Function *f, uint64_t offsets[callingArgs]; // offsets of variadic arguments uint64_t argWidth; // width of current variadic argument - const CallBase &cs = cast<CallBase>(*i); + const CallBase &cb = cast<CallBase>(*i); for (unsigned k = funcArgs; k < callingArgs; k++) { - if (cs.isByValArgument(k)) { - Type *t = cs.getParamByValType(k); + if (cb.isByValArgument(k)) { + Type *t = cb.getParamByValType(k); argWidth = kmodule->targetData->getTypeSizeInBits(t); } else { argWidth = arguments[k]->getWidth(); @@ -1937,10 +1937,10 @@ void Executor::executeCall(ExecutionState &state, KInstruction *ki, Function *f, size += Expr::getMinBytesForWidth(argWidth); } else { #if LLVM_VERSION_CODE >= LLVM_VERSION(11, 0) - MaybeAlign ma = cs.getParamAlign(k); + MaybeAlign ma = cb.getParamAlign(k); unsigned alignment = ma ? ma->value() : 0; #else - unsigned alignment = cs.getParamAlignment(k); + unsigned alignment = cb.getParamAlignment(k); #endif // AMD64-ABI 3.5.7p5: Step 7. Align l->overflow_arg_area upwards to a @@ -1984,7 +1984,7 @@ void Executor::executeCall(ExecutionState &state, KInstruction *ki, Function *f, ObjectState *os = bindObjectInState(state, mo, true); for (unsigned k = funcArgs; k < callingArgs; k++) { - if (!cs.isByValArgument(k)) { + if (!cb.isByValArgument(k)) { os->write(offsets[k], arguments[k]); } else { ConstantExpr *CE = dyn_cast<ConstantExpr>(arguments[k]); @@ -2136,10 +2136,10 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { Expr::Width to = getWidthForLLVMType(t); if (from != to) { - const CallBase &cs = cast<CallBase>(*caller); + const CallBase &cb = cast<CallBase>(*caller); // XXX need to check other param attrs ? - bool isSExt = cs.hasRetAttr(llvm::Attribute::SExt); + bool isSExt = cb.hasRetAttr(llvm::Attribute::SExt); if (isSExt) { result = SExtExpr::create(result, to); } else { @@ -2394,9 +2394,9 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { if (isa<DbgInfoIntrinsic>(i)) break; - const CallBase &cs = cast<CallBase>(*i); - Value *fp = cs.getCalledOperand(); - unsigned numArgs = cs.arg_size(); + const CallBase &cb = cast<CallBase>(*i); + Value *fp = cb.getCalledOperand(); + unsigned numArgs = cb.arg_size(); Function *f = getTargetFunction(fp, state); if (isa<InlineAsm>(fp)) { @@ -2434,7 +2434,7 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { if (from != to) { // XXX need to check other param attrs ? - bool isSExt = cs.paramHasAttr(i, llvm::Attribute::SExt); + bool isSExt = cb.paramHasAttr(i, llvm::Attribute::SExt); if (isSExt) { arguments[i] = SExtExpr::create(arguments[i], to); } else { @@ -4612,9 +4612,9 @@ size_t Executor::getAllocationAlignment(const llvm::Value *allocSite) const { type = AI->getAllocatedType(); } else if (isa<InvokeInst>(allocSite) || isa<CallInst>(allocSite)) { // FIXME: Model the semantics of the call to use the right alignment - const CallBase &cs = cast<CallBase>(*allocSite); + const CallBase &cb = cast<CallBase>(*allocSite); llvm::Function *fn = - klee::getDirectCallTarget(cs, /*moduleIsFullyLinked=*/true); + klee::getDirectCallTarget(cb, /*moduleIsFullyLinked=*/true); if (fn) allocationSiteName = fn->getName().str(); diff --git a/lib/Core/ExternalDispatcher.cpp b/lib/Core/ExternalDispatcher.cpp index c58e2ec8..13b17337 100644 --- a/lib/Core/ExternalDispatcher.cpp +++ b/lib/Core/ExternalDispatcher.cpp @@ -255,8 +255,8 @@ Function *ExternalDispatcherImpl::createDispatcher(Function *target, if (!resolveSymbol(target->getName().str())) return 0; - const CallBase &cs = cast<CallBase>(*inst); - Value **args = new Value *[cs.arg_size()]; + const CallBase &cb = cast<CallBase>(*inst); + Value **args = new Value *[cb.arg_size()]; std::vector<Type *> nullary; @@ -286,7 +286,7 @@ Function *ExternalDispatcherImpl::createDispatcher(Function *target, // Each argument will be passed by writing it into gTheArgsP[i]. unsigned i = 0, idx = 2; - for (auto ai = cs.arg_begin(), ae = cs.arg_end(); ai != ae; ++ai, ++i) { + for (auto ai = cb.arg_begin(), ae = cb.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/lib/Core/StatsTracker.cpp b/lib/Core/StatsTracker.cpp index 11199db1..539b913c 100644 --- a/lib/Core/StatsTracker.cpp +++ b/lib/Core/StatsTracker.cpp @@ -786,14 +786,14 @@ void StatsTracker::computeReachableUncovered() { it != ie; ++it) { Instruction *inst = &*it; if (isa<CallInst>(inst) || isa<InvokeInst>(inst)) { - const CallBase &cs = cast<CallBase>(*inst); - if (isa<InlineAsm>(cs.getCalledOperand())) { + const CallBase &cb = cast<CallBase>(*inst); + if (isa<InlineAsm>(cb.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)) { + cb, /*moduleIsFullyLinked=*/true)) { callTargets[inst].push_back(target); } else { callTargets[inst] = diff --git a/lib/Module/KModule.cpp b/lib/Module/KModule.cpp index 049c6744..294968a3 100644 --- a/lib/Module/KModule.cpp +++ b/lib/Module/KModule.cpp @@ -451,13 +451,13 @@ KFunction::KFunction(llvm::Function *_function, ki->dest = registerMap[inst]; if (isa<CallInst>(it) || isa<InvokeInst>(it)) { - const CallBase &cs = cast<CallBase>(*inst); - Value *val = cs.getCalledOperand(); - unsigned numArgs = cs.arg_size(); + const CallBase &cb = cast<CallBase>(*inst); + Value *val = cb.getCalledOperand(); + unsigned numArgs = cb.arg_size(); ki->operands = new int[numArgs+1]; ki->operands[0] = getOperandNum(val, registerMap, km, ki); for (unsigned j=0; j<numArgs; j++) { - Value *v = cs.getArgOperand(j); + Value *v = cb.getArgOperand(j); ki->operands[j+1] = getOperandNum(v, registerMap, km, ki); } } else { diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp index e1c6e8bd..155b117f 100644 --- a/lib/Module/ModuleUtil.cpp +++ b/lib/Module/ModuleUtil.cpp @@ -270,9 +270,9 @@ klee::linkModules(std::vector<std::unique_ptr<llvm::Module>> &modules, } Function *klee::getDirectCallTarget( - const CallBase &cs, + const CallBase &cb, bool moduleIsFullyLinked) { - Value *v = cs.getCalledOperand(); + Value *v = cb.getCalledOperand(); bool viaConstantExpr = false; // Walk through aliases and bitcasts to try to find // the function being called. @@ -311,12 +311,12 @@ Function *klee::getDirectCallTarget( static bool valueIsOnlyCalled(const Value *v) { for (auto user : v->users()) { // Make sure the instruction is a call or invoke. - if (const auto *cs_ptr = dyn_cast<CallBase>(user)) { - const CallBase &cs = *cs_ptr; + if (const auto *cb_ptr = dyn_cast<CallBase>(user)) { + const CallBase &cb = *cb_ptr; // Make sure that the value is only the target of this call and // not an argument. - if (cs.hasArgument(v)) + if (cb.hasArgument(v)) return false; } else if (const auto *ce = dyn_cast<ConstantExpr>(user)) { if (ce->getOpcode() == Instruction::BitCast) |