aboutsummaryrefslogtreecommitdiff
path: root/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-12-02 07:32:25 +0000
committerChris Lattner <sabre@nondot.org>2007-12-02 07:32:25 +0000
commit9a64cf762ed9808b54d0c5be74ce4a47dcff4969 (patch)
treee87b10891d277c20f4dad86122cff15926da5ee5 /CodeGen/CodeGenModule.cpp
parent9615bf855ade12ca49e1a8767349d00ecf943b63 (diff)
globals can't be vla's
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44512 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CodeGenModule.cpp')
-rw-r--r--CodeGen/CodeGenModule.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/CodeGen/CodeGenModule.cpp b/CodeGen/CodeGenModule.cpp
index 97ff705a39..fdfb883c5e 100644
--- a/CodeGen/CodeGenModule.cpp
+++ b/CodeGen/CodeGenModule.cpp
@@ -372,8 +372,7 @@ static llvm::Constant *GenerateConstantExpr(const Expr *Expression,
// 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 @@ static llvm::Constant *GenerateConstantExpr(const Expr *Expression,
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};