[cfe-commits] r61288 - /cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
Anders Carlsson
andersca at mac.com
Sat Dec 20 13:28:44 PST 2008
Author: andersca
Date: Sat Dec 20 15:28:43 2008
New Revision: 61288
URL: http://llvm.org/viewvc/llvm-project?rev=61288&view=rev
Log:
Make sure to generate code for arguments that have a variably modified type.
Modified:
cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=61288&r1=61287&r2=61288&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Sat Dec 20 15:28:43 2008
@@ -131,6 +131,16 @@
}
EmitFunctionProlog(CurFn, FnRetTy, Args);
+
+ // If any of the arguments have a variably modified type, make sure to
+ // emit the type size.
+ for (FunctionArgList::const_iterator i = Args.begin(), e = Args.end();
+ i != e; ++i) {
+ QualType Ty = i->second;
+
+ if (Ty->isVariablyModifiedType())
+ EmitVLASize(Ty);
+ }
}
void CodeGenFunction::GenerateCode(const FunctionDecl *FD,
More information about the cfe-commits
mailing list