summaryrefslogtreecommitdiffstats
path: root/lld/ELF/ScriptParser.cpp
diff options
context:
space:
mode:
authorPeter Smith <peter.smith@linaro.org>2017-07-07 09:11:27 +0000
committerPeter Smith <peter.smith@linaro.org>2017-07-07 09:11:27 +0000
commit906e9a18982a3f0d5074800799045d9d033c8e83 (patch)
treefb4648946d682bdae32420f9a03781a1cfe16d6f /lld/ELF/ScriptParser.cpp
parent77367378ac391c816354107476e8491cad291760 (diff)
downloadbcm5719-llvm-906e9a18982a3f0d5074800799045d9d033c8e83.tar.gz
bcm5719-llvm-906e9a18982a3f0d5074800799045d9d033c8e83.zip
[ELF] Extract temporary state used in assignAddresses()
The assignAddresses() function accumulates state in the LinkerScript that prevents it from being called multiple times. This change moves the state into a separate structure AddressState that is created at the start of the function and disposed of at the end. CurAddressState is used rather than passing a reference to the state as a parameter to the functions used by assignAddresses(). This is because the getSymbolValue function needs to be executed in the context of AddressState but it is stored in ScriptParser when AddressState is not available. The AddressState is also used in a limited context by processCommands() Differential Revision: https://reviews.llvm.org/D34345 llvm-svn: 307367
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r--lld/ELF/ScriptParser.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index 4a44944fe7e..72940ca0cfd 100644
--- a/lld/ELF/ScriptParser.cpp
+++ b/lld/ELF/ScriptParser.cpp
@@ -1191,8 +1191,7 @@ void ScriptParser::readMemory() {
if (It != Script->Opt.MemoryRegions.end())
setError("region '" + Name + "' already defined");
else
- Script->Opt.MemoryRegions[Name] = {Name, Origin, Length,
- Origin, Flags, NegFlags};
+ Script->Opt.MemoryRegions[Name] = {Name, Origin, Length, Flags, NegFlags};
}
}
OpenPOWER on IntegriCloud