[cfe-commits] r157583 - in /cfe/trunk: lib/AST/MicrosoftMangle.cpp test/CodeGenCXX/mangle-ms-templates.cpp

Charles Davis cdavis at mines.edu
Mon May 28 09:53:33 PDT 2012


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 at XZ"
 
+  IntTemplate<5> five;
+// CHECK: call {{.*}} @"\01??0?$IntTemplate@$04@@QAE at XZ"
+
   IntTemplate<11> eleven;
 // CHECK: call {{.*}} @"\01??0?$IntTemplate@$0L@@@QAE at XZ"
 





More information about the cfe-commits mailing list