diff options
author | Lukas Zaoral <lzaoral@redhat.com> | 2020-09-10 17:12:28 +0200 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2020-12-04 20:35:47 +0000 |
commit | b398c94c821edd3e8699026dc00501062eafd5b2 (patch) | |
tree | 862f321cb7e784e28a861f23701e443deeb5ebfe /lib/Core | |
parent | 4ca5a80836de48036e47f611a6ea610a6fb2b54b (diff) | |
download | klee-b398c94c821edd3e8699026dc00501062eafd5b2.tar.gz |
llvm11: Make conversions from StringRef to std::string explicit
The same applies to SmallString. See: llvm/llvm-project@777180a#diff-497ba4c0c527a125d382b51a34f32542
Diffstat (limited to 'lib/Core')
-rw-r--r-- | lib/Core/Executor.cpp | 12 | ||||
-rw-r--r-- | lib/Core/ExternalDispatcher.cpp | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index a0df89f0..333eb563 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -524,7 +524,7 @@ Executor::setModule(std::vector<std::unique_ptr<llvm::Module>> &modules, llvm::sys::path::append(LibPath, "libkleeRuntimeIntrinsic" + opts.OptSuffix + ".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()); } @@ -675,7 +675,7 @@ void Executor::allocateGlobalObjects(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())) { addr = Expr::createPointer(0); } else { addr = Expr::createPointer(reinterpret_cast<std::uint64_t>(&f)); @@ -825,7 +825,7 @@ void Executor::initializeGlobalObjects(ExecutionState &state) { if (v.getName() == "__dso_handle") { addr = &__dso_handle; // wtf ? } else { - addr = externalDispatcher->resolveSymbol(v.getName()); + addr = externalDispatcher->resolveSymbol(v.getName().str()); } if (!addr) { klee_error("Unable to load symbol(%.*s) while initializing globals", @@ -3716,9 +3716,9 @@ void Executor::callExternalFunction(ExecutionState &state, // check if specialFunctionHandler wants it if (specialFunctionHandler->handle(state, function, target, arguments)) return; - - if (ExternalCalls == ExternalCallPolicy::None - && !okExternals.count(function->getName())) { + + if (ExternalCalls == ExternalCallPolicy::None && + !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); diff --git a/lib/Core/ExternalDispatcher.cpp b/lib/Core/ExternalDispatcher.cpp index 7ba8df53..baa5327a 100644 --- a/lib/Core/ExternalDispatcher.cpp +++ b/lib/Core/ExternalDispatcher.cpp @@ -198,7 +198,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; @@ -255,7 +255,7 @@ 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; #if LLVM_VERSION_CODE >= LLVM_VERSION(8, 0) |