[cfe-commits] r100080 - in /cfe/trunk/lib/Checker: AggExprVisitor.cpp GRExprEngine.cpp

Zhongxing Xu xuzhongxing at gmail.com
Wed Mar 31 20:47:27 PDT 2010


Author: zhongxingxu
Date: Wed Mar 31 22:47:27 2010
New Revision: 100080

URL: http://llvm.org/viewvc/llvm-project?rev=100080&view=rev
Log:
Improve C++ constructor handling.

Modified:
    cfe/trunk/lib/Checker/AggExprVisitor.cpp
    cfe/trunk/lib/Checker/GRExprEngine.cpp

Modified: cfe/trunk/lib/Checker/AggExprVisitor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/AggExprVisitor.cpp?rev=100080&r1=100079&r2=100080&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/AggExprVisitor.cpp (original)
+++ cfe/trunk/lib/Checker/AggExprVisitor.cpp Wed Mar 31 22:47:27 2010
@@ -38,6 +38,7 @@
   switch (E->getCastKind()) {
   default: 
     assert(0 && "Unhandled cast kind");
+  case CastExpr::CK_NoOp:
   case CastExpr::CK_ConstructorConversion:
     Visit(E->getSubExpr());
     break;

Modified: cfe/trunk/lib/Checker/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRExprEngine.cpp?rev=100080&r1=100079&r2=100080&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Checker/GRExprEngine.cpp Wed Mar 31 22:47:27 2010
@@ -2363,8 +2363,10 @@
   ExplodedNodeSet Tmp;
 
   if (InitEx) {
-    if (const CXXConstructExpr *E = dyn_cast<CXXConstructExpr>(InitEx)) {
-      VisitCXXConstructExpr(E, GetState(Pred)->getLValue(VD,
+    QualType InitTy = InitEx->getType();
+    if (getContext().getLangOptions().CPlusPlus && InitTy->isRecordType()) {
+      // Delegate expressions of C++ record type evaluation to AggExprVisitor.
+      VisitAggExpr(InitEx, GetState(Pred)->getLValue(VD,
                                        Pred->getLocationContext()), Pred, Dst);
       return;
     } else if (VD->getType()->isReferenceType())





More information about the cfe-commits mailing list