[PATCH] D23872: [ELF] - Linkerscript: simplify access to templated methods from parser.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 6 18:30:59 PDT 2016
ruiu added a comment.
I'm trying to not do too much stuff in the "object-oriented" style, but this seems to be undeniably an improvement, so we probably should go with this.
================
Comment at: ELF/LinkerScript.cpp:44
@@ -43,2 +43,3 @@
+LinkerScriptBase* elf::ScriptBase;
ScriptConfiguration *elf::ScriptConfig;
----------------
Format.
================
Comment at: ELF/LinkerScript.h:192-193
@@ -182,3 +191,4 @@
// Variable template is a C++14 feature, so we can't template
// a global variable. Use a struct to workaround.
+extern LinkerScriptBase* ScriptBase;
----------------
This comment is for `struct Script` and `Script<ELFT>::X`, so you shouldn't add the new line below this.
================
Comment at: ELF/LinkerScript.h:194
@@ -184,2 +193,3 @@
// a global variable. Use a struct to workaround.
+extern LinkerScriptBase* ScriptBase;
template <class ELFT> struct Script { static LinkerScript<ELFT> *X; };
----------------
clang-format.
https://reviews.llvm.org/D23872
More information about the llvm-commits
mailing list