This patch fixes these errors while building BOLT.
authorSriraman Tallam <tmsriram@google.com>
Tue, 2 Aug 2022 18:21:36 +0000 (11:21 -0700)
committerSriraman Tallam <tmsriram@google.com>
Tue, 2 Aug 2022 18:23:37 +0000 (11:23 -0700)
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,

Differential Revision: https://reviews.llvm.org/D130402

bolt/include/bolt/Core/BinaryDomTree.h
bolt/include/bolt/Passes/RegReAssign.h
utils/bazel/llvm-project-overlay/bolt/BUILD.bazel

index 385685c..a956579 100644 (file)
 #ifndef BOLT_CORE_BINARY_DOMTREE_H
 #define BOLT_CORE_BINARY_DOMTREE_H
 
+#include "bolt/Core/BinaryBasicBlock.h"
+#include "llvm/IR/Dominators.h"
 #include "llvm/Support/GenericDomTreeConstruction.h"
 
 namespace llvm {
 namespace bolt {
 
-class BinaryBasicBlock;
 using BinaryDomTreeNode = DomTreeNodeBase<BinaryBasicBlock>;
 using BinaryDominatorTree = DomTreeBase<BinaryBasicBlock>;
 
index df01520..cd7bea6 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef BOLT_PASSES_REGREASSIGN_H
 #define BOLT_PASSES_REGREASSIGN_H
 
+#include "bolt/Passes/BinaryFunctionCallGraph.h"
 #include "bolt/Passes/BinaryPasses.h"
 #include "bolt/Passes/RegAnalysis.h"
 
index 890ae7a..6c4f99b 100644 (file)
@@ -253,6 +253,7 @@ cc_library(
         "//llvm:MCParser",
         "//llvm:Object",
         "//llvm:Support",
+        "//llvm:ir_headers",
     ],
 )