[PATCH] D13869: instruction 'align' in asm blocks works incorrectly with some cases of parameters

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 19 16:28:58 PDT 2015


rnk added inline comments.

================
Comment at: lib/MC/MCParser/AsmParser.cpp:4513
@@ -4512,3 +4512,3 @@
   Info.AsmRewrites->push_back(
-      AsmRewrite(AOK_Align, IDLoc, 5, Log2_64(IntValue)));
+      AsmRewrite(AOK_Align, IDLoc, 5, IntValue));
   return false;
----------------
We don't need to pass IntValue here.

================
Comment at: lib/MC/MCParser/AsmParser.cpp:4715
@@ -4714,2 +4714,3 @@
     case AOK_Align: {
       unsigned Val = AR.Val;
+      OS << ".align " ;
----------------
Val is unused now.

================
Comment at: lib/MC/MCParser/AsmParser.cpp:4718
@@ -4718,1 +4717,3 @@
+      
       // Skip the original immediate.
+      AdditionalSkip = 1;
----------------
This comment is inaccurate now

================
Comment at: lib/MC/MCParser/AsmParser.cpp:4719
@@ -4718,4 +4718,3 @@
       // Skip the original immediate.
-      assert(Val < 10 && "Expected alignment less then 2^10.");
-      AdditionalSkip = (Val < 4) ? 2 : Val < 7 ? 3 : 4;
+      AdditionalSkip = 1;
       break;
----------------
We don't need AdditionalSkip at all if you drop the trailing space on ".align ".


http://reviews.llvm.org/D13869





More information about the llvm-commits mailing list