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/source/Core/ValueObject.cpp | |
| 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/source/Core/ValueObject.cpp')
| -rw-r--r-- | lldb/source/Core/ValueObject.cpp | 7 |
1 files changed, 5 insertions, 2 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 |

