Skip to content

Commit 32e43df

Browse files
committed
Do not include llvm/BinaryFormat/Dwarf.h in llvm/IR/DebugInfoMetadata.h
1 parent 57e86f6 commit 32e43df

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

llvm/include/llvm/IR/DebugInfoMetadata.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "llvm/ADT/SmallVector.h"
2121
#include "llvm/ADT/StringRef.h"
2222
#include "llvm/ADT/iterator_range.h"
23-
#include "llvm/BinaryFormat/Dwarf.h"
2423
#include "llvm/IR/Constants.h"
2524
#include "llvm/IR/Metadata.h"
2625
#include "llvm/IR/PseudoProbe.h"
@@ -746,9 +745,7 @@ class DIType : public DIScope {
746745

747746
unsigned getLine() const { return Line; }
748747
uint64_t getSizeInBits() const { return SizeInBits; }
749-
uint32_t getAlignInBits() const {
750-
return (getTag() == dwarf::DW_TAG_LLVM_ptrauth_type ? 0 : SubclassData32);
751-
}
748+
uint32_t getAlignInBits() const;
752749
uint32_t getAlignInBytes() const { return getAlignInBits() / CHAR_BIT; }
753750
uint64_t getOffsetInBits() const { return OffsetInBits; }
754751
DIFlags getFlags() const { return Flags; }
@@ -1096,11 +1093,7 @@ class DIDerivedType : public DIType {
10961093
return DWARFAddressSpace;
10971094
}
10981095

1099-
std::optional<PtrAuthData> getPtrAuthData() const {
1100-
return getTag() == dwarf::DW_TAG_LLVM_ptrauth_type
1101-
? std::optional<PtrAuthData>(PtrAuthData(SubclassData32))
1102-
: std::nullopt;
1103-
}
1096+
std::optional<PtrAuthData> getPtrAuthData() const;
11041097

11051098
/// \returns The PointerAuth key.
11061099
std::optional<unsigned> getPtrAuthKey() const {

llvm/lib/IR/DebugInfoMetadata.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ cl::opt<bool> EnableFSDiscriminator(
3434
cl::desc("Enable adding flow sensitive discriminators"));
3535
} // namespace llvm
3636

37+
uint32_t DIType::getAlignInBits() const {
38+
return (getTag() == dwarf::DW_TAG_LLVM_ptrauth_type ? 0 : SubclassData32);
39+
}
40+
3741
const DIExpression::FragmentInfo DebugVariable::DefaultFragment = {
3842
std::numeric_limits<uint64_t>::max(), std::numeric_limits<uint64_t>::min()};
3943

@@ -750,6 +754,13 @@ DIDerivedType *DIDerivedType::getImpl(
750754
Ops);
751755
}
752756

757+
std::optional<DIDerivedType::PtrAuthData>
758+
DIDerivedType::getPtrAuthData() const {
759+
return getTag() == dwarf::DW_TAG_LLVM_ptrauth_type
760+
? std::optional<PtrAuthData>(PtrAuthData(SubclassData32))
761+
: std::nullopt;
762+
}
763+
753764
DICompositeType *DICompositeType::getImpl(
754765
LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
755766
unsigned Line, Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits,

0 commit comments

Comments
 (0)