This is an archive of the discontinued LLVM Phabricator instance.

Fix BOLT build errors when building with Bazel build file
ClosedPublic

Authored by tmsriram on Jul 22 2022, 4:33 PM.

Details

Summary

This patch fixes these errors while building BOLT:

Compiling llvm/llvm-project/bolt/include/bolt/Passes/RegReAssign.h failed:
...: error: invalid application of 'sizeof' to an incomplete type 'llvm::bolt::BinaryFunctionCallGraph'

static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type");

error: type 'llvm::bolt::BinaryBasicBlock *' cannot be used prior to '::' because it has no members

using NodeRef = typename GraphType::UnknownGraphTypeError;

BinaryDomTree.h:31:14: error: no template named 'DomTreeGraphTraitsBase'

: public DomTreeGraphTraitsBase<bolt::BinaryDomTreeNode,

Diff Detail

Event Timeline

tmsriram created this revision.Jul 22 2022, 4:33 PM
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
tmsriram requested review of this revision.Jul 22 2022, 4:33 PM
tmsriram updated this revision to Diff 447007.Jul 22 2022, 4:38 PM

Delete forward declaration to BinaryBasicBlock.

MaskRay accepted this revision.Jul 22 2022, 4:50 PM

(You may need to check both cmake and bazel builds when testing such changes)

This revision is now accepted and ready to land.Jul 22 2022, 4:50 PM
This revision was landed with ongoing or failed builds.Aug 2 2022, 11:23 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2022, 11:23 AM

Note (I was informed too), for future Bolt patches, we should use [BOLT] (uppercase) as the subject.