Skip to content

Commit 7d1bf1c

Browse files
author
walter erquinigo
committed
[LLDB][NFC] Move some constructors to their cpp file
CompilerType constructors rely on the NDEBUG macro, so it's better to move them to their cpp file so that the header doesn't get confused when this macro is used differently for other compilation units.
1 parent 170b552 commit 7d1bf1c

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

lldb/include/lldb/Symbol/CompilerType.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ class CompilerType {
4242
///
4343
/// \see lldb_private::TypeSystemClang::GetType(clang::QualType)
4444
CompilerType(lldb::TypeSystemWP type_system,
45-
lldb::opaque_compiler_type_t type)
46-
: m_type_system(type_system), m_type(type) {
47-
assert(Verify() && "verification failed");
48-
}
45+
lldb::opaque_compiler_type_t type);
4946

5047
/// This is a minimal wrapper of a TypeSystem shared pointer as
5148
/// returned by CompilerType which conventien dyn_cast support.
@@ -88,10 +85,8 @@ class CompilerType {
8885
lldb::TypeSystemSP GetSharedPointer() const { return m_typesystem_sp; }
8986
};
9087

91-
CompilerType(TypeSystemSPWrapper type_system, lldb::opaque_compiler_type_t type)
92-
: m_type_system(type_system.GetSharedPointer()), m_type(type) {
93-
assert(Verify() && "verification failed");
94-
}
88+
CompilerType(TypeSystemSPWrapper type_system,
89+
lldb::opaque_compiler_type_t type);
9590

9691
CompilerType(const CompilerType &rhs)
9792
: m_type_system(rhs.m_type_system), m_type(rhs.m_type) {}

lldb/source/Symbol/CompilerType.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,18 @@ bool CompilerType::GetValueAsScalar(const lldb_private::DataExtractor &data,
951951
return false;
952952
}
953953

954+
CompilerType::CompilerType(CompilerType::TypeSystemSPWrapper type_system,
955+
lldb::opaque_compiler_type_t type)
956+
: m_type_system(type_system.GetSharedPointer()), m_type(type) {
957+
assert(Verify() && "verification failed");
958+
}
959+
960+
CompilerType::CompilerType(lldb::TypeSystemWP type_system,
961+
lldb::opaque_compiler_type_t type)
962+
: m_type_system(type_system), m_type(type) {
963+
assert(Verify() && "verification failed");
964+
}
965+
954966
#ifndef NDEBUG
955967
bool CompilerType::Verify() const {
956968
if (!IsValid())

0 commit comments

Comments
 (0)