diff options
author | Anders Carlsson <andersca@mac.com> | 2009-05-18 19:55:29 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-05-18 19:55:29 +0000 |
commit | 9b0276092336641907aebf4f8b7874314695632b (patch) | |
tree | 5be8a4382cf6445539cf798edd2d26b4268f8c51 /clang/lib/CodeGen/CGDecl.cpp | |
parent | 8dd294769632647d69d3f13055a9a4c4a2e34982 (diff) | |
download | bcm5719-llvm-9b0276092336641907aebf4f8b7874314695632b.tar.gz bcm5719-llvm-9b0276092336641907aebf4f8b7874314695632b.zip |
Since we miscompile many cases when declaring a variable with a reference type, make them unsupported for now.
llvm-svn: 72034
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index 9de722e19d1..e0ceaf6a2a9 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -126,6 +126,11 @@ void CodeGenFunction::EmitStaticBlockVarDecl(const VarDecl &D) { if (D.getType()->isVariablyModifiedType()) EmitVLASize(D.getType()); + if (D.getType()->isReferenceType()) { + CGM.ErrorUnsupported(&D, "static declaration with reference type"); + return; + } + if (D.getInit()) { llvm::Constant *Init = CGM.EmitConstantExpr(D.getInit(), D.getType(), this); @@ -324,6 +329,11 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) { DI->EmitDeclareOfAutoVariable(&D, DeclPtr, Builder); } + if (D.getType()->isReferenceType()) { + CGM.ErrorUnsupported(&D, "declaration with reference type"); + return; + } + // If this local has an initializer, emit it now. if (const Expr *Init = D.getInit()) { llvm::Value *Loc = DeclPtr; |