From 7277d201a9d78851c7de46317e9dbb7a52d2ab71 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Fri, 15 Mar 2013 23:33:15 +0000 Subject: 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit llvm-svn: 177203 --- lldb/source/Core/ValueObject.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lldb/source/Core/ValueObject.cpp') 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 -- cgit v1.2.3