summaryrefslogtreecommitdiffstats
path: root/clang/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
commit0475c8178f7cc8d661b319afc6a40c88a7a1248d (patch)
treeb335d1e3f9bb49ab2e7c48d9b8fd130811ccf0cc /clang/CodeGen/CodeGenModule.cpp
parentd8d18d561e464a2ef70aaff5bd17897dd6d51ae3 (diff)
downloadbcm5719-llvm-0475c8178f7cc8d661b319afc6a40c88a7a1248d.tar.gz
bcm5719-llvm-0475c8178f7cc8d661b319afc6a40c88a7a1248d.zip
globals can't be vla's
llvm-svn: 44512
Diffstat (limited to 'clang/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/CodeGen/CodeGenModule.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/CodeGen/CodeGenModule.cpp b/clang/CodeGen/CodeGenModule.cpp
index 97ff705a39f..fdfb883c5ee 100644
--- a/clang/CodeGen/CodeGenModule.cpp
+++ b/clang/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};
OpenPOWER on IntegriCloud