[PATCH] D22977: [LinkerScript] Support decimal values for filler

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 29 14:45:10 PDT 2016


ruiu added inline comments.

================
Comment at: ELF/LinkerScript.cpp:805
@@ -801,2 +804,3 @@
     return {};
   if (!Tok.startswith("=0x")) {
+    // This must be a decimal.
----------------
Flip this condition so that you can do early return like this.

  if (Tok.startswith("=0x")) {
    next();
    return parseHex(Tok.substr(3));
  }


================
Comment at: ELF/LinkerScript.cpp:815-818
@@ +814,6 @@
+      setError("only single bytes decimal are supported for the filler now");
+    raw_string_ostream SO(HexStr);
+    SO.write_hex(Value);
+    SO.flush();
+    Tok = HexStr;
+  }
----------------
This can be `return { Value }`, no?


https://reviews.llvm.org/D22977





More information about the llvm-commits mailing list