[PATCH] D62984: [COFF] Fix /export:foo=bar when bar is a weak alias

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 23:37:30 PDT 2019


ruiu accepted this revision.
ruiu added a comment.

LGTM



================
Comment at: lld/COFF/SymbolTable.cpp:494
+      return Sym;
+  std::vector<Symbol *> Syms = getSymsWithPrefix(Name);
+  auto FindByPrefix = [&Syms](const Twine &T) -> Symbol * {
----------------
I wondered why you needed to call `getSymWithPrefix` first instead of scanning the entire symbol table. Looks like this is just a performance optimization; find candidates first and then try to find a match from them. Can you add a comment about that?


================
Comment at: llvm/include/llvm/Object/COFFImportFile.h:72-87
+  /// The name of the export as specified in the .def file or on the command
+  /// line, i.e. "foo" in "/EXPORT:foo", and "bar" in "/EXPORT:foo=bar". This
+  /// may lack mangling, such as underscore prefixing and stdcall suffixing.
   std::string Name;
+
+  /// The external, exported name. Only non-empty when export renaming is in
+  /// effect, i.e. "foo" in "/EXPORT:foo=bar".
----------------
Thank you for doing this!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62984/new/

https://reviews.llvm.org/D62984





More information about the llvm-commits mailing list