Skip to content

Commit 5829ba7

Browse files
committed
[ORC] More attempts to work around compiler failures.
Commit 731f991 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.
1 parent 731f991 commit 5829ba7

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,11 @@ class BasicLayout {
247247
/// The Alignment, ContentSize and ZeroFillSize of each segment will be
248248
/// pre-filled from the Graph. Clients must set the Addr and WorkingMem fields
249249
/// prior to calling apply.
250+
//
251+
// FIXME: The C++98 initializer is an attempt to work around compile failures
252+
// due to http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1397.
253+
// We should be able to switch this back to member initialization once that
254+
// issue is fixed.
250255
class Segment {
251256
friend class BasicLayout;
252257

llvm/lib/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,20 @@ namespace orc {
2222
class EPCGenericJITLinkMemoryManager::InFlightAlloc
2323
: public jitlink::JITLinkMemoryManager::InFlightAlloc {
2424
public:
25+
26+
// FIXME: The C++98 initializer is an attempt to work around compile failures
27+
// due to http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1397.
28+
// We should be able to switch this back to member initialization once that
29+
// issue is fixed.
2530
struct SegInfo {
26-
char *WorkingMem = nullptr;
31+
SegInfo() : WorkingMem(nullptr), ContentSize(0), ZeroFillSize(0) {}
32+
33+
char *WorkingMem;
2734
ExecutorAddr Addr;
28-
uint64_t ContentSize = 0;
29-
uint64_t ZeroFillSize = 0;
35+
uint64_t ContentSize;
36+
uint64_t ZeroFillSize;
3037
};
38+
3139
using SegInfoMap = AllocGroupSmallMap<SegInfo>;
3240

3341
InFlightAlloc(EPCGenericJITLinkMemoryManager &Parent, LinkGraph &G,

0 commit comments

Comments
 (0)