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/CGStmtOpenMP.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp') diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index fb919d7b028..052ebcaf389 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -237,9 +237,10 @@ llvm::Value *CodeGenFunction::getTypeSize(QualType Ty) { if (SizeInChars.isZero()) { // getTypeSizeInChars() returns 0 for a VLA. while (auto *VAT = C.getAsVariableArrayType(Ty)) { - llvm::Value *ArraySize; - std::tie(ArraySize, Ty) = getVLASize(VAT); - Size = Size ? Builder.CreateNUWMul(Size, ArraySize) : ArraySize; + auto VlaSize = getVLASize(VAT); + Ty = VlaSize.Type; + Size = Size ? Builder.CreateNUWMul(Size, VlaSize.NumElts) + : VlaSize.NumElts; } SizeInChars = C.getTypeSizeInChars(Ty); if (SizeInChars.isZero()) -- cgit v1.2.3