We now allow targets to use any prefix they want for global symbols. Lets
authorChris Lattner <sabre@nondot.org>
Tue, 17 Aug 2004 06:06:19 +0000 (06:06 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 17 Aug 2004 06:06:19 +0000 (06:06 +0000)
hear it for ".".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15863 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/AsmPrinter.h
lib/CodeGen/AsmPrinter.cpp

index ac77acce1bbb74378ffaf60b94584bec68851f7e..bace7893af34ccbdfa913610a2ede621cd528d09 100644 (file)
@@ -44,12 +44,12 @@ namespace llvm {
     // Properties to be set by the derived class ctor, used to configure the
     // asmwriter.
 
-    /// UsesUnderscorePrefix - If this flag is set to true, all identifiers
-    /// printed by the asmwriter will include a '_' prefix.
-    bool UsesUnderscorePrefix;
+    /// GlobalPrefix - If this is set to a non-empty string, it is prepended
+    /// onto all global symbols.  This is often used for "_" or ".".
+    const char *GlobalPrefix;
 
     AsmPrinter(std::ostream &o, TargetMachine &tm)
-      : O(o), TM(tm), UsesUnderscorePrefix(false) { }
+      : O(o), TM(tm), GlobalPrefix("") { }
 
     /// doInitialization - Set up the AsmPrinter when we are working on a new
     /// module.  If your pass overrides this, it must make sure to explicitly
index 0cf5823bb8c5de4ce4a08b406fbe06a31c4625f9..a84cc7127f18a3e04ea75cf2205971ceeb70d72c 100644 (file)
@@ -19,7 +19,7 @@
 using namespace llvm;
 
 bool AsmPrinter::doInitialization(Module &M) {
-  Mang = new Mangler(M, UsesUnderscorePrefix);
+  Mang = new Mangler(M, GlobalPrefix);
   return false;
 }