[cfe-commits] r44512 - /cfe/trunk/CodeGen/CodeGenModule.cpp

Chris Lattner sabre at nondot.org
Sat Dec 1 23:32:26 PST 2007


Author: lattner
Date: Sun Dec  2 01:32:25 2007
New Revision: 44512

URL: http://llvm.org/viewvc/llvm-project?rev=44512&view=rev
Log:
globals can't be vla's

Modified:
    cfe/trunk/CodeGen/CodeGenModule.cpp

Modified: cfe/trunk/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenModule.cpp?rev=44512&r1=44511&r2=44512&view=diff

==============================================================================
--- cfe/trunk/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenModule.cpp Sun Dec  2 01:32:25 2007
@@ -372,8 +372,7 @@
     // If this is due to array->pointer conversion, emit the array expression as
     // an l-value.
     if (ICExpr->getSubExpr()->getType()->isArrayType()) {
-      // FIXME: For now we assume that all source arrays map to LLVM arrays.
-      // This will not true when we add support for VLAs.
+      // Note that VLAs can't exist for global variables.
       // The only thing that can have array type like this is a
       // DeclRefExpr(FileVarDecl)?
       const DeclRefExpr *DRE = cast<DeclRefExpr>(ICExpr->getSubExpr());
@@ -381,8 +380,7 @@
       llvm::Constant *C = CGM.GetAddrOfFileVarDecl(FVD, false);
       assert(isa<llvm::PointerType>(C->getType()) &&
              isa<llvm::ArrayType>(cast<llvm::PointerType>(C->getType())
-                                  ->getElementType()) &&
-             "Doesn't support VLAs yet!");
+                                  ->getElementType()));
       llvm::Constant *Idx0 = llvm::ConstantInt::get(llvm::Type::Int32Ty, 0);
       
       llvm::Constant *Ops[] = {Idx0, Idx0};





More information about the cfe-commits mailing list