Commit Graph

2 Commits

Author SHA1 Message Date
Matt Beaumont-Gay 35779955b3 Don't try to get the layout of an invalid decl in getDeclAlign.
When the decl that we're getting alignment for is a FieldDecl, and the field's
parent record is invalid, skip the actual field alignment calculation (and
return 1-byte alignment in the general case).

Also, assert in in getASTRecordLayout that the decl is valid. This was
inspired by PR16292; see also r184581 and r184751.

llvm-svn: 184883
2013-06-25 22:19:15 +00:00
John McCall 768439eb2e Require the containing type to be complete when we see
__alignof__ of a field.

This problem can only happen in C++11.

Also do some petty optimizations.

rdar://13784901

llvm-svn: 181185
2013-05-06 07:40:34 +00:00