diff options
| author | Enrico Granata <egranata@apple.com> | 2013-03-15 23:33:15 +0000 |
|---|---|---|
| committer | Enrico Granata <egranata@apple.com> | 2013-03-15 23:33:15 +0000 |
| commit | 7277d201a9d78851c7de46317e9dbb7a52d2ab71 (patch) | |
| tree | 2cf3092f10a1fd2297ea8fdc0bacf6bc080c9ee5 /lldb | |
| parent | 7b641e97ed04a0d7cdcdad4b423190747af90ec9 (diff) | |
| download | bcm5719-llvm-7277d201a9d78851c7de46317e9dbb7a52d2ab71.tar.gz bcm5719-llvm-7277d201a9d78851c7de46317e9dbb7a52d2ab71.zip | |
Performance improvements to the IsObjCNil () - we only try to resolve the value if the variable under consideration truly is an “Objective-C thing”
This also changes the ClangASTContext to make sure that id is correctly marked as being such an ObjC thing
llvm-svn: 177203
Diffstat (limited to 'lldb')
| -rw-r--r-- | lldb/source/Core/ValueObject.cpp | 7 | ||||
| -rw-r--r-- | lldb/source/Symbol/ClangASTContext.cpp | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index fb3c9b3c06c..031d7546339 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -1899,10 +1899,13 @@ ValueObject::IsPossibleDynamicType () bool ValueObject::IsObjCNil () { - bool isObjCpointer = ClangASTContext::IsObjCObjectPointerType(GetClangType(), NULL); + const uint32_t mask = ClangASTContext::eTypeIsObjC | ClangASTContext::eTypeIsPointer; + bool isObjCpointer = ( ((ClangASTContext::GetTypeInfo(GetClangType(), GetClangAST(), NULL)) & mask) == mask); + if (!isObjCpointer) + return false; bool canReadValue = true; bool isZero = GetValueAsUnsigned(0,&canReadValue) == 0; - return canReadValue && isZero && isObjCpointer; + return canReadValue && isZero; } ValueObjectSP diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index 0b8465e414c..28679b93e37 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -2920,7 +2920,7 @@ ClangASTContext::GetTypeInfo case clang::BuiltinType::ObjCClass: if (ast && pointee_or_element_clang_type) *pointee_or_element_clang_type = ast->ObjCBuiltinClassTy.getAsOpaquePtr(); - return eTypeIsBuiltIn | eTypeIsPointer | eTypeHasValue; + return eTypeIsBuiltIn | eTypeIsPointer | eTypeHasValue | eTypeIsObjC; break; case clang::BuiltinType::Bool: case clang::BuiltinType::Char_U: |

