[llvm-commits] CVS: llvm/lib/Support/Mangler.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Thu Jul 24 16:39:02 PDT 2003


Changes in directory llvm/lib/Support:

Mangler.cpp updated: 1.1 -> 1.2

---
Log message:

Cleanups:

Mangler.cpp: Constify parameter to makeNameProper, and use const_iterator.
 Make Count an unsigned int, and use utostr().
 Don't name parameters things that start with underscore.
Mangler.h: All of the above, and also: Add Emacs mode-line.  Include <set>.


---
Diffs of the changes:

Index: llvm/lib/Support/Mangler.cpp
diff -u llvm/lib/Support/Mangler.cpp:1.1 llvm/lib/Support/Mangler.cpp:1.2
--- llvm/lib/Support/Mangler.cpp:1.1	Thu Jul 24 15:20:25 2003
+++ llvm/lib/Support/Mangler.cpp	Thu Jul 24 16:37:57 2003
@@ -17,9 +17,10 @@
 /// - in them, so we mangle these characters into the strings "d_",
 /// "s_", and "D_", respectively.
 /// 
-std::string Mangler::makeNameProper(std::string x) {
+std::string Mangler::makeNameProper(const std::string &x) {
   std::string tmp;
-  for (std::string::iterator sI = x.begin(), sEnd = x.end(); sI != sEnd; sI++)
+  for (std::string::const_iterator sI = x.begin(), sEnd = x.end();
+       sI != sEnd; sI++)
     switch (*sI) {
     case '.': tmp += "d_"; break;
     case ' ': tmp += "s_"; break;
@@ -54,14 +55,14 @@
         makeNameProper(V->getName());      
     }
   } else {
-    name = "ltmp_" + itostr(Count++) + "_"
+    name = "ltmp_" + utostr(Count++) + "_"
       + utostr(V->getType()->getUniqueID());
   }
   Memo[V] = name;
   return name;
 }
 
-Mangler::Mangler(Module &_M) : M(_M)
+Mangler::Mangler(Module &M_) : M(M_)
 {
   // Calculate which global values have names that will collide when we throw
   // away type information.





More information about the llvm-commits mailing list