summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/MicrosoftMangle.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2012-11-08 23:38:59 +0000
committerNico Weber <nicolasweber@gmx.de>2012-11-08 23:38:59 +0000
commit7d37f05a4447c83f29876a6e3515250cafe13c0e (patch)
treeb9021c9ac94c52a84787ff5177ca751fcd7e1e08 /clang/lib/AST/MicrosoftMangle.cpp
parenta2d228b57002137aaf556d1ee319d2255a9b5c76 (diff)
downloadbcm5719-llvm-7d37f05a4447c83f29876a6e3515250cafe13c0e.tar.gz
bcm5719-llvm-7d37f05a4447c83f29876a6e3515250cafe13c0e.zip
[Windows] Fix mangling of number literal '0'
Do this by making the mangleNumber(APSInt) overload look like the int64_t version. (The latter should probably just delegate to the former). Test from Evgeny Eltsin! llvm-svn: 167599
Diffstat (limited to 'clang/lib/AST/MicrosoftMangle.cpp')
-rw-r--r--clang/lib/AST/MicrosoftMangle.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp
index 3765f3087e5..b7bfc70123e 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/lib/AST/MicrosoftMangle.cpp
@@ -351,10 +351,10 @@ void MicrosoftCXXNameMangler::mangleNumber(const llvm::APSInt &Value) {
char *CurPtr = EndPtr;
llvm::APSInt NibbleMask(Value.getBitWidth(), Value.isUnsigned());
NibbleMask = 0xf;
- for (int i = 0, e = (Value.getActiveBits() + 3) / 4; i != e; ++i) {
+ do {
*--CurPtr = 'A' + Temp.And(NibbleMask).getLimitedValue(0xf);
Temp = Temp.lshr(4);
- }
+ } while (Temp != 0);
Out.write(CurPtr, EndPtr-CurPtr);
Out << '@';
}
OpenPOWER on IntegriCloud