summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2017-04-05 00:42:45 +0000
committerRui Ueyama <ruiu@google.com>2017-04-05 00:42:45 +0000
commita08fa2eca355538b850abc6b450680253be6755d (patch)
tree59b701c2977bae4d7aece20d289f80547297d2e7 /lld/ELF/LinkerScript.cpp
parent6de813478408ddf945b1a348c559a2c5a7f41976 (diff)
downloadbcm5719-llvm-a08fa2eca355538b850abc6b450680253be6755d.tar.gz
bcm5719-llvm-a08fa2eca355538b850abc6b450680253be6755d.zip
Make dummy variable's scope smaller.
llvm-svn: 299492
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r--lld/ELF/LinkerScript.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 73d4dea19fb..4eca9dd45ab 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -136,15 +136,14 @@ static bool isUnderSysroot(StringRef Path) {
OutputSection *LinkerScript::getOutputSection(const Twine &Loc,
StringRef Name) {
- static OutputSection FakeSec("", 0, 0);
-
for (OutputSection *Sec : *OutputSections)
if (Sec->Name == Name)
return Sec;
+ static OutputSection Dummy("", 0, 0);
if (ErrorOnMissingSection)
error(Loc + ": undefined section " + Name);
- return &FakeSec;
+ return &Dummy;
}
// This function is essentially the same as getOutputSection(Name)->Size,
OpenPOWER on IntegriCloud