summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2018-11-09 00:41:36 +0000
committerBill Wendling <isanbard@gmail.com>2018-11-09 00:41:36 +0000
commit8003edc9aa0160c777252b6ed8e96fc35f039bd4 (patch)
treed6a07c2e0b407f57baf6be744b81ef140079eb7d /clang/lib/CodeGen/CGExprAgg.cpp
parent009cc9b7cadc81b50127f14ccdb8ff10fccc1f00 (diff)
downloadbcm5719-llvm-8003edc9aa0160c777252b6ed8e96fc35f039bd4.tar.gz
bcm5719-llvm-8003edc9aa0160c777252b6ed8e96fc35f039bd4.zip
Compound literals, enums, et al require const expr
Summary: Compound literals, enums, file-scoped arrays, etc. require their initializers and size specifiers to be constant. Wrap the initializer expressions in a ConstantExpr so that we can easily check for this later on. Reviewers: rsmith, shafik Reviewed By: rsmith Subscribers: cfe-commits, jyknight, nickdesaulniers Differential Revision: https://reviews.llvm.org/D53921 llvm-svn: 346455
Diffstat (limited to 'clang/lib/CodeGen/CGExprAgg.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprAgg.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp
index 42481939fa1..db49b3f28a5 100644
--- a/clang/lib/CodeGen/CGExprAgg.cpp
+++ b/clang/lib/CodeGen/CGExprAgg.cpp
@@ -125,6 +125,10 @@ public:
return Visit(E->getReplacement());
}
+ void VisitConstantExpr(ConstantExpr *E) {
+ return Visit(E->getSubExpr());
+ }
+
// l-values.
void VisitDeclRefExpr(DeclRefExpr *E) { EmitAggLoadOfLValue(E); }
void VisitMemberExpr(MemberExpr *ME) { EmitAggLoadOfLValue(ME); }
OpenPOWER on IntegriCloud