[PATCH] D19976: [ELF, WIP] - Prototype of possible linkerscript redesign.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 17 12:10:08 PDT 2016


grimar added inline comments.

================
Comment at: ELF/LinkerScript.cpp:49
@@ -47,3 +48,3 @@
 public:
-  ExprParser(std::vector<StringRef> &Tokens, uint64_t Dot)
+  ExprParser(const std::vector<StringRef> &Tokens, uint64_t Dot)
       : ScriptParserBase(Tokens), Dot(Dot) {}
----------------
majnemer wrote:
> Why not just use an `ArrayRef<StringRef>`?
Fixed

================
Comment at: ELF/LinkerScript.cpp:81
@@ -79,3 +80,3 @@
 
-static uint64_t evalExpr(std::vector<StringRef> &Tokens, uint64_t Dot) {
+static uint64_t evalExpr(const std::vector<StringRef> &Tokens, uint64_t Dot) {
   return ExprParser(Tokens, Dot).run();
----------------
majnemer wrote:
> Ditto.
Fixed

================
Comment at: ELF/LinkerScript.cpp:318
@@ +317,3 @@
+
+    auto I = std::find_if(Unassigned.begin(), Unassigned.end(),
+                          [&](InputSectionBase<ELFT> *S) {
----------------
majnemer wrote:
> Consider using llvm::find_if, it's a little more concise.
Fixed, thanks for hint, I did not know about llvm::find_if


https://reviews.llvm.org/D19976





More information about the llvm-commits mailing list