summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
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
commit6200f0c533e8541d821d2cad3ede28c700cf788f (patch)
tree0034776ec56531777ce24b30654af562735f1d07 /clang/lib/CodeGen
parent7acf0749d45584f0984e174c763505920faebcf9 (diff)
downloadbcm5719-llvm-6200f0c533e8541d821d2cad3ede28c700cf788f.tar.gz
bcm5719-llvm-6200f0c533e8541d821d2cad3ede28c700cf788f.zip
Add some ErrorUnsupported calls and turn on VLA codegen again.
llvm-svn: 61283
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp9
-rw-r--r--clang/lib/CodeGen/CGStmt.cpp22
2 files changed, 21 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 1c72ba12280..62684bae496 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -160,15 +160,6 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) {
D.getStorageClass() == VarDecl::Register ? ".reg." : ".auto.";
DeclPtr = GenerateStaticBlockVarDecl(D, true, Class);
}
- } else if (1) {
- // FIXME: The code below is disabled because is causes a regression in the
- // testsuite.
- CGM.ErrorUnsupported(&D, "variable-length array");
-
- const llvm::Type *LTy = ConvertType(Ty);
- llvm::AllocaInst *Alloc =
- CreateTempAlloca(LTy, D.getIdentifier()->getName());
- DeclPtr = Alloc;
} else {
const VariableArrayType *VAT = getContext().getAsVariableArrayType(Ty);
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp
index afce63d41d8..6d8f5da015c 100644
--- a/clang/lib/CodeGen/CGStmt.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud