summaryrefslogtreecommitdiffstats
path: root/lld/COFF/InputFiles.h
diff options
context:
space:
mode:
Diffstat (limited to 'lld/COFF/InputFiles.h')
-rw-r--r--lld/COFF/InputFiles.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/lld/COFF/InputFiles.h b/lld/COFF/InputFiles.h
index 6bf0af3c424..f65f34d8f10 100644
--- a/lld/COFF/InputFiles.h
+++ b/lld/COFF/InputFiles.h
@@ -46,6 +46,7 @@ class Chunk;
class Defined;
class DefinedImportData;
class DefinedImportThunk;
+class DefinedRegular;
class Lazy;
class SectionChunk;
class Symbol;
@@ -157,6 +158,9 @@ public:
private:
const coff_section* getSection(uint32_t I);
+ const coff_section *getSection(COFFSymbolRef Sym) {
+ return getSection(Sym.getSectionNumber());
+ }
void initializeChunks();
void initializeSymbols();
@@ -183,6 +187,16 @@ private:
COFFSymbolRef Sym, const llvm::object::coff_aux_section_definition *Def,
const llvm::DenseMap<StringRef, uint32_t> &PrevailingSectionMap);
+ // Given a new symbol Sym with comdat selection Selection, if the new
+ // symbol is not (yet) Prevailing and the existing comdat leader set to
+ // Leader, emits a diagnostic if the new symbol and its selection doesn't
+ // match the existing symbol and its selection. If either old or new
+ // symbol have selection IMAGE_COMDAT_SELECT_LARGEST, Sym might replace
+ // the existing leader. In that case, Prevailing is set to true.
+ void handleComdatSelection(COFFSymbolRef Sym,
+ llvm::COFF::COMDATType &Selection,
+ bool &Prevailing, DefinedRegular *Leader);
+
llvm::Optional<Symbol *>
createDefined(COFFSymbolRef Sym,
std::vector<const llvm::object::coff_aux_section_definition *>
OpenPOWER on IntegriCloud