summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/MC/MCSymbol.h10
-rw-r--r--llvm/include/llvm/Target/Mangler.h6
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
OpenPOWER on IntegriCloud