[PATCH] D130175: [JITLink][COFF] Implement dllimport stubs.

Sunho Kim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 25 21:03:21 PDT 2022


sunho added inline comments.


================
Comment at: llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp:227
     else if (Sym->isUndefined()) {
-      LLVM_DEBUG({
-        dbgs() << "    " << SymIndex
-               << ": Creating external graph symbol for COFF symbol \""
-               << SymbolName << "\" in "
-               << getCOFFSectionName(SectionIndex, Sec, *Sym)
-               << " (index: " << SectionIndex << ") \n";
-      });
-      if (!ExternalSymbols.count(SymbolName))
-        ExternalSymbols[SymbolName] =
-            &G->addExternalSymbol(SymbolName, Sym->getValue(), Linkage::Strong);
-      GSym = ExternalSymbols[SymbolName];
+      auto CreateExternalSymbol = [&](StringRef SymbolName) {
+        if (!ExternalSymbols.count(SymbolName))
----------------
sunho wrote:
> lhames wrote:
> > This might be worth lifting out into its own method.
> I reallized the same when I was writing SECREL patch and splitted off into additional method in that patch. 
I meant directive parser patch


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

https://reviews.llvm.org/D130175



More information about the llvm-commits mailing list