From 891af03a55d87939f78740ffdf2e318d301384cf Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Sat, 3 Feb 2018 13:55:59 +0000 Subject: Recommit rL323952: [DebugInfo] Enable debug information for C99 VLA types. Fixed build issue when building with g++-4.8 (specialization after instantiation). llvm-svn: 324173 --- clang/lib/CodeGen/CGExpr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/lib/CodeGen/CGExpr.cpp') diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 73354cdf854..d8fc270b654 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -873,7 +873,7 @@ static llvm::Value *getArrayIndexingBound( if (const auto *CAT = dyn_cast(AT)) return CGF.Builder.getInt(CAT->getSize()); else if (const auto *VAT = dyn_cast(AT)) - return CGF.getVLASize(VAT).first; + return CGF.getVLASize(VAT).NumElts; // Ignore pass_object_size here. It's not applicable on decayed pointers. } } @@ -3313,7 +3313,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E, auto *Idx = EmitIdxAfterBase(/*Promote*/true); // The element count here is the total number of non-VLA elements. - llvm::Value *numElements = getVLASize(vla).first; + llvm::Value *numElements = getVLASize(vla).NumElts; // Effectively, the multiply by the VLA size is part of the GEP. // GEP indexes are signed, and scaling an index isn't permitted to @@ -3547,7 +3547,7 @@ LValue CodeGenFunction::EmitOMPArraySectionExpr(const OMPArraySectionExpr *E, emitOMPArraySectionBase(*this, E->getBase(), BaseInfo, TBAAInfo, BaseTy, VLA->getElementType(), IsLowerBound); // The element count here is the total number of non-VLA elements. - llvm::Value *NumElements = getVLASize(VLA).first; + llvm::Value *NumElements = getVLASize(VLA).NumElts; // Effectively, the multiply by the VLA size is part of the GEP. // GEP indexes are signed, and scaling an index isn't permitted to -- cgit v1.2.3