Split LinkerScript::createSections into small functions.
createSections function is getting longer, so it is time to split it
into small functions. The reason why the function is long is because
it has deeply nested for-loops. This patch constructs temporary data
to reduce nesting level.
Differential Revision: https://reviews.llvm.org/D22786
llvm-svn: 276706
diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h
index bb97045..ade95ce 100644
--- a/lld/ELF/LinkerScript.h
+++ b/lld/ELF/LinkerScript.h
@@ -131,6 +131,11 @@
bool hasPhdrsCommands();
private:
+ std::vector<std::pair<StringRef, ArrayRef<StringRef>>> getSectionMap();
+
+ std::vector<InputSectionBase<ELFT> *>
+ getInputSections(ArrayRef<StringRef> Patterns);
+
// "ScriptConfig" is a bit too long, so define a short name for it.
ScriptConfiguration &Opt = *ScriptConfig;