aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Support/Mangler.h2
-rw-r--r--lib/VMCore/Mangler.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/Support/Mangler.h b/include/llvm/Support/Mangler.h
index 1cbc13c..d52ff6a 100644
--- a/include/llvm/Support/Mangler.h
+++ b/include/llvm/Support/Mangler.h
@@ -94,7 +94,7 @@ public:
/// getValueName - Returns the mangled name of V, an LLVM Value,
/// in the current module.
///
- std::string getValueName(const GlobalValue *V);
+ std::string getValueName(const GlobalValue *V, const char *Suffix = "");
std::string getValueName(const Value *V);
/// makeNameProper - We don't want identifier names with ., space, or
diff --git a/lib/VMCore/Mangler.cpp b/lib/VMCore/Mangler.cpp
index 52e3d0d..8b8ba59 100644
--- a/lib/VMCore/Mangler.cpp
+++ b/lib/VMCore/Mangler.cpp
@@ -126,7 +126,7 @@ std::string Mangler::getValueName(const Value *V) {
}
-std::string Mangler::getValueName(const GlobalValue *GV) {
+std::string Mangler::getValueName(const GlobalValue *GV, const char * Suffix) {
// Check to see whether we've already named V.
std::string &Name = Memo[GV];
if (!Name.empty())
@@ -143,7 +143,7 @@ std::string Mangler::getValueName(const GlobalValue *GV) {
static unsigned GlobalID = 0;
Name = "__unnamed_" + utostr(TypeUniqueID) + "_" + utostr(GlobalID++);
} else if (!MangledGlobals.count(GV)) {
- Name = makeNameProper(GV->getName(), Prefix);
+ Name = makeNameProper(GV->getName() + Suffix, Prefix);
} else {
unsigned TypeUniqueID = getTypeID(GV->getType());
Name = "l" + utostr(TypeUniqueID) + "_" + makeNameProper(GV->getName());