[llvm] 844c8fc - [CodeGen] Include MachineInstr.h
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 18 15:12:36 PST 2022
Author: Kazu Hirata
Date: 2022-12-18T15:12:30-08:00
New Revision: 844c8fc9c93fa22a05663b5d75b489c0ff9081cc
URL: https://github.com/llvm/llvm-project/commit/844c8fc9c93fa22a05663b5d75b489c0ff9081cc
DIFF: https://github.com/llvm/llvm-project/commit/844c8fc9c93fa22a05663b5d75b489c0ff9081cc.diff
LOG: [CodeGen] Include MachineInstr.h
This patch teaches DbgEntityHistoryCalculator.h to include
MachineInstr.h so that the header file is self contained.
Without this patch, a C++ source file that only includes
DbgEntityHistoryCalculator.h does not compile because:
PointerIntPair<const MachineInstr *, 1, EntryKind> Instr;
wants to know the alignment of llvm::MachineInstr:
llvm/include/llvm/Support/PointerLikeTypeTraits.h:61:28: error:
invalid application of 'alignof' to an incomplete type
'llvm::MachineInstr'
detail::ConstantLog2<alignof(T)>::value;
^~~~~~~~~~
Added:
Modified:
llvm/include/llvm/CodeGen/DbgEntityHistoryCalculator.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/DbgEntityHistoryCalculator.h b/llvm/include/llvm/CodeGen/DbgEntityHistoryCalculator.h
index 465829159e42b..0cfe04af6f9ef 100644
--- a/llvm/include/llvm/CodeGen/DbgEntityHistoryCalculator.h
+++ b/llvm/include/llvm/CodeGen/DbgEntityHistoryCalculator.h
@@ -12,6 +12,7 @@
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/CodeGen/MachineInstr.h"
#include <utility>
namespace llvm {
@@ -20,7 +21,6 @@ class DILocation;
class LexicalScopes;
class DINode;
class MachineFunction;
-class MachineInstr;
class TargetRegisterInfo;
/// Record instruction ordering so we can query their relative positions within
More information about the llvm-commits
mailing list