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.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/lld/COFF/InputFiles.h b/lld/COFF/InputFiles.h
index d4f56aa8642..40df27aef79 100644
--- a/lld/COFF/InputFiles.h
+++ b/lld/COFF/InputFiles.h
@@ -62,8 +62,15 @@ public:
// Returns .drectve section contents if exist.
StringRef getDirectives() { return StringRef(Directives).trim(); }
+ // Each file has a unique index. The index number is used to
+ // resolve ties in symbol resolution.
+ int Index;
+ static int NextIndex;
+
protected:
- InputFile(Kind K, MemoryBufferRef M) : MB(M), FileKind(K) {}
+ InputFile(Kind K, MemoryBufferRef M)
+ : Index(NextIndex++), MB(M), FileKind(K) {}
+
MemoryBufferRef MB;
std::string Directives;
OpenPOWER on IntegriCloud