summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-03-15 23:33:15 +0000
committerEnrico Granata <egranata@apple.com>2013-03-15 23:33:15 +0000
commit7277d201a9d78851c7de46317e9dbb7a52d2ab71 (patch)
tree2cf3092f10a1fd2297ea8fdc0bacf6bc080c9ee5 /lldb/source/Core
parent7b641e97ed04a0d7cdcdad4b423190747af90ec9 (diff)
downloadbcm5719-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')
-rw-r--r--lldb/source/Core/ValueObject.cpp7
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
OpenPOWER on IntegriCloud