diff options
| author | Andy Yankovsky <weratt@gmail.com> | 2020-12-22 10:06:46 -0800 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2020-12-22 10:08:21 -0800 |
| commit | e17a00fc87bc163cc2438ce10faca51d94b91ab3 (patch) | |
| tree | d5221b884e753cbb003e9dfd34092f95a19910b2 /lldb/source/API/SBType.cpp | |
| parent | f5071489ea8cf2771d7375534c122467a000b356 (diff) | |
[lldb] Add SBType::IsScopedEnumerationType method
Add a method to check if the type is a scoped enumeration (i.e. "enum
class/struct").
Differential revision: https://reviews.llvm.org/D93690
Diffstat (limited to 'lldb/source/API/SBType.cpp')
| -rw-r--r-- | lldb/source/API/SBType.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lldb/source/API/SBType.cpp b/lldb/source/API/SBType.cpp index 0a99ac0f2292..7d8d4cfeef4f 100644 --- a/lldb/source/API/SBType.cpp +++ b/lldb/source/API/SBType.cpp @@ -271,6 +271,14 @@ bool SBType::IsAnonymousType() { 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); @@ -935,6 +943,7 @@ void RegisterMethods<SBType>(Registry &R) { 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, ()); |
