rupprecht created this revision. Herald added subscribers: frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, arichardson. Herald added a project: All. rupprecht requested review of this revision. Herald added subscribers: lldb-commits, pcwang-thead. Herald added a project: LLDB.
Some headers in LLDB work only when considered as textual inclusion, but not if one attempts to use them on their own or with a different context. - python-typemaps.h: uses Python definitions without using "Python.h". - RISCVCInstructions.h uses RISC-V register enums without including the enums header. - RISCVInstructions.h includes EmulateInstructionRISCV.h, but is unnecessary since we forward-declare EmulateInstructionRISCV anyway. Including the header is problematic because EmulateInstructionRISCV.h uses DecodeResult which isn't defined until later in RISCVInstructions.h. This makes LLDB build cleanly with the "parse_headers" feature [1]. I'm not sure what the analagous CMake option is. [1] I didn't find public documentation but @MaskRay wrote this up: https://maskray.me/blog/2022-09-25-layering-check-with-clang#parse_headers Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D138310 Files: lldb/bindings/python/python-typemaps.h lldb/source/Plugins/Instruction/RISCV/RISCVCInstructions.h lldb/source/Plugins/Instruction/RISCV/RISCVInstructions.h Index: lldb/source/Plugins/Instruction/RISCV/RISCVInstructions.h =================================================================== --- lldb/source/Plugins/Instruction/RISCV/RISCVInstructions.h +++ lldb/source/Plugins/Instruction/RISCV/RISCVInstructions.h @@ -12,7 +12,6 @@ #include <cstdint> #include <variant> -#include "EmulateInstructionRISCV.h" #include "llvm/ADT/Optional.h" namespace lldb_private { Index: lldb/source/Plugins/Instruction/RISCV/RISCVCInstructions.h =================================================================== --- lldb/source/Plugins/Instruction/RISCV/RISCVCInstructions.h +++ lldb/source/Plugins/Instruction/RISCV/RISCVCInstructions.h @@ -12,6 +12,7 @@ #include <cstdint> #include <variant> +#include "Plugins/Process/Utility/lldb-riscv-register-enums.h" #include "RISCVInstructions.h" #include "llvm/ADT/Optional.h" Index: lldb/bindings/python/python-typemaps.h =================================================================== --- lldb/bindings/python/python-typemaps.h +++ lldb/bindings/python/python-typemaps.h @@ -1,6 +1,8 @@ #ifndef LLDB_BINDINGS_PYTHON_PYTHON_TYPEMAPS_H #define LLDB_BINDINGS_PYTHON_PYTHON_TYPEMAPS_H +#include <Python.h> + // Defined here instead of a .swig file because SWIG 2 doesn't support // explicit deleted functions. struct Py_buffer_RAII {
Index: lldb/source/Plugins/Instruction/RISCV/RISCVInstructions.h =================================================================== --- lldb/source/Plugins/Instruction/RISCV/RISCVInstructions.h +++ lldb/source/Plugins/Instruction/RISCV/RISCVInstructions.h @@ -12,7 +12,6 @@ #include <cstdint> #include <variant> -#include "EmulateInstructionRISCV.h" #include "llvm/ADT/Optional.h" namespace lldb_private { Index: lldb/source/Plugins/Instruction/RISCV/RISCVCInstructions.h =================================================================== --- lldb/source/Plugins/Instruction/RISCV/RISCVCInstructions.h +++ lldb/source/Plugins/Instruction/RISCV/RISCVCInstructions.h @@ -12,6 +12,7 @@ #include <cstdint> #include <variant> +#include "Plugins/Process/Utility/lldb-riscv-register-enums.h" #include "RISCVInstructions.h" #include "llvm/ADT/Optional.h" Index: lldb/bindings/python/python-typemaps.h =================================================================== --- lldb/bindings/python/python-typemaps.h +++ lldb/bindings/python/python-typemaps.h @@ -1,6 +1,8 @@ #ifndef LLDB_BINDINGS_PYTHON_PYTHON_TYPEMAPS_H #define LLDB_BINDINGS_PYTHON_PYTHON_TYPEMAPS_H +#include <Python.h> + // Defined here instead of a .swig file because SWIG 2 doesn't support // explicit deleted functions. struct Py_buffer_RAII {
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits