[llvm-commits] CVS: llvm/include/llvm/Support/Mangler.h

Chris Lattner lattner at cs.uiuc.edu
Thu Nov 10 11:29:42 PST 2005



Changes in directory llvm/include/llvm/Support:

Mangler.h updated: 1.17 -> 1.18
---
Log message:

Add a new option for targets that accept quoted labels.


---
Diffs of the changes:  (+17 -7)

 Mangler.h |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)


Index: llvm/include/llvm/Support/Mangler.h
diff -u llvm/include/llvm/Support/Mangler.h:1.17 llvm/include/llvm/Support/Mangler.h:1.18
--- llvm/include/llvm/Support/Mangler.h:1.17	Thu Nov 10 13:02:52 2005
+++ llvm/include/llvm/Support/Mangler.h	Thu Nov 10 13:29:31 2005
@@ -25,15 +25,15 @@
 class GlobalValue;
 
 class Mangler {
-  /// This keeps track of which global values have had their names
-  /// mangled in the current module.
-  ///
-  std::set<const GlobalValue*> MangledGlobals;
-
   /// Prefix - This string is added to each symbol that is emitted, unless the
   /// symbol is marked as not needing this prefix.
   const char *Prefix;
-
+  
+  /// 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.
+  bool UseQuotes;
+  
   /// Memo - This is used to remember the name that we assign a value.
   ///
   std::map<const Value*, std::string> Memo;
@@ -47,13 +47,20 @@
   std::map<const Type*, unsigned> TypeMap;
   unsigned TypeCounter;
 
-  void InsertName(GlobalValue *GV, std::map<std::string, GlobalValue*> &Names);
+  /// This keeps track of which global values have had their names
+  /// mangled in the current module.
+  ///
+  std::set<const GlobalValue*> MangledGlobals;
 public:
 
   // Mangler ctor - if a prefix is specified, it will be prepended onto all
   // symbols.
   Mangler(Module &M, const char *Prefix = "");
 
+  /// setUseQuotes - If UseQuotes is set to true, this target accepts quoted
+  /// strings for assembler labels.
+  void setUseQuotes(bool Val) { UseQuotes = Val; }
+  
   /// getTypeID - Return a unique ID for the specified LLVM type.
   ///
   unsigned getTypeID(const Type *Ty);
@@ -72,6 +79,9 @@
   /// from getValueName.
   ///
   std::string makeNameProper(const std::string &x, const char *Prefix = "");
+  
+private:
+  void InsertName(GlobalValue *GV, std::map<std::string, GlobalValue*> &Names);
 };
 
 } // End llvm namespace






More information about the llvm-commits mailing list