[cfe-commits] r72034 - /cfe/trunk/lib/CodeGen/CGDecl.cpp

Anders Carlsson andersca at mac.com
Mon May 18 12:55:33 PDT 2009


Author: andersca
Date: Mon May 18 14:55:29 2009
New Revision: 72034

URL: http://llvm.org/viewvc/llvm-project?rev=72034&view=rev
Log:
Since we miscompile many cases when declaring a variable with a reference type, make them unsupported for now.

Modified:
    cfe/trunk/lib/CodeGen/CGDecl.cpp

Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=72034&r1=72033&r2=72034&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Mon May 18 14:55:29 2009
@@ -126,6 +126,11 @@
   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 @@
       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;





More information about the cfe-commits mailing list