[PATCH] D84054: [lld][ELF] Add LOG2CEIL builtin ldscript function

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 26 12:26:37 PDT 2020


MaskRay added inline comments.


================
Comment at: lld/ELF/ScriptParser.cpp:1338
+    return [=] {
+      // LOG2CEIL(0) is defined to be 0
+      return llvm::Log2_64_Ceil(
----------------
Append a full stop.


================
Comment at: lld/ELF/ScriptParser.cpp:1340
+      return llvm::Log2_64_Ceil(
+          std::max(a().getValue(), static_cast<uint64_t>(1)));
+    };
----------------
`UINT64_C(1)`


================
Comment at: lld/test/ELF/linkerscript/operators.test:96
+# CHECK-NEXT: 0000000000000002 A log2ceil4
+# CHECK-NEXT: 0000000000000010 A log2ceil10000
+# CHECK-NEXT: 0000000000000011 A log2ceil10001
----------------
I think log2ceil100000000 and log2ceil100000001, no need for log2ceil10000 & log2ceil10001.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84054/new/

https://reviews.llvm.org/D84054





More information about the llvm-commits mailing list