Fix call to APSInt constructor - it doesn't take an initial value, just a
authorLang Hames <lhames@gmail.com>
Sun, 27 May 2012 21:39:49 +0000 (21:39 +0000)
committerLang Hames <lhames@gmail.com>
Sun, 27 May 2012 21:39:49 +0000 (21:39 +0000)
bitwidth and signedness. Also rename the variable to reflect its purpose.

No test case - discovered during random code exploration.

llvm-svn: 157547

clang/lib/AST/MicrosoftMangle.cpp

index 6918ce4..c2811fb 100644 (file)
@@ -317,10 +317,11 @@ void MicrosoftCXXNameMangler::mangleNumber(const llvm::APSInt &Value) {
     char Encoding[64];
     char *EndPtr = Encoding+sizeof(Encoding);
     char *CurPtr = EndPtr;
-    llvm::APSInt Fifteen(Value.getBitWidth(), 15);
+    llvm::APSInt NibbleMask(Value.getBitWidth());
+    NibbleMask = 0xf;
     for (int i = 0, e = Value.getActiveBits() / 4; i != e; ++i) {
-      *--CurPtr = 'A' + Value.And(Fifteen).lshr(i*4).getLimitedValue(15);
-      Fifteen = Fifteen.shl(4);
+      *--CurPtr = 'A' + Value.And(NibbleMask).lshr(i*4).getLimitedValue(0xf);
+      NibbleMask = NibbleMask.shl(4);
     };
     Out.write(CurPtr, EndPtr-CurPtr);
     Out << '@';