diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-14 06:04:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-14 06:04:35 +0000 |
commit | 4cda8c8bef0ddc37d375069b9fa734cc6c9f2abc (patch) | |
tree | 0d1dbf0fa27121183c6d5fce5e791e854c15ce20 /include/llvm/Support/Mangler.h | |
parent | f8a4c09a1bd62183b5308271b29b7f80971946bb (diff) | |
download | external_llvm-4cda8c8bef0ddc37d375069b9fa734cc6c9f2abc.zip external_llvm-4cda8c8bef0ddc37d375069b9fa734cc6c9f2abc.tar.gz external_llvm-4cda8c8bef0ddc37d375069b9fa734cc6c9f2abc.tar.bz2 |
Change the X86 asmprinter to use the mangler to apply suffixes like "$non_lazy_ptr"
to symbols instead of doing it with "printSuffixedName". This gets us to the point
where there is a real separation between computing a symbol name and printing it,
something I need for MC printer stuff.
This patch also fixes a corner case bug where unnamed private globals wouldn't get
the private label prefix.
Next up, rename all uses of getValueName -> getMangledName for better greppability,
and then tackle the ppc/arm backends to eliminate "printSuffixedName".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75610 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Mangler.h')
-rw-r--r-- | include/llvm/Support/Mangler.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/llvm/Support/Mangler.h b/include/llvm/Support/Mangler.h index 0dc26ed..95ff110 100644 --- a/include/llvm/Support/Mangler.h +++ b/include/llvm/Support/Mangler.h @@ -82,10 +82,17 @@ public: return (AcceptableChars[X/32] & (1 << (X&31))) != 0; } - /// getValueName - Returns the mangled name of V, an LLVM Value, - /// in the current module. + /// getMangledName - Returns the mangled name of V, an LLVM Value, + /// in the current module. If 'Suffix' is specified, the name ends with the + /// specified suffix. If 'ForcePrivate' is specified, the label is specified + /// to have a private label prefix. /// - std::string getValueName(const GlobalValue *V, const char *Suffix = ""); + std::string getMangledName(const GlobalValue *V, const char *Suffix = "", + bool ForcePrivate = false); + + std::string getValueName(const GlobalValue *V, const char *Suffix = "") { + return getMangledName(V, Suffix); + } /// makeNameProper - We don't want identifier names with ., space, or /// - in them, so we mangle these characters into the strings "d_", |