summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-07-24 21:37:57 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-07-24 21:37:57 +0000
commit356f3289fee15344fa412fcdb2492c47f378fe11 (patch)
treefcc9811125578ce8d57c06b50eca59c642fbda73 /llvm/lib/Support
parentd4dff190a4bf8eda4d13f8942e107327fab685b7 (diff)
downloadbcm5719-llvm-356f3289fee15344fa412fcdb2492c47f378fe11.tar.gz
bcm5719-llvm-356f3289fee15344fa412fcdb2492c47f378fe11.zip
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>. llvm-svn: 7301
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/Mangler.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Support/Mangler.cpp b/llvm/lib/Support/Mangler.cpp
index 3ed85d11a01..5bae6f04f67 100644
--- a/llvm/lib/Support/Mangler.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud