mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-10 18:11:19 +00:00
[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
This commit is contained in:
parent
a2d228b570
commit
7d37f05a44
@ -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 << '@';
|
||||
}
|
||||
|
@ -48,6 +48,9 @@ void template_mangling() {
|
||||
// CHECK: call {{.*}} @"\01??0?$BoolTemplate@$00@@QAE@XZ"
|
||||
// CHECK: call {{.*}} @"\01??$Foo@H@?$BoolTemplate@$00@@QAEXH@Z"
|
||||
|
||||
IntTemplate<0> zero;
|
||||
// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0A@@@QAE@XZ"
|
||||
|
||||
IntTemplate<5> five;
|
||||
// CHECK: call {{.*}} @"\01??0?$IntTemplate@$04@@QAE@XZ"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user