Finally fix PR2189. This makes a fairly invasive but important change to

move getAsArrayType into ASTContext instead of being a method on type.
This is required because getAsArrayType(const AT), where AT is a typedef
for "int[10]" needs to return ArrayType(const int, 10).

Fixing this greatly simplifies getArrayDecayedType, which is a good sign.

llvm-svn: 54317
This commit is contained in:
Chris Lattner
2008-08-04 07:31:14 +00:00
parent a01ede2f11
commit 7adf076088
14 changed files with 264 additions and 236 deletions

View File

@@ -632,7 +632,8 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
// FIXME: This is silly; getTypeAlign should just work for incomplete arrays
unsigned Align;
if (const IncompleteArrayType* IAT = D->getType()->getAsIncompleteArrayType())
if (const IncompleteArrayType* IAT =
Context.getAsIncompleteArrayType(D->getType()))
Align = Context.getTypeAlign(IAT->getElementType());
else
Align = Context.getTypeAlign(D->getType());