[lld] [lld][WebAssembly] Move linker global state in to context object. NFC (PR #78629)

Derek Schuff via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 14:48:15 PST 2024


================
@@ -96,24 +101,19 @@ struct Configuration {
   std::optional<std::vector<std::string>> features;
   std::optional<std::vector<std::string>> extraFeatures;
   llvm::SmallVector<uint8_t, 0> buildIdVector;
+};
 
-  // The following config options do not directly correspond to any
-  // particular command line options, and should probably be moved to separate
-  // Ctx struct as in ELF/Config.h
+// The only instance of Configuration struct.
+extern Configuration *config;
 
+struct Ctx {
----------------
dschuff wrote:

Makes sense. Could we maybe improve upon ELF and add a comment to that effect somewhere?

https://github.com/llvm/llvm-project/pull/78629


More information about the llvm-commits mailing list