[cfe-commits] r50503 - in /cfe/trunk/lib/Analysis: BasicObjCFoundationChecks.cpp RValues.cpp
Ted Kremenek
kremenek at apple.com
Wed Apr 30 15:48:21 PDT 2008
Author: kremenek
Date: Wed Apr 30 17:48:21 2008
New Revision: 50503
URL: http://llvm.org/viewvc/llvm-project?rev=50503&view=rev
Log:
More cleanups with ObjCQualifiedIdType in the static analyzer.
Modified:
cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp
cfe/trunk/lib/Analysis/RValues.cpp
Modified: cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp?rev=50503&r1=50502&r2=50503&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp (original)
+++ cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp Wed Apr 30 17:48:21 2008
@@ -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 @@
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) {
Modified: cfe/trunk/lib/Analysis/RValues.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RValues.cpp?rev=50503&r1=50502&r2=50503&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/RValues.cpp (original)
+++ cfe/trunk/lib/Analysis/RValues.cpp Wed Apr 30 17:48:21 2008
@@ -235,8 +235,9 @@
QualType T = D->getType();
- if (T->isPointerLikeType())
+ if (T->isPointerLikeType() || T->isObjCQualifiedIdType())
return lval::SymbolVal(SymMgr.getSymbol(D));
+
return nonlval::SymbolVal(SymMgr.getSymbol(D));
}
More information about the cfe-commits
mailing list