Mercurial > hg > CbC > CbC_llvm
comparison lld/wasm/SymbolTable.h @ 252:1f2b6ac9f198 llvm-original
LLVM16-1
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 18 Aug 2023 09:04:13 +0900 |
parents | c4bab56944e8 |
children |
comparison
equal
deleted
inserted
replaced
237:c80f45b162ad | 252:1f2b6ac9f198 |
---|---|
13 #include "LTO.h" | 13 #include "LTO.h" |
14 #include "Symbols.h" | 14 #include "Symbols.h" |
15 #include "lld/Common/LLVM.h" | 15 #include "lld/Common/LLVM.h" |
16 #include "llvm/ADT/CachedHashString.h" | 16 #include "llvm/ADT/CachedHashString.h" |
17 #include "llvm/ADT/DenseSet.h" | 17 #include "llvm/ADT/DenseSet.h" |
18 #include "llvm/ADT/Optional.h" | |
19 #include "llvm/BinaryFormat/WasmTraits.h" | 18 #include "llvm/BinaryFormat/WasmTraits.h" |
19 #include <optional> | |
20 | 20 |
21 namespace lld { | 21 namespace lld::wasm { |
22 namespace wasm { | |
23 | 22 |
24 class InputSegment; | 23 class InputSegment; |
25 | 24 |
26 // SymbolTable is a bucket of all known symbols, including defined, | 25 // SymbolTable is a bucket of all known symbols, including defined, |
27 // undefined, or lazy symbols (the last one is symbols in archive | 26 // undefined, or lazy symbols (the last one is symbols in archive |
61 InputTag *t); | 60 InputTag *t); |
62 Symbol *addDefinedTable(StringRef name, uint32_t flags, InputFile *file, | 61 Symbol *addDefinedTable(StringRef name, uint32_t flags, InputFile *file, |
63 InputTable *t); | 62 InputTable *t); |
64 | 63 |
65 Symbol *addUndefinedFunction(StringRef name, | 64 Symbol *addUndefinedFunction(StringRef name, |
66 llvm::Optional<StringRef> importName, | 65 std::optional<StringRef> importName, |
67 llvm::Optional<StringRef> importModule, | 66 std::optional<StringRef> importModule, |
68 uint32_t flags, InputFile *file, | 67 uint32_t flags, InputFile *file, |
69 const WasmSignature *signature, | 68 const WasmSignature *signature, |
70 bool isCalledDirectly); | 69 bool isCalledDirectly); |
71 Symbol *addUndefinedData(StringRef name, uint32_t flags, InputFile *file); | 70 Symbol *addUndefinedData(StringRef name, uint32_t flags, InputFile *file); |
72 Symbol *addUndefinedGlobal(StringRef name, | 71 Symbol *addUndefinedGlobal(StringRef name, |
73 llvm::Optional<StringRef> importName, | 72 std::optional<StringRef> importName, |
74 llvm::Optional<StringRef> importModule, | 73 std::optional<StringRef> importModule, |
75 uint32_t flags, InputFile *file, | 74 uint32_t flags, InputFile *file, |
76 const WasmGlobalType *type); | 75 const WasmGlobalType *type); |
77 Symbol *addUndefinedTable(StringRef name, | 76 Symbol *addUndefinedTable(StringRef name, std::optional<StringRef> importName, |
78 llvm::Optional<StringRef> importName, | 77 std::optional<StringRef> importModule, |
79 llvm::Optional<StringRef> importModule, | |
80 uint32_t flags, InputFile *file, | 78 uint32_t flags, InputFile *file, |
81 const WasmTableType *type); | 79 const WasmTableType *type); |
82 Symbol *addUndefinedTag(StringRef name, llvm::Optional<StringRef> importName, | 80 Symbol *addUndefinedTag(StringRef name, std::optional<StringRef> importName, |
83 llvm::Optional<StringRef> importModule, | 81 std::optional<StringRef> importModule, uint32_t flags, |
84 uint32_t flags, InputFile *file, | 82 InputFile *file, const WasmSignature *sig); |
85 const WasmSignature *sig); | |
86 | 83 |
87 TableSymbol *resolveIndirectFunctionTable(bool required); | 84 TableSymbol *resolveIndirectFunctionTable(bool required); |
88 | 85 |
89 void addLazy(ArchiveFile *f, const llvm::object::Archive::Symbol *sym); | 86 void addLazy(ArchiveFile *f, const llvm::object::Archive::Symbol *sym); |
90 | 87 |
103 void handleSymbolVariants(); | 100 void handleSymbolVariants(); |
104 void handleWeakUndefines(); | 101 void handleWeakUndefines(); |
105 DefinedFunction *createUndefinedStub(const WasmSignature &sig); | 102 DefinedFunction *createUndefinedStub(const WasmSignature &sig); |
106 | 103 |
107 std::vector<ObjFile *> objectFiles; | 104 std::vector<ObjFile *> objectFiles; |
105 std::vector<StubFile *> stubFiles; | |
108 std::vector<SharedFile *> sharedFiles; | 106 std::vector<SharedFile *> sharedFiles; |
109 std::vector<BitcodeFile *> bitcodeFiles; | 107 std::vector<BitcodeFile *> bitcodeFiles; |
110 std::vector<InputFunction *> syntheticFunctions; | 108 std::vector<InputFunction *> syntheticFunctions; |
111 std::vector<InputGlobal *> syntheticGlobals; | 109 std::vector<InputGlobal *> syntheticGlobals; |
112 std::vector<InputTable *> syntheticTables; | 110 std::vector<InputTable *> syntheticTables; |
144 std::unique_ptr<BitcodeCompiler> lto; | 142 std::unique_ptr<BitcodeCompiler> lto; |
145 }; | 143 }; |
146 | 144 |
147 extern SymbolTable *symtab; | 145 extern SymbolTable *symtab; |
148 | 146 |
149 } // namespace wasm | 147 } // namespace lld::wasm |
150 } // namespace lld | |
151 | 148 |
152 #endif | 149 #endif |