Inline a small function.

llvm-svn: 317428
This commit is contained in:
Rui Ueyama 2017-11-04 23:57:51 +00:00
parent aa8523e4b6
commit 5c4cb8a9e3
1 changed files with 5 additions and 8 deletions

View File

@ -427,13 +427,6 @@ static OutputSection *findByName(ArrayRef<BaseCommand *> Vec,
return nullptr;
}
static void reportOrphan(InputSectionBase *IS, StringRef Name) {
if (Config->OrphanHandling == OrphanHandlingPolicy::Error)
error(toString(IS) + " is being placed in '" + Name + "'");
else if (Config->OrphanHandling == OrphanHandlingPolicy::Warn)
warn(toString(IS) + " is being placed in '" + Name + "'");
}
static OutputSection *createSection(InputSectionBase *IS,
StringRef OutsecName) {
OutputSection *Sec = Script->createOutputSection(OutsecName, "<internal>");
@ -542,7 +535,11 @@ void LinkerScript::addOrphanSections() {
continue;
StringRef Name = getOutputSectionName(S->Name);
reportOrphan(S, Name);
if (Config->OrphanHandling == OrphanHandlingPolicy::Error)
error(toString(S) + " is being placed in '" + Name + "'");
else if (Config->OrphanHandling == OrphanHandlingPolicy::Warn)
warn(toString(S) + " is being placed in '" + Name + "'");
if (OutputSection *Sec =
findByName(makeArrayRef(SectionCommands).slice(0, End), Name)) {