[PATCH] D30163: [ELF] - Postpone evaluation of LMA offset.
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 21 09:57:12 PST 2017
ruiu added inline comments.
================
Comment at: lld/trunk/ELF/LinkerScript.cpp:568
if (Cmd->LMAExpr)
- LMAOffset = Cmd->LMAExpr(Dot) - Dot;
+ CurLMA = {Cmd->LMAExpr, Dot};
OutputSectionBase *Sec = findSection<ELFT>(Cmd->Name, *OutputSections);
----------------
If you change this to
LMAOffset = [=] { return Cmd->LMAExpr(Dot) - Dot; }
I generally don't like to overuse std::pair because its member names (first and second) sometimes hurts code readability.
================
Comment at: lld/trunk/ELF/LinkerScript.h:301
uintX_t Dot;
- uintX_t LMAOffset = 0;
+ std::pair<Expr, uintX_t> CurLMA;
OutputSectionBase *CurOutSec = nullptr;
----------------
This can be just `Expr LMAOffset`, right?
Repository:
rL LLVM
https://reviews.llvm.org/D30163
More information about the llvm-commits
mailing list