aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-22 21:10:12 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-22 21:10:12 +0000
commit936763a0d9afa8dae0eb432322e605185b0866a4 (patch)
treea2d615962f71519d0e2d78ed7ead310ab9bb95fa /lib
parent04180e3b56e56ca1060ad74a9b242ff2322175cc (diff)
downloadexternal_llvm-936763a0d9afa8dae0eb432322e605185b0866a4.zip
external_llvm-936763a0d9afa8dae0eb432322e605185b0866a4.tar.gz
external_llvm-936763a0d9afa8dae0eb432322e605185b0866a4.tar.bz2
Simplify some uses of Value::getName()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76786 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp4
-rw-r--r--lib/Target/CBackend/CBackend.cpp2
-rw-r--r--lib/Target/CppBackend/CPPBackend.cpp5
3 files changed, 7 insertions, 4 deletions
diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
index 12d54ae..86d1e16 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 4f0a5a8..d49a023 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 71af8a9..7c5d09e 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())