bool
IsAnonymousType ();
+ bool
+ IsScopedEnumerationType ();
+
lldb::SBType
GetPointerType();
bool IsAnonymousType();
+ bool IsScopedEnumerationType();
+
lldb::SBType GetPointerType();
lldb::SBType GetPointeeType();
bool IsAnonymousType() const;
+ bool IsScopedEnumerationType() const;
+
bool IsBeingDefined() const;
bool IsCharType() const;
return false;
}
+ virtual bool IsScopedEnumerationType(lldb::opaque_compiler_type_t type) = 0;
+
virtual bool IsPossibleDynamicType(lldb::opaque_compiler_type_t type,
CompilerType *target_type, // Can pass NULL
bool check_cplusplus, bool check_objc) = 0;
return m_opaque_sp->GetCompilerType(true).IsAnonymousType();
}
+bool SBType::IsScopedEnumerationType() {
+ LLDB_RECORD_METHOD_NO_ARGS(bool, SBType, IsScopedEnumerationType);
+
+ if (!IsValid())
+ return false;
+ return m_opaque_sp->GetCompilerType(true).IsScopedEnumerationType();
+}
+
lldb::SBType SBType::GetFunctionReturnType() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBType, SBType, GetFunctionReturnType);
LLDB_REGISTER_METHOD(bool, SBType, IsPolymorphicClass, ());
LLDB_REGISTER_METHOD(bool, SBType, IsTypedefType, ());
LLDB_REGISTER_METHOD(bool, SBType, IsAnonymousType, ());
+ LLDB_REGISTER_METHOD(bool, SBType, IsScopedEnumerationType, ());
LLDB_REGISTER_METHOD(lldb::SBType, SBType, GetFunctionReturnType, ());
LLDB_REGISTER_METHOD(lldb::SBTypeList, SBType, GetFunctionArgumentTypes,
());
return false;
}
+bool TypeSystemClang::IsScopedEnumerationType(
+ lldb::opaque_compiler_type_t type) {
+ if (type) {
+ const clang::EnumType *enum_type = llvm::dyn_cast<clang::EnumType>(
+ GetCanonicalQualType(type)->getCanonicalTypeInternal());
+
+ if (enum_type) {
+ return enum_type->isScopedEnumeralType();
+ }
+ }
+
+ return false;
+}
+
bool TypeSystemClang::IsPointerType(lldb::opaque_compiler_type_t type,
CompilerType *pointee_type) {
if (type) {
bool IsEnumerationType(lldb::opaque_compiler_type_t type,
bool &is_signed) override;
+ bool IsScopedEnumerationType(lldb::opaque_compiler_type_t type) override;
+
static bool IsObjCClassType(const CompilerType &type);
static bool IsObjCClassTypeAndHasIVars(const CompilerType &type,
return false;
}
+bool CompilerType::IsScopedEnumerationType() const {
+ if (IsValid())
+ return m_type_system->IsScopedEnumerationType(m_type);
+ return false;
+}
+
bool CompilerType::IsArrayType(CompilerType *element_type_ptr, uint64_t *size,
bool *is_incomplete) const {
if (IsValid())
myint_type = target.FindFirstType('myint')
self.DebugSBType(myint_type)
self.assertTrue(myint_arr_element_type == myint_type)
+
+ # Test enum methods.
+ enum_type = target.FindFirstType('EnumType')
+ self.assertTrue(enum_type)
+ self.DebugSBType(enum_type)
+ self.assertFalse(enum_type.IsScopedEnumerationType())
+ scoped_enum_type = target.FindFirstType('ScopedEnumType')
+ self.assertTrue(scoped_enum_type)
+ self.DebugSBType(scoped_enum_type)
+ self.assertTrue(scoped_enum_type.IsScopedEnumerationType())
{}
};
+enum EnumType {};
+enum class ScopedEnumType {};
int main (int argc, char const *argv[])
{
typedef int myint;
myint myint_arr[] = {1, 2, 3};
+ EnumType enum_type;
+ ScopedEnumType scoped_enum_type;
+
return 0; // Break at this line
}