diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-01-17 19:23:46 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-01-17 19:23:46 +0000 |
| commit | 83e872e1c411d562ae1fdf31b3d32cde7d6c86da (patch) | |
| tree | cdea944f82ac16c0be863e0a3defcc7f3d288cdd /llvm/include | |
| parent | adecf175876a9a624fc1c5905594a478a53695b8 (diff) | |
| download | bcm5719-llvm-83e872e1c411d562ae1fdf31b3d32cde7d6c86da.tar.gz bcm5719-llvm-83e872e1c411d562ae1fdf31b3d32cde7d6c86da.zip | |
Get MCSymbol out of the mangling business, and move all the logic
to Mangler. Now MCSymbol just decides whether to slap quotes around
a symbol when printing it.
This also fixes some weirdness where two MCSymbols could be created
for the same symbol, if one needed to be mangled and got mangled to
the other one.
llvm-svn: 93690
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/MC/MCSymbol.h | 10 | ||||
| -rw-r--r-- | llvm/include/llvm/Target/Mangler.h | 6 |
2 files changed, 9 insertions, 7 deletions
diff --git a/llvm/include/llvm/MC/MCSymbol.h b/llvm/include/llvm/MC/MCSymbol.h index eb594532fe0..c84babac4a9 100644 --- a/llvm/include/llvm/MC/MCSymbol.h +++ b/llvm/include/llvm/MC/MCSymbol.h @@ -26,7 +26,8 @@ namespace llvm { class raw_ostream; /// MCSymbol - Instances of this class represent a symbol name in the MC file, - /// and MCSymbols are created and unique'd by the MCContext class. + /// and MCSymbols are created and unique'd by the MCContext class. MCSymbols + /// should only be constructed with valid names for the object file. /// /// If the symbol is defined/emitted into the current translation unit, the /// Section member is set to indicate what section it lives in. Otherwise, if @@ -53,7 +54,7 @@ namespace llvm { /// typically does not survive in the .o file's symbol table. Usually /// "Lfoo" or ".foo". unsigned IsTemporary : 1; - + private: // MCContext creates and uniques these. friend class MCContext; MCSymbol(StringRef _Name, bool _IsTemporary) @@ -136,11 +137,6 @@ namespace llvm { /// dump - Print the value to stderr. void dump() const; - - /// printMangledName - Print the specified string in mangled form if it uses - /// any unusual characters. - static void printMangledName(StringRef Str, raw_ostream &OS, - const MCAsmInfo *MAI); }; } // end namespace llvm diff --git a/llvm/include/llvm/Target/Mangler.h b/llvm/include/llvm/Target/Mangler.h index 07ff7e29c0f..8caa6230435 100644 --- a/llvm/include/llvm/Target/Mangler.h +++ b/llvm/include/llvm/Target/Mangler.h @@ -18,6 +18,7 @@ #include <string> namespace llvm { +class StringRef; class Twine; class Value; class GlobalValue; @@ -67,6 +68,11 @@ public: /// have a name, this fills in a unique name for the global. std::string getNameWithPrefix(const GlobalValue *GV, bool isImplicitlyPrivate = false); + + /// appendMangledName - Add the specified string in mangled form if it uses + /// any unusual characters. + static void appendMangledName(SmallVectorImpl<char> &OutName, StringRef Str, + const MCAsmInfo *MAI); }; } // End llvm namespace |

