[lld] r304334 - Simplify. NFC.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed May 31 12:53:40 PDT 2017
Author: rafael
Date: Wed May 31 14:53:40 2017
New Revision: 304334
URL: http://llvm.org/viewvc/llvm-project?rev=304334&view=rev
Log:
Simplify. NFC.
Modified:
lld/trunk/ELF/LinkerScript.cpp
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=304334&r1=304333&r2=304334&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Wed May 31 14:53:40 2017
@@ -51,9 +51,8 @@ LinkerScript *elf::Script;
uint64_t ExprValue::getValue() const {
if (Sec) {
- if (Sec->getOutputSection())
- return alignTo(Sec->getOffset(Val) + Sec->getOutputSection()->Addr,
- Alignment);
+ if (OutputSection *OS = Sec->getOutputSection())
+ return alignTo(Sec->getOffset(Val) + OS->Addr, Alignment);
error("unable to evaluate expression: input section " + Sec->Name +
" has no output section assigned");
}
More information about the llvm-commits
mailing list