[lldb] Fix a circular include dependency (NFC) (#188931)

`lldb-private-types.h` includes `lldb-private.h`, which in turn includes
`lldb-private-types.h`. Because of that, `lldb-public.h` included by
`lldb-private.h` after `lldb-private-types.h` is not actually included.

The practical consequence of this is that types defined in
`lldb-public-types.h` (for example, `addr_t` needed downstream) are not
available in `lldb-private-types.h`.

Fix this by "including what you use", which is `lldb-types.h`.
This commit is contained in:
Sergei Barannikov 2026-03-30 18:45:36 +03:00 committed by GitHub
parent 58419354a8
commit 4d7339a14d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 5 additions and 4 deletions

View File

@ -10,7 +10,7 @@
#define LLDB_INTERPRETER_OPTIONARGPARSER_H
#include "lldb/lldb-private-types.h"
#include "llvm/Support/Error.h"
#include <optional>
namespace lldb_private {

View File

@ -9,11 +9,9 @@
#ifndef LLDB_LLDB_PRIVATE_TYPES_H
#define LLDB_LLDB_PRIVATE_TYPES_H
#include "lldb/lldb-private.h"
#include "lldb/lldb-types.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallString.h"
#include <type_traits>
namespace llvm {

View File

@ -9,6 +9,7 @@
#include "RegisterContextWindows_i386.h"
#include "RegisterContext_x86.h"
#include "lldb-x86-register-enums.h"
#include "lldb/lldb-defines.h"
using namespace lldb_private;
using namespace lldb;

View File

@ -9,6 +9,7 @@
#include "RegisterContextWindows_x86_64.h"
#include "RegisterContext_x86.h"
#include "lldb-x86-register-enums.h"
#include "lldb/lldb-defines.h"
#include <vector>

View File

@ -9,6 +9,7 @@
#include "gtest/gtest.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/lldb-defines.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/BinaryFormat/MachO.h"