[lld] r281776 - Rename SortSectionPolicy::IgnoreConfig to None.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 16 14:14:56 PDT 2016
Author: ruiu
Date: Fri Sep 16 16:14:55 2016
New Revision: 281776
URL: http://llvm.org/viewvc/llvm-project?rev=281776&view=rev
Log:
Rename SortSectionPolicy::IgnoreConfig to None.
Because it corresponds to SORT_NONE. None was renamed Default.
Modified:
lld/trunk/ELF/Config.h
lld/trunk/ELF/Driver.cpp
lld/trunk/ELF/LinkerScript.cpp
lld/trunk/ELF/LinkerScript.h
Modified: lld/trunk/ELF/Config.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Config.h?rev=281776&r1=281775&r2=281776&view=diff
==============================================================================
--- lld/trunk/ELF/Config.h (original)
+++ lld/trunk/ELF/Config.h Fri Sep 16 16:14:55 2016
@@ -43,7 +43,7 @@ enum class StripPolicy { None, All, Debu
enum class UnresolvedPolicy { NoUndef, ReportError, Warn, Ignore };
// For --sort-section and linkerscript sorting rules.
-enum class SortSectionPolicy { None, IgnoreConfig, Alignment, Name, Priority };
+enum class SortSectionPolicy { Default, None, Alignment, Name, Priority };
struct SymbolVersion {
llvm::StringRef Name;
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=281776&r1=281775&r2=281776&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Fri Sep 16 16:14:55 2016
@@ -415,7 +415,7 @@ static SortSectionPolicy getSortKind(opt
return SortSectionPolicy::Name;
if (!S.empty())
error("unknown --sort-section rule: " + S);
- return SortSectionPolicy::None;
+ return SortSectionPolicy::Default;
}
// Initializes Config members by the command line options.
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=281776&r1=281775&r2=281776&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Fri Sep 16 16:14:55 2016
@@ -179,10 +179,10 @@ void LinkerScript<ELFT>::computeInputSec
}
}
- if (I->SortInner != SortSectionPolicy::None)
+ if (I->SortInner != SortSectionPolicy::Default)
std::stable_sort(I->Sections.begin(), I->Sections.end(),
getComparator(I->SortInner));
- if (I->SortOuter != SortSectionPolicy::None)
+ if (I->SortOuter != SortSectionPolicy::Default)
std::stable_sort(I->Sections.begin(), I->Sections.end(),
getComparator(I->SortOuter));
@@ -1001,23 +1001,21 @@ SortSectionPolicy ScriptParser::readSort
return SortSectionPolicy::Alignment;
if (skip("SORT_BY_INIT_PRIORITY"))
return SortSectionPolicy::Priority;
- // `SORT_NONE' disables section sorting by ignoring the command line
- // section sorting option.
if (skip("SORT_NONE"))
- return SortSectionPolicy::IgnoreConfig;
- return SortSectionPolicy::None;
+ return SortSectionPolicy::None;
+ return SortSectionPolicy::Default;
}
static void selectSortKind(InputSectionDescription *Cmd) {
- if (Cmd->SortOuter == SortSectionPolicy::IgnoreConfig) {
- Cmd->SortOuter = SortSectionPolicy::None;
+ if (Cmd->SortOuter == SortSectionPolicy::None) {
+ Cmd->SortOuter = SortSectionPolicy::Default;
return;
}
- if (Cmd->SortOuter != SortSectionPolicy::None) {
+ if (Cmd->SortOuter != SortSectionPolicy::Default) {
// If the section sorting command in linker script is nested, the command
// line option will be ignored.
- if (Cmd->SortInner != SortSectionPolicy::None)
+ if (Cmd->SortInner != SortSectionPolicy::Default)
return;
// If the section sorting command in linker script isn't nested, the
// command line option will make the section sorting command to be treated
@@ -1066,11 +1064,11 @@ ScriptParser::readInputSectionRules(Stri
// Read SORT().
SortSectionPolicy K1 = readSortKind();
- if (K1 != SortSectionPolicy::None) {
+ if (K1 != SortSectionPolicy::Default) {
Cmd->SortOuter = K1;
expect("(");
SortSectionPolicy K2 = readSortKind();
- if (K2 != SortSectionPolicy::None) {
+ if (K2 != SortSectionPolicy::Default) {
Cmd->SortInner = K2;
expect("(");
Cmd->SectionsVec.push_back({llvm::Regex(), readFilePatterns()});
Modified: lld/trunk/ELF/LinkerScript.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.h?rev=281776&r1=281775&r2=281776&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.h (original)
+++ lld/trunk/ELF/LinkerScript.h Fri Sep 16 16:14:55 2016
@@ -104,8 +104,8 @@ struct InputSectionDescription : BaseCom
FileRe(compileGlobPatterns({FilePattern})) {}
static bool classof(const BaseCommand *C);
llvm::Regex FileRe;
- SortSectionPolicy SortOuter = SortSectionPolicy::None;
- SortSectionPolicy SortInner = SortSectionPolicy::None;
+ SortSectionPolicy SortOuter = SortSectionPolicy::Default;
+ SortSectionPolicy SortInner = SortSectionPolicy::Default;
// Pairs of section regex and files excluded.
std::list<std::pair<llvm::Regex, llvm::Regex>> SectionsVec;
std::vector<InputSectionData *> Sections;
More information about the llvm-commits
mailing list