diff options
| author | Nico Weber <thakis@chromium.org> | 2019-11-17 02:09:25 -0500 |
|---|---|---|
| committer | Nico Weber <thakis@chromium.org> | 2019-11-17 02:09:25 -0500 |
| commit | c9276fbfdf0c7caf1576b2db562286d7cec7e53b (patch) | |
| tree | b584cd30cae5f36372ed6fd48cb2cc4abec54dfa /clang/lib/AST/ExprConstant.cpp | |
| parent | cc6b85390170725d2341416af2b2ab8ea6c25d83 (diff) | |
| download | bcm5719-llvm-c9276fbfdf0c7caf1576b2db562286d7cec7e53b.tar.gz bcm5719-llvm-c9276fbfdf0c7caf1576b2db562286d7cec7e53b.zip | |
Revert "[NFC] Refactor representation of materialized temporaries"
This reverts commit 08ea1ee2db5f9d6460fef1d79d0d1d1a5eb78982.
It broke ./ClangdTests/FindExplicitReferencesTest.All
on the bots, see comments on https://reviews.llvm.org/D69360
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
| -rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 79659261388..f4ca2284224 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -107,7 +107,7 @@ namespace { dyn_cast<MaterializeTemporaryExpr>(Base)) { SmallVector<const Expr *, 2> CommaLHSs; SmallVector<SubobjectAdjustment, 2> Adjustments; - const Expr *Temp = MTE->getSubExpr(); + const Expr *Temp = MTE->GetTemporaryExpr(); const Expr *Inner = Temp->skipRValueSubobjectAdjustments(CommaLHSs, Adjustments); // Keep any cv-qualifiers from the reference if we generated a temporary @@ -2075,7 +2075,7 @@ static bool CheckLValueConstantExpression(EvalInfo &Info, SourceLocation Loc, return false; } - APValue *V = MTE->getOrCreateValue(false); + APValue *V = Info.Ctx.getMaterializedTemporaryValue(MTE, false); assert(V && "evasluation result refers to uninitialised temporary"); if (!CheckEvaluationResult(CheckEvaluationResultKind::ConstantExpression, Info, MTE->getExprLoc(), TempType, *V, @@ -3679,7 +3679,7 @@ static CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, return CompleteObject(); } - BaseVal = MTE->getOrCreateValue(false); + BaseVal = Info.Ctx.getMaterializedTemporaryValue(MTE, false); assert(BaseVal && "got reference to unevaluated temporary"); } else { if (!IsAccess) @@ -7470,8 +7470,8 @@ bool LValueExprEvaluator::VisitMaterializeTemporaryExpr( // Walk through the expression to find the materialized temporary itself. SmallVector<const Expr *, 2> CommaLHSs; SmallVector<SubobjectAdjustment, 2> Adjustments; - const Expr *Inner = - E->getSubExpr()->skipRValueSubobjectAdjustments(CommaLHSs, Adjustments); + const Expr *Inner = E->GetTemporaryExpr()-> + skipRValueSubobjectAdjustments(CommaLHSs, Adjustments); // If we passed any comma operators, evaluate their LHSs. for (unsigned I = 0, N = CommaLHSs.size(); I != N; ++I) @@ -7483,7 +7483,7 @@ bool LValueExprEvaluator::VisitMaterializeTemporaryExpr( // value for use outside this evaluation. APValue *Value; if (E->getStorageDuration() == SD_Static) { - Value = E->getOrCreateValue(true); + Value = Info.Ctx.getMaterializedTemporaryValue(E, true); *Value = APValue(); Result.set(E); } else { @@ -9031,7 +9031,7 @@ bool RecordExprEvaluator::VisitCXXConstructExpr(const CXXConstructExpr *E, if (E->isElidable() && !ZeroInit) if (const MaterializeTemporaryExpr *ME = dyn_cast<MaterializeTemporaryExpr>(E->getArg(0))) - return Visit(ME->getSubExpr()); + return Visit(ME->GetTemporaryExpr()); if (ZeroInit && !ZeroInitialization(E, T)) return false; |

