diff options
| author | George Rimar <grimar@accesssoftek.com> | 2017-03-14 10:15:53 +0000 |
|---|---|---|
| committer | George Rimar <grimar@accesssoftek.com> | 2017-03-14 10:15:53 +0000 |
| commit | 851dc1e84dfdd82d13939eb7417e10b8e068251a (patch) | |
| tree | ad798d35e975c370a035269f4fcaf8f935a57214 /lld/ELF/LinkerScript.cpp | |
| parent | 062041113f86993cc0bb1488e90184ce5adf1e59 (diff) | |
| download | bcm5719-llvm-851dc1e84dfdd82d13939eb7417e10b8e068251a.tar.gz bcm5719-llvm-851dc1e84dfdd82d13939eb7417e10b8e068251a.zip | |
[ELF] - Devirtualize LinkerScriptBase::getOutputSection
It does not use ELFT templates so can be non-virtual.
llvm-svn: 297725
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
| -rw-r--r-- | lld/ELF/LinkerScript.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 7da00fa4224..bbe0e45816c 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -79,6 +79,18 @@ static bool isUnderSysroot(StringRef Path) { return false; } +OutputSection *LinkerScriptBase::getOutputSection(const Twine &Loc, + StringRef Name) { + static OutputSection FakeSec("", 0, 0); + + for (OutputSection *Sec : *OutputSections) + if (Sec->Name == Name) + return Sec; + + error(Loc + ": undefined section " + Name); + return &FakeSec; +} + template <class ELFT> void LinkerScript<ELFT>::setDot(Expr E, const Twine &Loc, bool InSec) { uint64_t Val = E(); @@ -902,19 +914,6 @@ template <class ELFT> int LinkerScript<ELFT>::getSectionIndex(StringRef Name) { return INT_MAX; } -template <class ELFT> -OutputSection *LinkerScript<ELFT>::getOutputSection(const Twine &Loc, - StringRef Name) { - static OutputSection FakeSec("", 0, 0); - - for (OutputSection *Sec : *OutputSections) - if (Sec->Name == Name) - return Sec; - - error(Loc + ": undefined section " + Name); - return &FakeSec; -} - // This function is essentially the same as getOutputSection(Name)->Size, // but it won't print out an error message if a given section is not found. // |

