[llvm] 5829ba7 - [ORC] More attempts to work around compiler failures.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 11 22:39:18 PDT 2021


Author: Lang Hames
Date: 2021-10-11T22:36:56-07:00
New Revision: 5829ba7afc13eaa004f16906a5004a61648ac403

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

LOG: [ORC] More attempts to work around compiler failures.

Commit 731f991cdc4 seems to have helped, but did not catch all instances (see
https://lab.llvm.org/buildbot/#/builders/193/builds/104). Switch more inner
structs to C++98 initializers to work around the issue. Add FIXMEs to revisit
in the future.

Added: 
    

Modified: 
    llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
    llvm/lib/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
index 554012a4dacf..62c271dfc0b2 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
@@ -247,6 +247,11 @@ class BasicLayout {
   /// The Alignment, ContentSize and ZeroFillSize of each segment will be
   /// pre-filled from the Graph. Clients must set the Addr and WorkingMem fields
   /// prior to calling apply.
+  //
+  // FIXME: The C++98 initializer is an attempt to work around compile failures
+  // due to http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1397.
+  // We should be able to switch this back to member initialization once that
+  // issue is fixed.
   class Segment {
     friend class BasicLayout;
 

diff  --git a/llvm/lib/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.cpp b/llvm/lib/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.cpp
index 94568371bb88..005ba14794d1 100644
--- a/llvm/lib/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.cpp
@@ -22,12 +22,20 @@ namespace orc {
 class EPCGenericJITLinkMemoryManager::InFlightAlloc
     : public jitlink::JITLinkMemoryManager::InFlightAlloc {
 public:
+
+  // FIXME: The C++98 initializer is an attempt to work around compile failures
+  // due to http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1397.
+  // We should be able to switch this back to member initialization once that
+  // issue is fixed.
   struct SegInfo {
-    char *WorkingMem = nullptr;
+    SegInfo() : WorkingMem(nullptr), ContentSize(0), ZeroFillSize(0) {}
+
+    char *WorkingMem;
     ExecutorAddr Addr;
-    uint64_t ContentSize = 0;
-    uint64_t ZeroFillSize = 0;
+    uint64_t ContentSize;
+    uint64_t ZeroFillSize;
   };
+
   using SegInfoMap = AllocGroupSmallMap<SegInfo>;
 
   InFlightAlloc(EPCGenericJITLinkMemoryManager &Parent, LinkGraph &G,


        


More information about the llvm-commits mailing list