summaryrefslogtreecommitdiffstats
path: root/lld/include/lld/ReaderWriter/PECOFFLinkingContext.h
diff options
context:
space:
mode:
Diffstat (limited to 'lld/include/lld/ReaderWriter/PECOFFLinkingContext.h')
-rw-r--r--lld/include/lld/ReaderWriter/PECOFFLinkingContext.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/lld/include/lld/ReaderWriter/PECOFFLinkingContext.h b/lld/include/lld/ReaderWriter/PECOFFLinkingContext.h
index 8553bbf57d1..70c68876b37 100644
--- a/lld/include/lld/ReaderWriter/PECOFFLinkingContext.h
+++ b/lld/include/lld/ReaderWriter/PECOFFLinkingContext.h
@@ -61,8 +61,15 @@ public:
struct ExportDesc {
ExportDesc()
: ordinal(-1), noname(false), isData(false), isPrivate(false) {}
+
bool operator<(const ExportDesc &other) const {
- return name.compare(other.name) < 0;
+ return getExternalName().compare(other.getExternalName()) < 0;
+ }
+
+ StringRef getExternalName() const {
+ if (!externalName.empty())
+ return externalName;
+ return name;
}
std::string name;
OpenPOWER on IntegriCloud