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 | 7c44da279e399d302a685c500e7f802f8adf9762 (patch) | |
tree | b43e1304d9b44f5e565b24b6b5e82b6a92fa9899 /clang/lib/CodeGen/CodeGenFunction.h | |
parent | 4ff6697b7e9f880a29fc2884d147c14d9b22df5d (diff) | |
download | bcm5719-llvm-7c44da279e399d302a685c500e7f802f8adf9762.tar.gz bcm5719-llvm-7c44da279e399d302a685c500e7f802f8adf9762.zip |
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
llvm-svn: 345692
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 262b8dc70bd..c73cef5d35c 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -3947,11 +3947,13 @@ public: void EmitSynthesizedCXXCopyCtor(Address Dest, Address Src, const Expr *Exp); - void enterFullExpression(const ExprWithCleanups *E) { - if (E->getNumObjects() == 0) return; + void enterFullExpression(const FullExpr *E) { + if (const auto *EWC = dyn_cast<ExprWithCleanups>(E)) + if (EWC->getNumObjects() == 0) + return; enterNonTrivialFullExpression(E); } - void enterNonTrivialFullExpression(const ExprWithCleanups *E); + void enterNonTrivialFullExpression(const FullExpr *E); void EmitCXXThrowExpr(const CXXThrowExpr *E, bool KeepInsertionPoint = true); |