diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2013-04-19 21:20:56 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2013-04-19 21:20:56 +0000 |
commit | 8caffc1e75b34d97bbb225322243e5bad0f379bf (patch) | |
tree | 3726c69aeee821c34951e75460fbc03efcc836d1 /lib/Target | |
parent | a317eb822905397b0e1c9ba0c343306ff96c3d4d (diff) | |
download | external_llvm-8caffc1e75b34d97bbb225322243e5bad0f379bf.zip external_llvm-8caffc1e75b34d97bbb225322243e5bad0f379bf.tar.gz external_llvm-8caffc1e75b34d97bbb225322243e5bad0f379bf.tar.bz2 |
Do not mangle in MS-way the globals with magic \001 in the name.
Based on the patch by David Nadlinger!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179889 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/Mangler.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Target/Mangler.cpp b/lib/Target/Mangler.cpp index edfd421..d31efa8 100644 --- a/lib/Target/Mangler.cpp +++ b/lib/Target/Mangler.cpp @@ -188,7 +188,12 @@ void Mangler::getNameWithPrefix(SmallVectorImpl<char> &OutName, // If this global has a name, handle it simply. if (GV->hasName()) { - getNameWithPrefix(OutName, GV->getName(), PrefixTy); + StringRef Name = GV->getName(); + getNameWithPrefix(OutName, Name, PrefixTy); + // No need to do anything else if the global has the special "do not mangle" + // flag in the name. + if (Name[0] == 1) + return; } else { // Get the ID for the global, assigning a new one if we haven't got one // already. |