mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 14:16:08 +00:00
[LLD][COFF][NFC] Store impSym as DefinedImportData in ImportFile. (#107162)
This commit is contained in:
parent
d25e24a0eb
commit
519b36925c
@ -1059,8 +1059,7 @@ void ImportFile::parse() {
|
||||
// address pointed by the __imp_ symbol. (This allows you to call
|
||||
// DLL functions just like regular non-DLL functions.)
|
||||
if (hdr->getType() == llvm::COFF::IMPORT_CODE)
|
||||
thunkSym = ctx.symtab.addImportThunk(
|
||||
name, cast_or_null<DefinedImportData>(impSym), hdr->Machine);
|
||||
thunkSym = ctx.symtab.addImportThunk(name, impSym, hdr->Machine);
|
||||
}
|
||||
|
||||
BitcodeFile::BitcodeFile(COFFLinkerContext &ctx, MemoryBufferRef mb,
|
||||
|
@ -346,7 +346,7 @@ public:
|
||||
static bool classof(const InputFile *f) { return f->kind() == ImportKind; }
|
||||
MachineTypes getMachineType() const override;
|
||||
|
||||
Symbol *impSym = nullptr;
|
||||
DefinedImportData *impSym = nullptr;
|
||||
Symbol *thunkSym = nullptr;
|
||||
std::string dllName;
|
||||
|
||||
|
@ -771,12 +771,12 @@ Symbol *SymbolTable::addCommon(InputFile *f, StringRef n, uint64_t size,
|
||||
return s;
|
||||
}
|
||||
|
||||
Symbol *SymbolTable::addImportData(StringRef n, ImportFile *f) {
|
||||
DefinedImportData *SymbolTable::addImportData(StringRef n, ImportFile *f) {
|
||||
auto [s, wasInserted] = insert(n, nullptr);
|
||||
s->isUsedInRegularObj = true;
|
||||
if (wasInserted || isa<Undefined>(s) || s->isLazy()) {
|
||||
replaceSymbol<DefinedImportData>(s, n, f);
|
||||
return s;
|
||||
return cast<DefinedImportData>(s);
|
||||
}
|
||||
|
||||
reportDuplicate(s, f);
|
||||
|
@ -102,7 +102,7 @@ public:
|
||||
Symbol *addCommon(InputFile *f, StringRef n, uint64_t size,
|
||||
const llvm::object::coff_symbol_generic *s = nullptr,
|
||||
CommonChunk *c = nullptr);
|
||||
Symbol *addImportData(StringRef n, ImportFile *f);
|
||||
DefinedImportData *addImportData(StringRef n, ImportFile *f);
|
||||
Symbol *addImportThunk(StringRef name, DefinedImportData *s,
|
||||
uint16_t machine);
|
||||
void addLibcall(StringRef name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user