[PATCH] D22916: [ELF] - Linkerscript: implemented += operator.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 28 11:33:29 PDT 2016
ruiu added inline comments.
================
Comment at: ELF/LinkerScript.cpp:818
@@ +817,3 @@
+SymbolAssignment *ScriptParser::readAssignment(StringRef Name) {
+ Expr E = getAssignmentExpr(Name, next());
+ auto *Cmd = new SymbolAssignment(Name, E);
----------------
It can be like this. You don't have to call combine() to handle operators that is known at compile time.
StringRef Op = next();
assert(Op == "=" || Op == "+=");
Expr E = readExpr();
if (Op == "+=")
E = [=](uint64_t Dot) { return getSymbolValue(Name, Dot) + E(Dot); };
auto *Cmd = new SymbolAssignment(Name, E);
...
https://reviews.llvm.org/D22916
More information about the llvm-commits
mailing list