Make dummy variable's scope smaller.

llvm-svn: 299492
This commit is contained in:
Rui Ueyama 2017-04-05 00:42:45 +00:00
parent 6de8134784
commit a08fa2eca3
1 changed files with 2 additions and 3 deletions

View File

@ -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,