[PATCH] D26935: [ELF] Allow `ASSERT` in output section descriptions

Meador Inge via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 08:28:53 PST 2016


meadori added inline comments.


================
Comment at: ELF/LinkerScript.cpp:474
+  if (auto *Cmd = dyn_cast<AssertCommand>(&Base)) {
+    Cmd->Expression(0);
+    return;
----------------
ruiu wrote:
> Don't you need to pass Dot instead of 0, do you?
Yup, you are right.  Will fix.


================
Comment at: ELF/LinkerScript.cpp:1424-1428
     if (SymbolAssignment *Assignment = readProvideOrAssignment(Tok))
       Cmd->Commands.emplace_back(Assignment);
     else if (BytesDataCommand *Data = readBytesDataCommand(Tok))
       Cmd->Commands.emplace_back(Data);
+    else if (Tok == "ASSERT") {
----------------
ruiu wrote:
> Since you added {}, please add braces to all if's here.
Will do.


================
Comment at: ELF/LinkerScript.cpp:1430-1431
+      Cmd->Commands.emplace_back(new AssertCommand(readAssert()));
+      // GNU LD expects an "ASSERT" statement to end with a ";" in
+      // this context.
+      expect(";");
----------------
ruiu wrote:
> Remove this comment as it is obvious.
Will do.


https://reviews.llvm.org/D26935





More information about the llvm-commits mailing list