]> granicus.if.org Git - clang/commitdiff
More cleanups with ObjCQualifiedIdType in the static analyzer.
authorTed Kremenek <kremenek@apple.com>
Wed, 30 Apr 2008 22:48:21 +0000 (22:48 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 30 Apr 2008 22:48:21 +0000 (22:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50503 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BasicObjCFoundationChecks.cpp
lib/Analysis/RValues.cpp

index d2a3d08b8e3eff9c6a0e5c4cf6e42c4b1a36cd9e..bb16df91c6ae17d61d76438d962924ea6fd0acbb 100644 (file)
@@ -16,7 +16,6 @@
 #include "BasicObjCFoundationChecks.h"
 
 #include "clang/Analysis/PathSensitive/ExplodedGraph.h"
-#include "clang/Analysis/PathSensitive/GRExprEngine.h"
 #include "clang/Analysis/PathSensitive/GRSimpleAPICheck.h"
 #include "clang/Analysis/PathSensitive/ValueState.h"
 #include "clang/Analysis/PathSensitive/BugReporter.h"
@@ -36,15 +35,16 @@ static ObjCInterfaceType* GetReceiverType(ObjCMessageExpr* ME) {
   if (!Receiver)
     return NULL;
   
-  // FIXME: Cleanup
   QualType X = Receiver->getType();
-  Type* TP = X.getTypePtr();
   
-  assert (IsPointerType(X));
-  
-  const PointerType* T = TP->getAsPointerType();
-  
-  return dyn_cast<ObjCInterfaceType>(T->getPointeeType().getTypePtr());
+  if (X->isPointerType()) {
+    Type* TP = X.getTypePtr();
+    const PointerType* T = TP->getAsPointerType();    
+    return dyn_cast<ObjCInterfaceType>(T->getPointeeType().getTypePtr());
+  }
+
+  // FIXME: Support ObjCQualifiedIdType?
+  return NULL;
 }
 
 static const char* GetReceiverNameType(ObjCMessageExpr* ME) {
index 85c3b23efd043cc1d832d2534b4fb98b3cd42d6d..60c349420a3d570649de659e72617203209f0c41 100644 (file)
@@ -235,8 +235,9 @@ RVal RVal::GetSymbolValue(SymbolManager& SymMgr, VarDecl* D) {
 
   QualType T = D->getType();
   
-  if (T->isPointerLikeType())
+  if (T->isPointerLikeType() || T->isObjCQualifiedIdType())
     return lval::SymbolVal(SymMgr.getSymbol(D));
+  
   return nonlval::SymbolVal(SymMgr.getSymbol(D));
 }