Changeset View
Changeset View
Standalone View
Standalone View
lib/Analysis/CFG.cpp
Show First 20 Lines • Show All 1,533 Lines • ▼ Show 20 Lines | if (const MaterializeTemporaryExpr *MTE | ||||
if (FoundMTE) | if (FoundMTE) | ||||
*FoundMTE = true; | *FoundMTE = true; | ||||
continue; | continue; | ||||
} | } | ||||
// Skip sub-object accesses into rvalues. | // Skip sub-object accesses into rvalues. | ||||
SmallVector<const Expr *, 2> CommaLHSs; | SmallVector<const Expr *, 2> CommaLHSs; | ||||
SmallVector<SubobjectAdjustment, 2> Adjustments; | SmallVector<SubobjectAdjustment, 2> Adjustments; | ||||
const Expr *SkippedInit = | SmallVector<const CastExpr *, 2> SkippedCasts; | ||||
Init->skipRValueSubobjectAdjustments(CommaLHSs, Adjustments); | const Expr *SkippedInit = Init->skipRValueSubobjectAdjustments( | ||||
CommaLHSs, Adjustments, SkippedCasts); | |||||
if (SkippedInit != Init) { | if (SkippedInit != Init) { | ||||
Init = SkippedInit; | Init = SkippedInit; | ||||
continue; | continue; | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 2,827 Lines • ▼ Show 20 Lines | case Stmt::ParenExprClass: | ||||
E = cast<ParenExpr>(E)->getSubExpr(); | E = cast<ParenExpr>(E)->getSubExpr(); | ||||
goto tryAgain; | goto tryAgain; | ||||
case Stmt::MaterializeTemporaryExprClass: { | case Stmt::MaterializeTemporaryExprClass: { | ||||
const MaterializeTemporaryExpr* MTE = cast<MaterializeTemporaryExpr>(E); | const MaterializeTemporaryExpr* MTE = cast<MaterializeTemporaryExpr>(E); | ||||
BindToTemporary = (MTE->getStorageDuration() != SD_FullExpression); | BindToTemporary = (MTE->getStorageDuration() != SD_FullExpression); | ||||
SmallVector<const Expr *, 2> CommaLHSs; | SmallVector<const Expr *, 2> CommaLHSs; | ||||
SmallVector<SubobjectAdjustment, 2> Adjustments; | SmallVector<SubobjectAdjustment, 2> Adjustments; | ||||
SmallVector<const CastExpr *, 2> SkippedCasts; | |||||
// Find the expression whose lifetime needs to be extended. | // Find the expression whose lifetime needs to be extended. | ||||
E = const_cast<Expr *>( | E = const_cast<Expr *>(cast<MaterializeTemporaryExpr>(E) | ||||
cast<MaterializeTemporaryExpr>(E) | |||||
->GetTemporaryExpr() | ->GetTemporaryExpr() | ||||
->skipRValueSubobjectAdjustments(CommaLHSs, Adjustments)); | ->skipRValueSubobjectAdjustments( | ||||
CommaLHSs, Adjustments, SkippedCasts)); | |||||
// Visit the skipped comma operator left-hand sides for other temporaries. | // Visit the skipped comma operator left-hand sides for other temporaries. | ||||
for (const Expr *CommaLHS : CommaLHSs) { | for (const Expr *CommaLHS : CommaLHSs) { | ||||
VisitForTemporaryDtors(const_cast<Expr *>(CommaLHS), | VisitForTemporaryDtors(const_cast<Expr *>(CommaLHS), | ||||
/*BindToTemporary=*/false, Context); | /*BindToTemporary=*/false, Context); | ||||
} | } | ||||
goto tryAgain; | goto tryAgain; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,088 Lines • Show Last 20 Lines |