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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user