[ORC] Attempt to work around compile failure on some bots.
authorLang Hames <lhames@gmail.com>
Tue, 12 Oct 2021 05:19:46 +0000 (22:19 -0700)
committerLang Hames <lhames@gmail.com>
Tue, 12 Oct 2021 05:23:59 +0000 (22:23 -0700)
See e.g. https://lab.llvm.org/buildbot/#/builders/193/builds/98.

I think this failure is related to a C++ standard defect, 1397 --"Class
completeness in non-static data member initializers" [1]. If so, moving
to C++98 initialization should work around the issue.

[1] http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1397

llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h

index 2cb6762..554012a 100644 (file)
@@ -251,14 +251,17 @@ public:
     friend class BasicLayout;
 
   public:
+    Segment()
+        : ContentSize(0), ZeroFillSize(0), Addr(0), WorkingMem(nullptr),
+          NextWorkingMemOffset(0) {}
     Align Alignment;
-    size_t ContentSize = 0;
-    uint64_t ZeroFillSize = 0;
-    JITTargetAddress Addr = 0;
-    char *WorkingMem;
+    size_t ContentSize;
+    uint64_t ZeroFillSize;
+    JITTargetAddress Addr;
+    char *WorkingMem = nullptr;
 
   private:
-    size_t NextWorkingMemOffset = 0;
+    size_t NextWorkingMemOffset;
     std::vector<Block *> ContentBlocks, ZeroFillBlocks;
   };