Move File from SymbolBody to Symbol.
With this Symbol has the same size as before, but DefinedRegular goes
from 72 to 64 bytes.
I also find this a bit easier to read. There are fewer places
initializing File for example.
This has a small but measurable speed improvement on all tests (1%
max).
llvm-svn: 310142
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 71d8f32..1fb787a 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -79,8 +79,8 @@
// as variables in linker scripts. Doing so allows us to write expressions
// like this: `alignment = 16; . = ALIGN(., alignment)`
uint64_t SymValue = Value.isAbsolute() ? Value.getValue() : 0;
- replaceBody<DefinedRegular>(Sym, Cmd->Name, /*IsLocal=*/false, Visibility,
- STT_NOTYPE, SymValue, 0, Sec, nullptr);
+ replaceBody<DefinedRegular>(Sym, nullptr, Cmd->Name, /*IsLocal=*/false,
+ Visibility, STT_NOTYPE, SymValue, 0, Sec);
return Sym->body();
}