summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-08-17 23:17:17 +0000
committerDevang Patel <dpatel@apple.com>2009-08-17 23:17:17 +0000
commitc6faffde6cc16d7f37665c95a6c66272fa20fbc2 (patch)
tree0cc8b3269b7f90d096d9adf2d0bc27781bc9482e /llvm/lib
parentde3a06933de5b1544f26573029a4efdaf8c982d8 (diff)
downloadbcm5719-llvm-c6faffde6cc16d7f37665c95a6c66272fa20fbc2.tar.gz
bcm5719-llvm-c6faffde6cc16d7f37665c95a6c66272fa20fbc2.zip
Add prefix only if it is needed.
llvm-svn: 79289
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Mangler.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/Mangler.cpp b/llvm/lib/VMCore/Mangler.cpp
index 44cf7782662..8c918434e3f 100644
--- a/llvm/lib/VMCore/Mangler.cpp
+++ b/llvm/lib/VMCore/Mangler.cpp
@@ -105,8 +105,9 @@ std::string Mangler::makeNameProper(const std::string &X,
return Result;
}
-
- Result = X.substr(0, I-X.begin());
+
+ if (NeedPrefix)
+ Result = X.substr(0, I-X.begin());
// Otherwise, construct the string the expensive way.
for (std::string::const_iterator E = X.end(); I != E; ++I) {
OpenPOWER on IntegriCloud