1 //===- Config.h -------------------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLD_WASM_CONFIG_H 10 #define LLD_WASM_CONFIG_H 11 12 #include "llvm/ADT/StringRef.h" 13 #include "llvm/ADT/StringSet.h" 14 #include "llvm/BinaryFormat/Wasm.h" 15 #include "llvm/Support/CachePruning.h" 16 17 namespace lld { 18 namespace wasm { 19 20 struct Configuration { 21 bool AllowUndefined; 22 bool CheckFeatures; 23 bool CompressRelocations; 24 bool Demangle; 25 bool DisableVerify; 26 bool ExportAll; 27 bool ExportDynamic; 28 bool ExportTable; 29 bool GcSections; 30 bool ImportMemory; 31 bool SharedMemory; 32 bool ImportTable; 33 bool MergeDataSegments; 34 bool Pie; 35 bool PrintGcSections; 36 bool Relocatable; 37 bool SaveTemps; 38 bool Shared; 39 bool StripAll; 40 bool StripDebug; 41 bool StackFirst; 42 bool Trace; 43 uint32_t GlobalBase; 44 uint32_t InitialMemory; 45 uint32_t MaxMemory; 46 uint32_t ZStackSize; 47 unsigned LTOPartitions; 48 unsigned LTOO; 49 unsigned Optimize; 50 unsigned ThinLTOJobs; 51 llvm::StringRef Entry; 52 llvm::StringRef OutputFile; 53 llvm::StringRef ThinLTOCacheDir; 54 55 llvm::StringSet<> AllowUndefinedSymbols; 56 std::vector<llvm::StringRef> SearchPaths; 57 llvm::CachePruningPolicy ThinLTOCachePolicy; 58 llvm::Optional<std::vector<std::string>> Features; 59 60 // True if we are creating position-independent code. 61 bool Pic; 62 }; 63 64 // The only instance of Configuration struct. 65 extern Configuration *Config; 66 67 } // namespace wasm 68 } // namespace lld 69 70 #endif 71