Author: cdavis
Date: Mon May 28 11:53:33 2012
New Revision: 157583
URL: http://llvm.org/viewvc/llvm-project?rev=157583&view=rev
Log:
Fix mangling of integral template arguments between 1 and 10. Add a test case
for this. Reported by Timur Iskhodzhanov.
Modified:
cfe/trunk/lib/AST/MicrosoftMangle.cpp
cfe/trunk/test/CodeGenCXX/mangle-ms-templates.cpp
Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=157583&r1=157582&r2=157583&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Mon May 28 11:53:33 2012
@@ -309,8 +309,8 @@
return;
}
if (Value.uge(1) && Value.ule(10))
- (Value-llvm::APSInt(llvm::APInt(Value.getBitWidth(), 1,
Value.isSigned()))).print(Out,
-
false);
+ (Value-llvm::APSInt(llvm::APInt(Value.getBitWidth(), 1, Value.isSigned()),
+ Value.isUnsigned())).print(Out, false);
else {
// We have to build up the encoding in reverse order, so it will come
// out right when we write it out.
Modified: cfe/trunk/test/CodeGenCXX/mangle-ms-templates.cpp
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-ms-templates.cpp?rev=157583&r1=157582&r2=157583&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-ms-templates.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-ms-templates.cpp Mon May 28 11:53:33 2012
@@ -38,6 +38,9 @@
BoolTemplate<true> _true;
// CHECK: call {{.*}} @"\01??0?$BoolTemplate@$00@@QAE@XZ"
+ IntTemplate<5> five;
+// CHECK: call {{.*}} @"\01??0?$IntTemplate@$04@@QAE@XZ"
+
IntTemplate<11> eleven;
// CHECK: call {{.*}} @"\01??0?$IntTemplate@$0L@@@QAE@XZ"
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits