diff --git a/include/llvm/MC/MCBTFContext.h b/include/llvm/MC/MCBTFContext.h index f180a69340b..fd9edbcf7a8 100644 --- a/include/llvm/MC/MCBTFContext.h +++ b/include/llvm/MC/MCBTFContext.h @@ -13,22 +13,26 @@ #ifndef LLVM_MC_MCBTFCONTEXT_H #define LLVM_MC_MCBTFCONTEXT_H +#include "llvm/MC/MCSymbol.h" +#include "llvm/Support/raw_ostream.h" #include +#include +#include -#define BTF_MAGIC 0xeB9F -#define BTF_VERSION 1 +#define BTF_MAGIC 0xeB9F +#define BTF_VERSION 1 struct btf_header { - __u16 magic; - __u8 version; - __u8 flags; - __u32 hdr_len; + __u16 magic; + __u8 version; + __u8 flags; + __u32 hdr_len; - /* All offsets are in bytes relative to the end of this header */ - __u32 type_off; /* offset of type section */ - __u32 type_len; /* length of type section */ - __u32 str_off; /* offset of string section */ - __u32 str_len; /* length of string section */ + /* All offsets are in bytes relative to the end of this header */ + __u32 type_off; /* offset of type section */ + __u32 type_len; /* length of type section */ + __u32 str_off; /* offset of string section */ + __u32 str_len; /* length of string section */ }; /* Max # of type identifier */ @@ -178,9 +182,6 @@ const char *const btf_kind_str[NR_BTF_KINDS] = { [BTF_KIND_FUNC_PROTO] = "FUNC_PROTO", }; -#include "llvm/ADT/SmallVector.h" -#include - class MCBTFContext; class MCObjectStreamer; @@ -196,6 +197,7 @@ protected: public: BTFTypeEntry(size_t id, struct btf_type &type) : Id(id), BTFType(type) {} + virtual ~BTFTypeEntry(); unsigned char getKind() { return BTF_INFO_KIND(BTFType.info); } void setId(size_t Id) { this->Id = Id; } size_t getId() { return Id; } diff --git a/lib/CodeGen/AsmPrinter/Dwarf2BTF.cpp b/lib/CodeGen/AsmPrinter/Dwarf2BTF.cpp index 20eab4d1fb8..8b16e389963 100644 --- a/lib/CodeGen/AsmPrinter/Dwarf2BTF.cpp +++ b/lib/CodeGen/AsmPrinter/Dwarf2BTF.cpp @@ -15,6 +15,8 @@ namespace llvm { +Die2BTFEntry::~Die2BTFEntry() {} + unsigned char Die2BTFEntry::getDieKind(const DIE & Die) { auto Tag = Die.getTag(); diff --git a/lib/CodeGen/AsmPrinter/Dwarf2BTF.h b/lib/CodeGen/AsmPrinter/Dwarf2BTF.h index 3df4dd802a7..125441d37b3 100644 --- a/lib/CodeGen/AsmPrinter/Dwarf2BTF.h +++ b/lib/CodeGen/AsmPrinter/Dwarf2BTF.h @@ -30,6 +30,7 @@ protected: struct btf_type BTFType; public: + virtual ~Die2BTFEntry(); // Return desired BTF_KIND for the Die, return BTF_KIND_UNKN for // invalid/unsupported Die static unsigned char getDieKind(const DIE &Die); diff --git a/lib/MC/MCBTFContext.cpp b/lib/MC/MCBTFContext.cpp index cb846ee5e51..d1c30dd0b88 100644 --- a/lib/MC/MCBTFContext.cpp +++ b/lib/MC/MCBTFContext.cpp @@ -11,8 +11,6 @@ #include "llvm/MC/MCBTFContext.h" #include "llvm/MC/MCObjectFileInfo.h" #include "llvm/MC/MCObjectStreamer.h" -#include "llvm/MC/MCSymbol.h" -#include "llvm/Support/raw_ostream.h" #include #include #include @@ -21,6 +19,8 @@ using namespace llvm; #define DEBUG_TYPE "btf" +BTFTypeEntry::~BTFTypeEntry() {} + void MCBTFContext::addTypeEntry(std::unique_ptr Entry) { TypeEntries.push_back(std::move(Entry)); }