Add plumbing for the `linker_private' linkage type. This type is meant for
[oota-llvm.git] / include / llvm / Support / Mangler.h
index e04245dc2b57d4357e70c947c46510b0740d81eb..416f382bef42b0cc8f3a47c8e2e01fe83c7c998d 100644 (file)
@@ -25,6 +25,14 @@ class Value;
 class GlobalValue;
 
 class Mangler {
+public:
+  enum ManglerPrefixTy {
+    DefaultPrefixTy,       ///< Emit default string before each symbol.
+    PrivatePrefixTy,       ///< Emit "private" prefix before each symbol.
+    LinkerPrivatePrefixTy  ///< Emit "linker private" prefix before each symbol.
+  };
+
+private:
   /// Prefix - This string is added to each symbol that is emitted, unless the
   /// symbol is marked as not needing this prefix.
   const char *Prefix;
@@ -33,6 +41,10 @@ class Mangler {
   /// linkage.
   const char *PrivatePrefix;
 
+  /// LinkerPrivatePrefix - This string is emitted before each symbol with
+  /// "linker_private" linkage.
+  const char *LinkerPrivatePrefix;
+
   /// UseQuotes - If this is set, the target accepts global names in quotes,
   /// e.g. "foo bar" is a legal name.  This syntax is used instead of escaping
   /// the space character.  By default, this is false.
@@ -50,12 +62,13 @@ class Mangler {
 
   /// AcceptableChars - This bitfield contains a one for each character that is
   /// allowed to be part of an unmangled name.
-  unsigned AcceptableChars[256/32];
-public:
+  unsigned AcceptableChars[256 / 32];
 
+public:
   // Mangler ctor - if a prefix is specified, it will be prepended onto all
   // symbols.
-  Mangler(Module &M, const char *Prefix = "", const char *privatePrefix = "");
+  Mangler(Module &M, const char *Prefix = "", const char *privatePrefix = "",
+          const char *linkerPrivatePrefix = "");
 
   /// setUseQuotes - If UseQuotes is set to true, this target accepts quoted
   /// strings for assembler labels.
@@ -90,7 +103,7 @@ public:
   /// from getValueName.
   ///
   std::string makeNameProper(const std::string &x,
-                             bool hasPrivateLinkage = false);
+                             ManglerPrefixTy PrefixTy = DefaultPrefixTy);
 };
 
 } // End llvm namespace