Add support for appending a suffix to the end of a mangled name.
llvm-svn: 42071
diff --git a/llvm/lib/VMCore/Mangler.cpp b/llvm/lib/VMCore/Mangler.cpp
index 52e3d0d..8b8ba59 100644
--- a/llvm/lib/VMCore/Mangler.cpp
+++ b/llvm/lib/VMCore/Mangler.cpp
@@ -126,7 +126,7 @@
}
-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 @@
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());