diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp index 12d54ae1223..86d1e16589b 100644 --- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp +++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp @@ -103,8 +103,8 @@ static ExFunc lookupFunction(const Function *F) { if (FnPtr == 0) FnPtr = FuncNames["lle_X_"+F->getName()]; if (FnPtr == 0) // Try calling a generic function... if it exists... - FnPtr = (ExFunc)(intptr_t)sys::DynamicLibrary::SearchForAddressOfSymbol( - ("lle_X_"+F->getName()).c_str()); + FnPtr = (ExFunc)(intptr_t) + sys::DynamicLibrary::SearchForAddressOfSymbol("lle_X_"+F->getName()); if (FnPtr != 0) ExportedFunctions->insert(std::make_pair(F, FnPtr)); // Cache for later return FnPtr; diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 4f0a5a8b4ec..d49a02397bf 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -1924,7 +1924,7 @@ bool CWriter::doInitialization(Module &M) { Out << " __HIDDEN__"; if (I->hasName() && I->getName()[0] == 1) - Out << " LLVM_ASM(\"" << I->getName().c_str()+1 << "\")"; + Out << " LLVM_ASM(\"" << I->getName().substr(1) << "\")"; Out << ";\n"; } diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index 71af8a90411..7c5d09ec1b0 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -430,7 +430,10 @@ namespace { } else { name = getTypePrefix(val->getType()); } - name += (val->hasName() ? val->getName() : utostr(uniqueNum++)); + if (val->hasName()) + name += val->getName(); + else + name += utostr(uniqueNum++); sanitize(name); NameSet::iterator NI = UsedNames.find(name); if (NI != UsedNames.end())