diff options
author | Devang Patel <dpatel@apple.com> | 2009-08-17 23:17:17 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-08-17 23:17:17 +0000 |
commit | 4b49cd298a372b58d22ae41cba7a379e9325bfbd (patch) | |
tree | 5556853eb446d4d93e012e5f8cc8d1da34d632aa /lib/VMCore | |
parent | 606f3d696ff78211524fa49c3ca0c4de6db37041 (diff) | |
download | llvm-4b49cd298a372b58d22ae41cba7a379e9325bfbd.tar.gz llvm-4b49cd298a372b58d22ae41cba7a379e9325bfbd.tar.bz2 llvm-4b49cd298a372b58d22ae41cba7a379e9325bfbd.tar.xz |
Add prefix only if it is needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79289 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Mangler.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/VMCore/Mangler.cpp b/lib/VMCore/Mangler.cpp index 44cf778266..8c918434e3 100644 --- a/lib/VMCore/Mangler.cpp +++ b/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) { |