diff options
author | Bill Wendling <isanbard@gmail.com> | 2018-10-31 03:48:47 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2018-10-31 03:48:47 +0000 |
commit | 0680f97fc4904c486a8b6a66928b329d3d7cd65c (patch) | |
tree | 2bd642a2abfaa066932a214bd1176e4f56afb6aa /lib/Sema/SemaInit.cpp | |
parent | 3b778bc3cec73f904457d70d6f956e1aafe1b550 (diff) | |
download | clang-0680f97fc4904c486a8b6a66928b329d3d7cd65c.tar.gz |
Create ConstantExpr class
A ConstantExpr class represents a full expression that's in a context where a
constant expression is required. This class reflects the path the evaluator
took to reach the expression rather than the syntactic context in which the
expression occurs.
In the future, the class will be expanded to cache the result of the evaluated
expression so that it's not needlessly re-evaluated
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D53475
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345692 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index f4687fe818..0cfac99719 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -6510,8 +6510,8 @@ static void visitLocalsRetainedByReferenceBinding(IndirectLocalPath &Path, do { Old = Init; - if (auto *EWC = dyn_cast<ExprWithCleanups>(Init)) - Init = EWC->getSubExpr(); + if (auto *FE = dyn_cast<FullExpr>(Init)) + Init = FE->getSubExpr(); if (InitListExpr *ILE = dyn_cast<InitListExpr>(Init)) { // If this is just redundant braces around an initializer, step over it. @@ -6634,8 +6634,8 @@ static void visitLocalsRetainedByInitializer(IndirectLocalPath &Path, Init = DIE->getExpr(); } - if (auto *EWC = dyn_cast<ExprWithCleanups>(Init)) - Init = EWC->getSubExpr(); + if (auto *FE = dyn_cast<FullExpr>(Init)) + Init = FE->getSubExpr(); // Dig out the expression which constructs the extended temporary. Init = const_cast<Expr *>(Init->skipRValueSubobjectAdjustments()); |