From 5829ba7afc13eaa004f16906a5004a61648ac403 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Mon, 11 Oct 2021 22:32:07 -0700 Subject: [PATCH] [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. --- .../llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h | 5 +++++ .../ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.cpp | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h index 554012a..62c271d 100644 --- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h +++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h @@ -247,6 +247,11 @@ public: /// 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 9456837..005ba14 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; InFlightAlloc(EPCGenericJITLinkMemoryManager &Parent, LinkGraph &G, -- 2.7.4