Remove unnecessary StringRefs and strlen calls to construct them.

Signed-off-by: Vassil Vassilev <vvasilev@cern.ch>
This commit is contained in:
Roman Zulak 2016-09-18 20:23:34 -04:00 committed by sftnight
parent c3869d00cc
commit 8f44fe40c5
2 changed files with 3 additions and 4 deletions

View File

@ -157,10 +157,9 @@ void* IncrementalExecutor::NotifyLazyFunctionCreators(const std::string& mangled
if (ret)
return ret;
}
llvm::StringRef name(mangled_name);
void *address = nullptr;
if (m_externalIncrementalExecutor)
address = m_externalIncrementalExecutor->getAddressOfGlobal(name);
address = m_externalIncrementalExecutor->getAddressOfGlobal(mangled_name);
return (address ? address : HandleMissingFunction(mangled_name));
}

View File

@ -687,7 +687,7 @@ namespace cling {
std::string mangledNameIfNeeded;
utils::Analyze::maybeMangleDeclName(FD, mangledNameIfNeeded);
IncrementalExecutor::ExecutionResult ExeRes =
m_Executor->executeWrapper(mangledNameIfNeeded.c_str(), res);
m_Executor->executeWrapper(mangledNameIfNeeded, res);
return ConvertExecutionResult(ExeRes);
}
@ -1210,7 +1210,7 @@ namespace cling {
// Return a symbol's address, and whether it was jitted.
std::string mangledName;
utils::Analyze::maybeMangleDeclName(GD, mangledName);
return getAddressOfGlobal(mangledName.c_str(), fromJIT);
return getAddressOfGlobal(mangledName, fromJIT);
}
void* Interpreter::getAddressOfGlobal(llvm::StringRef SymName,