aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGStmt.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2008-12-20 19:33:21 +0000
committerAnders Carlsson <andersca@mac.com>2008-12-20 19:33:21 +0000
commiteb91f0ecb420f481811f8812ac4d39087e8dd754 (patch)
treee532b195289cdcf539c661e4a971fc06e1d6994e /lib/CodeGen/CGStmt.cpp
parentadcaf544a9d863a4afb29cc5420095320fccafd8 (diff)
Add some ErrorUnsupported calls and turn on VLA codegen again.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61283 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGStmt.cpp')
-rw-r--r--lib/CodeGen/CGStmt.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index afce63d41d..6d8f5da015 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -220,6 +220,11 @@ void CodeGenFunction::EmitGotoStmt(const GotoStmt &S) {
return;
}
+ if (StackSaveValues.back()) {
+ CGM.ErrorUnsupported(&S, "goto inside scope with VLA");
+ return;
+ }
+
// If this code is reachable then emit a stop point (if generating
// debug info). We have to do this ourselves because we are on the
// "simple" statement path.
@@ -471,6 +476,11 @@ void CodeGenFunction::EmitReturnOfRValue(RValue RV, QualType Ty) {
/// if the function returns void, or may be missing one if the function returns
/// non-void. Fun stuff :).
void CodeGenFunction::EmitReturnStmt(const ReturnStmt &S) {
+ if (StackSaveValues.back()) {
+ CGM.ErrorUnsupported(&S, "return inside scope with VLA");
+ return;
+ }
+
// Emit the result value, even if unused, to evalute the side effects.
const Expr *RV = S.getRetValue();
@@ -514,10 +524,15 @@ void CodeGenFunction::EmitBreakStmt(const BreakStmt &S) {
// FIXME: Implement break in @try or @catch blocks.
if (ObjCEHStack.size() != BreakContinueStack.back().EHStackSize) {
- CGM.ErrorUnsupported(&S, "continue inside an Obj-C exception block");
+ CGM.ErrorUnsupported(&S, "break inside an Obj-C exception block");
return;
}
+ if (StackSaveValues.back()) {
+ CGM.ErrorUnsupported(&S, "break inside scope with VLA");
+ return;
+ }
+
// If this code is reachable then emit a stop point (if generating
// debug info). We have to do this ourselves because we are on the
// "simple" statement path.
@@ -536,6 +551,11 @@ void CodeGenFunction::EmitContinueStmt(const ContinueStmt &S) {
return;
}
+ if (StackSaveValues.back()) {
+ CGM.ErrorUnsupported(&S, "continue inside scope with VLA");
+ return;
+ }
+
// If this code is reachable then emit a stop point (if generating
// debug info). We have to do this ourselves because we are on the
// "simple" statement path.