[PATCH] D22916: [ELF] - Linkerscript: implemented += operator.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 28 13:54:51 PDT 2016
grimar 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);
----------------
ruiu wrote:
> 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);
> ...
Fixed.
https://reviews.llvm.org/D22916
More information about the llvm-commits
mailing list