summaryrefslogtreecommitdiff
path: root/lib/VMCore/Mangler.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-09-07 18:20:41 +0000
committerChris Lattner <sabre@nondot.org>2006-09-07 18:20:41 +0000
commit833eb68a1f18f361b2429fe12d13533cc9e3debe (patch)
treefe9fd99cdfbe5b87d8b4e4b2405182c77350a47f /lib/VMCore/Mangler.cpp
parent81fe06a112236f6777730009cb97893aa0acba56 (diff)
downloadllvm-833eb68a1f18f361b2429fe12d13533cc9e3debe.tar.gz
llvm-833eb68a1f18f361b2429fe12d13533cc9e3debe.tar.bz2
llvm-833eb68a1f18f361b2429fe12d13533cc9e3debe.tar.xz
Add new option to leave asm names alone
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30149 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Mangler.cpp')
-rw-r--r--lib/VMCore/Mangler.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/VMCore/Mangler.cpp b/lib/VMCore/Mangler.cpp
index 53719aff2c..8715498b9c 100644
--- a/lib/VMCore/Mangler.cpp
+++ b/lib/VMCore/Mangler.cpp
@@ -33,6 +33,10 @@ std::string Mangler::makeNameProper(const std::string &X, const char *Prefix) {
std::string Result;
if (X.empty()) return X; // Empty names are uniqued by the caller.
+ // If PreserveAsmNames is set, names with asm identifiers are not modified.
+ if (PreserveAsmNames && X[0] == 1)
+ return X;
+
if (!UseQuotes) {
// If X does not start with (char)1, add the prefix.
std::string::const_iterator I = X.begin();
@@ -174,7 +178,8 @@ void Mangler::InsertName(GlobalValue *GV,
Mangler::Mangler(Module &M, const char *prefix)
- : Prefix(prefix), UseQuotes(false), Count(0), TypeCounter(0) {
+ : Prefix(prefix), UseQuotes(false), PreserveAsmNames(false),
+ Count(0), TypeCounter(0) {
std::fill(AcceptableChars,
AcceptableChars+sizeof(AcceptableChars)/sizeof(AcceptableChars[0]),
0);