[lld] aca110f - [lld][WebAssembly] Trace export of symbols when specified with --trace-symbol. NFC

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 13 10:36:35 PDT 2023


Author: Sam Clegg
Date: 2023-04-13T10:36:27-07:00
New Revision: aca110f9dd17f2ec6492e56472a49bd409c185ae

URL: https://github.com/llvm/llvm-project/commit/aca110f9dd17f2ec6492e56472a49bd409c185ae
DIFF: https://github.com/llvm/llvm-project/commit/aca110f9dd17f2ec6492e56472a49bd409c185ae.diff

LOG: [lld][WebAssembly] Trace export of symbols when specified with --trace-symbol. NFC

Differential Revision: https://reviews.llvm.org/D148190

Added: 
    

Modified: 
    lld/wasm/Driver.cpp

Removed: 
    


################################################################################
diff  --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp
index 3867b9cb3c37d..8b02c9a85e264 100644
--- a/lld/wasm/Driver.cpp
+++ b/lld/wasm/Driver.cpp
@@ -903,8 +903,12 @@ static void processStubLibraries() {
                 ": undefined symbol: " + toString(*needed) +
                 ". Required by " + toString(*sym));
         } else {
-          LLVM_DEBUG(llvm::dbgs()
-                     << "force export: " << toString(*needed) << "\n");
+          if (needed->traced)
+            message(toString(stub_file) + ": exported " + toString(*needed) +
+                    " due to import of " + name);
+          else
+            LLVM_DEBUG(llvm::dbgs()
+                       << "force export: " << toString(*needed) << "\n");
           needed->forceExport = true;
           if (auto *lazy = dyn_cast<LazySymbol>(needed)) {
             lazy->fetch();


        


More information about the llvm-commits mailing list