diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-29 16:26:20 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-29 16:26:20 +0000 |
commit | bef2946c219dc621608bcc9e47f8b973e5ef5c70 (patch) | |
tree | 1e4dfae199fc27167ed7496693938fec2dab65c2 /COFF/InputFiles.h | |
parent | c53addf38e24e4dafe992aafb3ae928bfa8fdb0a (diff) |
Notes
Diffstat (limited to 'COFF/InputFiles.h')
-rw-r--r-- | COFF/InputFiles.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/COFF/InputFiles.h b/COFF/InputFiles.h index 9e32b3b9f9d64..9449f24ac2414 100644 --- a/COFF/InputFiles.h +++ b/COFF/InputFiles.h @@ -10,6 +10,7 @@ #ifndef LLD_COFF_INPUT_FILES_H #define LLD_COFF_INPUT_FILES_H +#include "Config.h" #include "lld/Core/LLVM.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseSet.h" @@ -161,7 +162,9 @@ private: // for details about the format. class ImportFile : public InputFile { public: - explicit ImportFile(MemoryBufferRef M) : InputFile(ImportKind, M) {} + explicit ImportFile(MemoryBufferRef M) + : InputFile(ImportKind, M), Live(!Config->DoGC) {} + static bool classof(const InputFile *F) { return F->kind() == ImportKind; } DefinedImportData *ImpSym = nullptr; @@ -176,6 +179,14 @@ public: StringRef ExternalName; const coff_import_header *Hdr; Chunk *Location = nullptr; + + // We want to eliminate dllimported symbols if no one actually refers them. + // This "Live" bit is used to keep track of which import library members + // are actually in use. + // + // If the Live bit is turned off by MarkLive, Writer will ignore dllimported + // symbols provided by this import library member. + bool Live; }; // Used for LTO. |