[PATCH] D106554: [ORC] Work around AIX build compiler: Replace lambda; NFC

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 23 07:12:46 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGaf5602d369a5: [ORC] Work around AIX build compiler: Replace lambda; NFC (authored by hubert.reinterpretcast).

Changed prior to commit:
  https://reviews.llvm.org/D106554?vs=360821&id=361190#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106554

Files:
  llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp


Index: llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
===================================================================
--- llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
+++ llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
@@ -446,19 +446,30 @@
     return;
   }
 
+  // Use functor class to work around XL build compiler issue on AIX.
+  class RtLookupNotifyComplete {
+  public:
+    RtLookupNotifyComplete(SendSymbolAddressFn &&SendResult)
+        : SendResult(std::move(SendResult)) {}
+    void operator()(Expected<SymbolMap> Result) {
+      if (Result) {
+        assert(Result->size() == 1 && "Unexpected result map count");
+        SendResult(ExecutorAddress(Result->begin()->second.getAddress()));
+      } else {
+        SendResult(Result.takeError());
+      }
+    }
+
+  private:
+    SendSymbolAddressFn SendResult;
+  };
+
   // FIXME: Proper mangling.
   auto MangledName = ("_" + SymbolName).str();
   ES.lookup(
       LookupKind::DLSym, {{JD, JITDylibLookupFlags::MatchExportedSymbolsOnly}},
       SymbolLookupSet(ES.intern(MangledName)), SymbolState::Ready,
-      [SendResult = std::move(SendResult)](Expected<SymbolMap> Result) mutable {
-        if (Result) {
-          assert(Result->size() == 1 && "Unexpected result map count");
-          SendResult(ExecutorAddress(Result->begin()->second.getAddress()));
-        } else
-          SendResult(Result.takeError());
-      },
-      NoDependenciesToRegister);
+      RtLookupNotifyComplete(std::move(SendResult)), NoDependenciesToRegister);
 }
 
 Error MachOPlatform::bootstrapMachORuntime(JITDylib &PlatformJD) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106554.361190.patch
Type: text/x-patch
Size: 1597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210723/ad985707/attachment.bin>


More information about the llvm-commits mailing list