Skip to content

Commit 7f6f46c

Browse files
committed
[lldb] Move ValueObject into its own library (NFC) (llvm#113393)
ValueObject is part of lldbCore for historical reasons, but conceptually it deserves to be its own library. This does introduce a (link-time) circular dependency between lldbCore and lldbValueObject, which is unfortunate but probably unavoidable because so many things in LLDB rely on ValueObject. We already have cycles and these libraries are never built as dylibs so while this doesn't improve the situation, it also doesn't make things worse. The header includes were updated with the following command: ``` find . -type f -exec sed -i.bak "s%include \"lldb/Core/ValueObject%include \"lldb/ValueObject/ValueObject%" '{}' \; ``` (cherry picked from commit b852fb1)
1 parent ca37942 commit 7f6f46c

File tree

195 files changed

+417
-381
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+417
-381
lines changed

lldb/include/lldb/Core/IOHandler.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#ifndef LLDB_CORE_IOHANDLER_H
1010
#define LLDB_CORE_IOHANDLER_H
1111

12-
#include "lldb/Core/ValueObjectList.h"
1312
#include "lldb/Host/Config.h"
1413
#include "lldb/Utility/CompletionRequest.h"
1514
#include "lldb/Utility/Flags.h"

lldb/include/lldb/DataFormatters/FormattersContainer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717

1818
#include "lldb/lldb-public.h"
1919

20-
#include "lldb/Core/ValueObject.h"
2120
#include "lldb/DataFormatters/FormatClasses.h"
2221
#include "lldb/DataFormatters/TypeFormat.h"
2322
#include "lldb/DataFormatters/TypeSummary.h"
2423
#include "lldb/DataFormatters/TypeSynthetic.h"
2524
#include "lldb/Symbol/CompilerType.h"
2625
#include "lldb/Utility/RegularExpression.h"
2726
#include "lldb/Utility/StringLexer.h"
27+
#include "lldb/ValueObject/ValueObject.h"
2828

2929
namespace lldb_private {
3030

lldb/include/lldb/DataFormatters/TypeFormat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "lldb/lldb-enumerations.h"
1919
#include "lldb/lldb-public.h"
2020

21-
#include "lldb/Core/ValueObject.h"
21+
#include "lldb/ValueObject/ValueObject.h"
2222

2323
namespace lldb_private {
2424
class TypeFormatImpl {

lldb/include/lldb/DataFormatters/TypeSynthetic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#include "lldb/lldb-enumerations.h"
2121
#include "lldb/lldb-public.h"
2222

23-
#include "lldb/Core/ValueObject.h"
2423
#include "lldb/Utility/StructuredData.h"
24+
#include "lldb/ValueObject/ValueObject.h"
2525

2626
namespace lldb_private {
2727
class SyntheticChildrenFrontEnd {

lldb/include/lldb/Expression/ExpressionVariable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
#include "llvm/ADT/DenseMap.h"
1717

18-
#include "lldb/Core/ValueObject.h"
1918
#include "lldb/Utility/ConstString.h"
19+
#include "lldb/ValueObject/ValueObject.h"
2020
#include "lldb/lldb-public.h"
2121
#include "llvm/Support/ExtensibleRTTI.h"
2222

lldb/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#ifndef LLDB_INTERPRETER_OPTIONGROUPVALUEOBJECTDISPLAY_H
1010
#define LLDB_INTERPRETER_OPTIONGROUPVALUEOBJECTDISPLAY_H
1111

12-
#include "lldb/Core/ValueObject.h"
1312
#include "lldb/Interpreter/Options.h"
13+
#include "lldb/ValueObject/ValueObject.h"
1414

1515
namespace lldb_private {
1616

lldb/include/lldb/Target/LanguageRuntime.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
#include "lldb/Core/PluginInterface.h"
1616
#include "lldb/Core/StructuredDataImpl.h"
1717
#include "lldb/Core/Value.h"
18-
#include "lldb/Core/ValueObject.h"
1918
#include "lldb/Expression/LLVMUserExpression.h"
2019
#include "lldb/Symbol/DeclVendor.h"
2120
#include "lldb/Target/ExecutionContextScope.h"
2221
#include "lldb/Target/Runtime.h"
22+
#include "lldb/ValueObject/ValueObject.h"
2323
#include "lldb/lldb-private.h"
2424
#include "lldb/lldb-public.h"
2525
#include <optional>

lldb/include/lldb/Target/StackFrame.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
#include "lldb/Utility/Flags.h"
1717

1818
#include "lldb/Core/FormatEntity.h"
19-
#include "lldb/Core/ValueObjectList.h"
2019
#include "lldb/Symbol/SymbolContext.h"
2120
#include "lldb/Target/ExecutionContextScope.h"
2221
#include "lldb/Target/StackID.h"
2322
#include "lldb/Utility/Scalar.h"
2423
#include "lldb/Utility/Status.h"
2524
#include "lldb/Utility/StreamString.h"
2625
#include "lldb/Utility/UserID.h"
26+
#include "lldb/ValueObject/ValueObjectList.h"
2727

2828
namespace lldb_private {
2929

lldb/include/lldb/Target/StackFrameRecognizer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
#ifndef LLDB_TARGET_STACKFRAMERECOGNIZER_H
1010
#define LLDB_TARGET_STACKFRAMERECOGNIZER_H
1111

12-
#include "lldb/Core/ValueObject.h"
13-
#include "lldb/Core/ValueObjectList.h"
1412
#include "lldb/Symbol/VariableList.h"
1513
#include "lldb/Target/StopInfo.h"
1614
#include "lldb/Utility/StructuredData.h"
15+
#include "lldb/ValueObject/ValueObject.h"
16+
#include "lldb/ValueObject/ValueObjectList.h"
1717
#include "lldb/lldb-private-forward.h"
1818
#include "lldb/lldb-public.h"
1919

lldb/include/lldb/Core/ValueObject.h renamed to lldb/include/lldb/ValueObject/ValueObject.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLDB_CORE_VALUEOBJECT_H
10-
#define LLDB_CORE_VALUEOBJECT_H
9+
#ifndef LLDB_VALUEOBJECT_VALUEOBJECT_H
10+
#define LLDB_VALUEOBJECT_VALUEOBJECT_H
1111

1212
#include "lldb/Core/SwiftScratchContextReader.h"
1313
#include "lldb/Core/Value.h"
@@ -1088,7 +1088,7 @@ class ValueObject {
10881088
void SetPreferredDisplayLanguageIfNeeded(lldb::LanguageType);
10891089

10901090
protected:
1091-
virtual void DoUpdateChildrenAddressType(ValueObject &valobj){};
1091+
virtual void DoUpdateChildrenAddressType(ValueObject &valobj) {};
10921092

10931093
private:
10941094
virtual CompilerType MaybeCalculateCompleteType();
@@ -1109,4 +1109,4 @@ class ValueObject {
11091109

11101110
} // namespace lldb_private
11111111

1112-
#endif // LLDB_CORE_VALUEOBJECT_H
1112+
#endif // LLDB_VALUEOBJECT_VALUEOBJECT_H

lldb/include/lldb/Core/ValueObjectCast.h renamed to lldb/include/lldb/ValueObject/ValueObjectCast.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLDB_CORE_VALUEOBJECTCAST_H
10-
#define LLDB_CORE_VALUEOBJECTCAST_H
9+
#ifndef LLDB_VALUEOBJECT_VALUEOBJECTCAST_H
10+
#define LLDB_VALUEOBJECT_VALUEOBJECTCAST_H
1111

12-
#include "lldb/Core/ValueObject.h"
1312
#include "lldb/Symbol/CompilerType.h"
13+
#include "lldb/ValueObject/ValueObject.h"
1414
#include "lldb/lldb-defines.h"
1515
#include "lldb/lldb-enumerations.h"
1616
#include "lldb/lldb-forward.h"
@@ -27,8 +27,7 @@ class ValueObjectCast : public ValueObject {
2727
public:
2828
~ValueObjectCast() override;
2929

30-
static lldb::ValueObjectSP Create(ValueObject &parent,
31-
ConstString name,
30+
static lldb::ValueObjectSP Create(ValueObject &parent, ConstString name,
3231
const CompilerType &cast_type);
3332

3433
std::optional<uint64_t> GetByteSize() override;
@@ -64,4 +63,4 @@ class ValueObjectCast : public ValueObject {
6463

6564
} // namespace lldb_private
6665

67-
#endif // LLDB_CORE_VALUEOBJECTCAST_H
66+
#endif // LLDB_VALUEOBJECT_VALUEOBJECTCAST_H

lldb/include/lldb/Core/ValueObjectChild.h renamed to lldb/include/lldb/ValueObject/ValueObjectChild.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLDB_CORE_VALUEOBJECTCHILD_H
10-
#define LLDB_CORE_VALUEOBJECTCHILD_H
9+
#ifndef LLDB_VALUEOBJECT_VALUEOBJECTCHILD_H
10+
#define LLDB_VALUEOBJECT_VALUEOBJECTCHILD_H
1111

12-
#include "lldb/Core/ValueObject.h"
12+
#include "lldb/ValueObject/ValueObject.h"
1313

1414
#include "lldb/Symbol/CompilerType.h"
1515
#include "lldb/Utility/ConstString.h"
@@ -76,10 +76,9 @@ class ValueObjectChild : public ValueObject {
7676
friend class ValueObjectVTable;
7777

7878
ValueObjectChild(ValueObject &parent, const CompilerType &compiler_type,
79-
ConstString name, uint64_t byte_size,
80-
int32_t byte_offset, uint32_t bitfield_bit_size,
81-
uint32_t bitfield_bit_offset, bool is_base_class,
82-
bool is_deref_of_parent,
79+
ConstString name, uint64_t byte_size, int32_t byte_offset,
80+
uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset,
81+
bool is_base_class, bool is_deref_of_parent,
8382
AddressType child_ptr_or_ref_addr_type,
8483
uint64_t language_flags);
8584

@@ -89,4 +88,4 @@ class ValueObjectChild : public ValueObject {
8988

9089
} // namespace lldb_private
9190

92-
#endif // LLDB_CORE_VALUEOBJECTCHILD_H
91+
#endif // LLDB_VALUEOBJECT_VALUEOBJECTCHILD_H

lldb/include/lldb/Core/ValueObjectConstResult.h renamed to lldb/include/lldb/ValueObject/ValueObjectConstResult.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLDB_CORE_VALUEOBJECTCONSTRESULT_H
10-
#define LLDB_CORE_VALUEOBJECTCONSTRESULT_H
9+
#ifndef LLDB_VALUEOBJECT_VALUEOBJECTCONSTRESULT_H
10+
#define LLDB_VALUEOBJECT_VALUEOBJECTCONSTRESULT_H
1111

1212
#include "lldb/Core/Value.h"
13-
#include "lldb/Core/ValueObject.h"
14-
#include "lldb/Core/ValueObjectConstResultImpl.h"
1513
#include "lldb/Symbol/CompilerType.h"
1614
#include "lldb/Utility/ConstString.h"
1715
#include "lldb/Utility/Status.h"
16+
#include "lldb/ValueObject/ValueObject.h"
17+
#include "lldb/ValueObject/ValueObjectConstResultImpl.h"
1818
#include "lldb/lldb-defines.h"
1919
#include "lldb/lldb-enumerations.h"
2020
#include "lldb/lldb-forward.h"
@@ -50,10 +50,11 @@ class ValueObjectConstResult : public ValueObject {
5050
lldb::ByteOrder byte_order, uint32_t addr_size,
5151
lldb::addr_t address = LLDB_INVALID_ADDRESS);
5252

53-
static lldb::ValueObjectSP
54-
Create(ExecutionContextScope *exe_scope, const CompilerType &compiler_type,
55-
ConstString name, lldb::addr_t address,
56-
AddressType address_type, uint32_t addr_byte_size);
53+
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
54+
const CompilerType &compiler_type,
55+
ConstString name, lldb::addr_t address,
56+
AddressType address_type,
57+
uint32_t addr_byte_size);
5758

5859
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope,
5960
Value &value, ConstString name,
@@ -162,4 +163,4 @@ class ValueObjectConstResult : public ValueObject {
162163

163164
} // namespace lldb_private
164165

165-
#endif // LLDB_CORE_VALUEOBJECTCONSTRESULT_H
166+
#endif // LLDB_VALUEOBJECT_VALUEOBJECTCONSTRESULT_H

lldb/include/lldb/Core/ValueObjectConstResultCast.h renamed to lldb/include/lldb/ValueObject/ValueObjectConstResultCast.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLDB_CORE_VALUEOBJECTCONSTRESULTCAST_H
10-
#define LLDB_CORE_VALUEOBJECTCONSTRESULTCAST_H
9+
#ifndef LLDB_VALUEOBJECT_VALUEOBJECTCONSTRESULTCAST_H
10+
#define LLDB_VALUEOBJECT_VALUEOBJECTCONSTRESULTCAST_H
1111

12-
#include "lldb/Core/ValueObjectCast.h"
13-
#include "lldb/Core/ValueObjectConstResultImpl.h"
1412
#include "lldb/Symbol/CompilerType.h"
1513
#include "lldb/Utility/ConstString.h"
14+
#include "lldb/ValueObject/ValueObjectCast.h"
15+
#include "lldb/ValueObject/ValueObjectConstResultImpl.h"
1616
#include "lldb/lldb-defines.h"
1717
#include "lldb/lldb-forward.h"
1818
#include "lldb/lldb-types.h"
@@ -72,4 +72,4 @@ class ValueObjectConstResultCast : public ValueObjectCast {
7272

7373
} // namespace lldb_private
7474

75-
#endif // LLDB_CORE_VALUEOBJECTCONSTRESULTCAST_H
75+
#endif // LLDB_VALUEOBJECT_VALUEOBJECTCONSTRESULTCAST_H

lldb/include/lldb/Core/ValueObjectConstResultChild.h renamed to lldb/include/lldb/ValueObject/ValueObjectConstResultChild.h

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLDB_CORE_VALUEOBJECTCONSTRESULTCHILD_H
10-
#define LLDB_CORE_VALUEOBJECTCONSTRESULTCHILD_H
9+
#ifndef LLDB_VALUEOBJECT_VALUEOBJECTCONSTRESULTCHILD_H
10+
#define LLDB_VALUEOBJECT_VALUEOBJECTCONSTRESULTCHILD_H
1111

12-
#include "lldb/Core/ValueObjectChild.h"
13-
#include "lldb/Core/ValueObjectConstResultImpl.h"
1412
#include "lldb/Symbol/CompilerType.h"
1513
#include "lldb/Utility/ConstString.h"
14+
#include "lldb/ValueObject/ValueObjectChild.h"
15+
#include "lldb/ValueObject/ValueObjectConstResultImpl.h"
1616
#include "lldb/lldb-defines.h"
1717
#include "lldb/lldb-forward.h"
1818
#include "lldb/lldb-types.h"
@@ -28,14 +28,11 @@ class ValueObject;
2828
// A child of a ValueObjectConstResult.
2929
class ValueObjectConstResultChild : public ValueObjectChild {
3030
public:
31-
ValueObjectConstResultChild(ValueObject &parent,
32-
const CompilerType &compiler_type,
33-
ConstString name, uint32_t byte_size,
34-
int32_t byte_offset, uint32_t bitfield_bit_size,
35-
uint32_t bitfield_bit_offset, bool is_base_class,
36-
bool is_deref_of_parent,
37-
lldb::addr_t live_address,
38-
uint64_t language_flags);
31+
ValueObjectConstResultChild(
32+
ValueObject &parent, const CompilerType &compiler_type, ConstString name,
33+
uint32_t byte_size, int32_t byte_offset, uint32_t bitfield_bit_size,
34+
uint32_t bitfield_bit_offset, bool is_base_class, bool is_deref_of_parent,
35+
lldb::addr_t live_address, uint64_t language_flags);
3936

4037
~ValueObjectConstResultChild() override;
4138

@@ -81,4 +78,4 @@ class ValueObjectConstResultChild : public ValueObjectChild {
8178

8279
} // namespace lldb_private
8380

84-
#endif // LLDB_CORE_VALUEOBJECTCONSTRESULTCHILD_H
81+
#endif // LLDB_VALUEOBJECT_VALUEOBJECTCONSTRESULTCHILD_H

lldb/include/lldb/Core/ValueObjectConstResultImpl.h renamed to lldb/include/lldb/ValueObject/ValueObjectConstResultImpl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLDB_CORE_VALUEOBJECTCONSTRESULTIMPL_H
10-
#define LLDB_CORE_VALUEOBJECTCONSTRESULTIMPL_H
9+
#ifndef LLDB_VALUEOBJECT_VALUEOBJECTCONSTRESULTIMPL_H
10+
#define LLDB_VALUEOBJECT_VALUEOBJECTCONSTRESULTIMPL_H
1111

1212
#include "lldb/Utility/ConstString.h"
1313
#include "lldb/lldb-defines.h"
@@ -22,7 +22,7 @@ class CompilerType;
2222
class DataExtractor;
2323
class Status;
2424
class ValueObject;
25-
}
25+
} // namespace lldb_private
2626

2727
namespace lldb_private {
2828

@@ -77,4 +77,4 @@ class ValueObjectConstResultImpl {
7777

7878
} // namespace lldb_private
7979

80-
#endif // LLDB_CORE_VALUEOBJECTCONSTRESULTIMPL_H
80+
#endif // LLDB_VALUEOBJECT_VALUEOBJECTCONSTRESULTIMPL_H

lldb/include/lldb/Core/ValueObjectDynamicValue.h renamed to lldb/include/lldb/ValueObject/ValueObjectDynamicValue.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLDB_CORE_VALUEOBJECTDYNAMICVALUE_H
10-
#define LLDB_CORE_VALUEOBJECTDYNAMICVALUE_H
9+
#ifndef LLDB_VALUEOBJECT_VALUEOBJECTDYNAMICVALUE_H
10+
#define LLDB_VALUEOBJECT_VALUEOBJECTDYNAMICVALUE_H
1111

1212
#include "lldb/Core/Address.h"
13-
#include "lldb/Core/ValueObject.h"
1413
#include "lldb/Symbol/CompilerType.h"
1514
#include "lldb/Symbol/Type.h"
1615
#include "lldb/Utility/ConstString.h"
16+
#include "lldb/ValueObject/ValueObject.h"
1717
#include "lldb/lldb-defines.h"
1818
#include "lldb/lldb-enumerations.h"
1919
#include "lldb/lldb-forward.h"
@@ -126,4 +126,4 @@ class ValueObjectDynamicValue : public ValueObject {
126126

127127
} // namespace lldb_private
128128

129-
#endif // LLDB_CORE_VALUEOBJECTDYNAMICVALUE_H
129+
#endif // LLDB_VALUEOBJECT_VALUEOBJECTDYNAMICVALUE_H

lldb/include/lldb/Core/ValueObjectList.h renamed to lldb/include/lldb/ValueObject/ValueObjectList.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLDB_CORE_VALUEOBJECTLIST_H
10-
#define LLDB_CORE_VALUEOBJECTLIST_H
9+
#ifndef LLDB_VALUEOBJECT_VALUEOBJECTLIST_H
10+
#define LLDB_VALUEOBJECT_VALUEOBJECTLIST_H
1111

1212
#include "lldb/lldb-forward.h"
1313
#include "lldb/lldb-types.h"
@@ -51,6 +51,7 @@ class ValueObjectList {
5151
const std::vector<lldb::ValueObjectSP> &GetObjects() const {
5252
return m_value_objects;
5353
}
54+
5455
protected:
5556
typedef std::vector<lldb::ValueObjectSP> collection;
5657
// Classes that inherit from ValueObjectList can see and modify these
@@ -59,4 +60,4 @@ class ValueObjectList {
5960

6061
} // namespace lldb_private
6162

62-
#endif // LLDB_CORE_VALUEOBJECTLIST_H
63+
#endif // LLDB_VALUEOBJECT_VALUEOBJECTLIST_H

0 commit comments

Comments
 (0)