[PATCH] D23063: [ELF] - Linkerscript: implemented SUBALIGN() command.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 18 06:22:13 PDT 2016


grimar added inline comments.

================
Comment at: ELF/LinkerScript.cpp:289
@@ -287,1 +288,3 @@
+        if (Cmd->SubalignExpr)
+          Sec->Alignment = Cmd->SubalignExpr(0);
         OutSec->addSection(Sec);
----------------
ruiu wrote:
> Do not call SubalignExpr in this loop because it's a constant value.
Yes, I thought about that when wrote that initially. Did it to simplify the code a bit. There should be not many output sections and probably none or just few of them them will use SUBALIGN(), so selected one line shorter way.
Fixed.

================
Comment at: ELF/LinkerScript.cpp:915
@@ -909,1 +914,3 @@
 
+Expr ScriptParser::readSubAlign() {
+  expect("(");
----------------
ruiu wrote:
> Use `readParenExpr`.
Done.

================
Comment at: ELF/LinkerScript.h:85
@@ -83,2 +84,3 @@
   Expr AlignExpr;
+  Expr SubAlignExpr;
   std::vector<std::unique_ptr<BaseCommand>> Commands;
----------------
ruiu wrote:
> I'd treat "subalign" as one word, so I'd name `SubalignExpr`.
Done.


https://reviews.llvm.org/D23063





More information about the llvm-commits mailing list