llvm-project/llvm/lib/Target/BPF
Yonghong Song 3eacfdc72f [BPF] Fix a BTF gen bug related to a pointer struct member
Currently, BTF generation stops at pointer struct members
if the pointee type is a struct. This is to avoid bloating
generated BTF size. The following is the process to
correctly record types for these pointee struct types.
  - During type traversal stage, when a struct member, which
    is a pointer to another struct, is encountered,
    the pointee struct type, keyed with its name, is
    remembered in a Fixup map.
  - Later, when all type traversal is done, the Fixup map
    is scanned, based on struct name matching, to either
    resolve as pointing to a real already generated type
    or as a forward declaration.

Andrii discovered a bug if the struct member pointee struct
is anonymous. In this case, a struct with empty name is
recorded in Fixup map, and later it happens another anonymous
struct with empty name is defined in BTF. So wrong type
resolution happens.

To fix the problem, if the struct member pointee struct
is anonymous, pointee struct type will be generated in
stead of being put in Fixup map.

Differential Revision: https://reviews.llvm.org/D82976
2020-07-01 09:55:01 -07:00
..
AsmParser [AsmPrinter][MCStreamer] De-capitalize EmitInstruction and EmitCFI* 2020-02-13 22:08:55 -08:00
Disassembler [BPF] fix an asan issue when disassemble an illegal instruction 2020-05-18 22:33:34 -07:00
MCTargetDesc BPFMCTargetDesc.h - remove unused raw_ostream forward declaration. NFC. 2020-04-22 18:26:50 +01:00
TargetInfo CMake: Make most target symbols hidden by default 2020-01-14 19:46:52 -08:00
BPF.h [BPF] preserve debuginfo types for builtin __builtin__btf_type_id() 2020-05-15 08:00:44 -07:00
BPF.td
BPFAbstractMemberAccess.cpp [Alignment][NFC] Use Align for BPFAbstractMemberAccess::RecordAlignment 2020-07-01 16:23:52 +00:00
BPFAsmPrinter.cpp [AsmPrinter][MCStreamer] De-capitalize EmitInstruction and EmitCFI* 2020-02-13 22:08:55 -08:00
BPFCORE.h Remove global std::strings. NFCI. 2020-06-17 14:29:42 +02:00
BPFCallingConv.td
BPFFrameLowering.cpp
BPFFrameLowering.h [Alignment][NFC] Use Align for TargetFrameLowering/Subtarget 2019-10-17 07:49:39 +00:00
BPFISelDAGToDAG.cpp [BPF] fix incorrect type in BPFISelDAGToDAG readonly load optimization 2020-06-11 19:31:06 -07:00
BPFISelLowering.cpp [BPF] simplify zero extension with MOV_32_64 2020-05-27 11:26:39 -07:00
BPFISelLowering.h [BPF] implement isTruncateFree and isZExtFree in BPFTargetLowering 2020-02-11 09:59:19 -08:00
BPFInstrFormats.td
BPFInstrInfo.cpp [NFC] unsigned->Register in storeRegTo/loadRegFromStack 2020-02-03 14:22:16 +01:00
BPFInstrInfo.h [NFC] unsigned->Register in storeRegTo/loadRegFromStack 2020-02-03 14:22:16 +01:00
BPFInstrInfo.td [BPF] simplify zero extension with MOV_32_64 2020-05-27 11:26:39 -07:00
BPFMCInstLower.cpp
BPFMCInstLower.h [BPF] Remove unused forward declarations. NFC. 2020-04-22 15:07:18 +01:00
BPFMIChecking.cpp Prune a LegacyDivergenceAnalysis and MachineLoopInfo include each 2019-10-19 01:31:09 +00:00
BPFMIPeephole.cpp [BPF] Remove unnecessary MOV_32_64 instructions 2020-06-03 08:14:54 -07:00
BPFMISimplifyPatchable.cpp [BPF] preserve debuginfo types for builtin __builtin__btf_type_id() 2020-05-15 08:00:44 -07:00
BPFPreserveDIType.cpp Remove global std::strings. NFCI. 2020-06-17 14:29:42 +02:00
BPFRegisterInfo.cpp
BPFRegisterInfo.h
BPFRegisterInfo.td
BPFSelectionDAGInfo.cpp [Alignment][NFC] Migrate SelectionDAGTargetInfo::EmitTargetCodeForMemcpy to Align 2020-06-30 13:12:31 +00:00
BPFSelectionDAGInfo.h [Alignment][NFC] Migrate SelectionDAGTargetInfo::EmitTargetCodeForMemcpy to Align 2020-06-30 13:12:31 +00:00
BPFSubtarget.cpp [BPF] turn on -mattr=+alu32 for cpu version v3 and later 2019-11-07 22:08:46 -08:00
BPFSubtarget.h
BPFTargetMachine.cpp [BPF] preserve debuginfo types for builtin __builtin__btf_type_id() 2020-05-15 08:00:44 -07:00
BPFTargetMachine.h
BTF.def
BTF.h [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
BTFDebug.cpp [BPF] Fix a BTF gen bug related to a pointer struct member 2020-07-01 09:55:01 -07:00
BTFDebug.h [BPF] preserve debuginfo types for builtin __builtin__btf_type_id() 2020-05-15 08:00:44 -07:00
CMakeLists.txt [BPF] preserve debuginfo types for builtin __builtin__btf_type_id() 2020-05-15 08:00:44 -07:00
LLVMBuild.txt