summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-12-04 03:47:34 +0000
committerJohn McCall <rjmccall@apple.com>2010-12-04 03:47:34 +0000
commit34376a68c414ccf372e9d83f3251ecb08eb055f2 (patch)
tree336b12526893f3694b8cb5654fef621818daca81 /clang/lib/Analysis
parent1c8ac8f027d4a7af830e91513f37a2139c684f19 (diff)
downloadbcm5719-llvm-34376a68c414ccf372e9d83f3251ecb08eb055f2.tar.gz
bcm5719-llvm-34376a68c414ccf372e9d83f3251ecb08eb055f2.zip
Although we currently have explicit lvalue-to-rvalue conversions, they're
not actually frequently used, because ImpCastExprToType only creates a node if the types differ. So explicitly create an ICE in the lvalue-to-rvalue conversion code in DefaultFunctionArrayLvalueConversion() as well as several other new places, and consistently deal with the consequences throughout the compiler. In addition, introduce a new cast kind for loading an ObjCProperty l-value, and make sure we emit those nodes whenever an ObjCProperty l-value appears that's not on the LHS of an assignment operator. This breaks a couple of rewriter tests, which I've x-failed until future development occurs on the rewriter. Ted Kremenek kindly contributed the analyzer workarounds in this patch. llvm-svn: 120890
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r--clang/lib/Analysis/CFG.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index 57e67e4268a..b382d9be580 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -825,6 +825,16 @@ tryAgain:
case Stmt::ContinueStmtClass:
return VisitContinueStmt(cast<ContinueStmt>(S));
+
+ case Stmt::CStyleCastExprClass: {
+ CastExpr *castExpr = cast<CastExpr>(S);
+ if (castExpr->getCastKind() == CK_LValueToRValue) {
+ // temporary workaround
+ S = castExpr->getSubExpr();
+ goto tryAgain;
+ }
+ return VisitStmt(S, asc);
+ }
case Stmt::CXXCatchStmtClass:
return VisitCXXCatchStmt(cast<CXXCatchStmt>(S));
@@ -871,8 +881,15 @@ tryAgain:
case Stmt::IfStmtClass:
return VisitIfStmt(cast<IfStmt>(S));
- case Stmt::ImplicitCastExprClass:
- return VisitImplicitCastExpr(cast<ImplicitCastExpr>(S), asc);
+ case Stmt::ImplicitCastExprClass: {
+ ImplicitCastExpr *castExpr = cast<ImplicitCastExpr>(S);
+ if (castExpr->getCastKind() == CK_LValueToRValue) {
+ // temporary workaround
+ S = castExpr->getSubExpr();
+ goto tryAgain;
+ }
+ return VisitImplicitCastExpr(castExpr, asc);
+ }
case Stmt::IndirectGotoStmtClass:
return VisitIndirectGotoStmt(cast<IndirectGotoStmt>(S));
OpenPOWER on IntegriCloud