Skip to content

Commit 0e7ff05

Browse files
eddyz87MaskRay
authored andcommitted
[BPF][DebugInfo][NFC] Move BTF.h definitions from BPF target to DebugInfo
There are plans to add some BTF processing to tools like objdump and readelf. This commit moves BTF.{h,def} files from BPF target specific location to include/llvm/DebugInfo/* to avoid tools including headers from lib/Target/*. Reviewed By: yonghong-song, MaskRay Differential Revision: https://reviews.llvm.org/D149501
1 parent 44479b8 commit 0e7ff05

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed
File renamed without changes.

llvm/lib/Target/BPF/BTF.h renamed to llvm/include/llvm/DebugInfo/BTF/BTF.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ struct BTFEnum {
152152
/// The exact number of BTFEnum64 is stored in the vlen (of the
153153
/// info in "struct CommonType").
154154
struct BTFEnum64 {
155-
uint32_t NameOff; ///< Enum name offset in the string table
156-
uint32_t Val_Lo32; ///< Enum member lo32 value
157-
uint32_t Val_Hi32; ///< Enum member hi32 value
155+
uint32_t NameOff; ///< Enum name offset in the string table
156+
uint32_t Val_Lo32; ///< Enum member lo32 value
157+
uint32_t Val_Hi32; ///< Enum member hi32 value
158158
};
159159

160160
/// BTF_KIND_ARRAY is followed by one "struct BTFArray".
@@ -218,10 +218,10 @@ struct ExtHeader {
218218
uint8_t Flags;
219219
uint32_t HdrLen;
220220

221-
uint32_t FuncInfoOff; ///< Offset of func info section
222-
uint32_t FuncInfoLen; ///< Length of func info section
223-
uint32_t LineInfoOff; ///< Offset of line info section
224-
uint32_t LineInfoLen; ///< Length of line info section
221+
uint32_t FuncInfoOff; ///< Offset of func info section
222+
uint32_t FuncInfoLen; ///< Length of func info section
223+
uint32_t LineInfoOff; ///< Offset of line info section
224+
uint32_t LineInfoLen; ///< Length of line info section
225225
uint32_t FieldRelocOff; ///< Offset of offset reloc section
226226
uint32_t FieldRelocLen; ///< Length of offset reloc section
227227
};
@@ -263,7 +263,7 @@ struct BPFFieldReloc {
263263

264264
/// Specifying offset relocation's in one section.
265265
struct SecFieldReloc {
266-
uint32_t SecNameOff; ///< Section name index in the .BTF string table
266+
uint32_t SecNameOff; ///< Section name index in the .BTF string table
267267
uint32_t NumFieldReloc; ///< Number of offset reloc's in this section
268268
};
269269

llvm/lib/Target/BPF/BTFDebug.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ using namespace llvm;
3030

3131
static const char *BTFKindStr[] = {
3232
#define HANDLE_BTF_KIND(ID, NAME) "BTF_KIND_" #NAME,
33-
#include "BTF.def"
33+
#include "llvm/DebugInfo/BTF/BTF.def"
3434
};
3535

3636
/// Emit a BTF common type.

llvm/lib/Target/BPF/BTFDebug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
#include "llvm/ADT/StringMap.h"
1818
#include "llvm/CodeGen/DebugHandlerBase.h"
19+
#include "llvm/DebugInfo/BTF/BTF.h"
1920
#include <cstdint>
2021
#include <map>
2122
#include <set>
2223
#include <unordered_map>
23-
#include "BTF.h"
2424

2525
namespace llvm {
2626

0 commit comments

Comments
 (0)