diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2003-07-24 21:37:57 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2003-07-24 21:37:57 +0000 |
commit | 4166445b7cde22f81cd1a18b6f33fe94b94bdbb6 (patch) | |
tree | 03122c4a0dceb8905f6573f6bf65529943dd6f77 /lib/Support | |
parent | b198ca304b1abb2784291315f19c89d04e5968fd (diff) | |
download | external_llvm-4166445b7cde22f81cd1a18b6f33fe94b94bdbb6.zip external_llvm-4166445b7cde22f81cd1a18b6f33fe94b94bdbb6.tar.gz external_llvm-4166445b7cde22f81cd1a18b6f33fe94b94bdbb6.tar.bz2 |
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>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7301 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/Mangler.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Support/Mangler.cpp b/lib/Support/Mangler.cpp index 3ed85d1..5bae6f0 100644 --- a/lib/Support/Mangler.cpp +++ b/lib/Support/Mangler.cpp @@ -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 @@ std::string Mangler::getValueName(const Value *V) { 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. |