diff options
author | Chris Lattner <sabre@nondot.org> | 2008-08-04 07:31:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-08-04 07:31:14 +0000 |
commit | 7adf07608847865d47fa50640c3b18007953c4aa (patch) | |
tree | 263f2ca4985a4e008e230fee9d2e6c4794075625 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | a01ede2f1105780926d58af04d0e4db09140221f (diff) | |
download | bcm5719-llvm-7adf07608847865d47fa50640c3b18007953c4aa.tar.gz bcm5719-llvm-7adf07608847865d47fa50640c3b18007953c4aa.zip |
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index b531616b13c..5d85b7a70f4 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -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()); |