diff options
author | Chris Lattner <sabre@nondot.org> | 2011-07-12 06:52:18 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-07-12 06:52:18 +0000 |
commit | 3f32d69699fb2571d62bf59dc8210b66384ab6d5 (patch) | |
tree | 664d33f7adcb11bd7470890005572a3882580a99 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | d59d867ca59da0b59438177a2625c05bb30b9977 (diff) | |
download | bcm5719-llvm-3f32d69699fb2571d62bf59dc8210b66384ab6d5.tar.gz bcm5719-llvm-3f32d69699fb2571d62bf59dc8210b66384ab6d5.zip |
Fix a problem Eli ran into where we now reject incomplete arrays of
uncompleted struct types. We now do what llvm-gcc does and compile
them into [i8 x 0]. If the type is later completed, we make sure that
it is appropriately cast.
We compile the terrible example to something like this now:
%struct.A = type { i32, i32, i32 }
@g = external global [0 x i8]
define void @_Z1fv() nounwind {
entry:
call void @_Z3fooP1A(%struct.A* bitcast ([0 x i8]* @g to %struct.A*))
ret void
}
declare void @_Z3fooP1A(%struct.A*)
define %struct.A* @_Z2f2v() nounwind {
entry:
ret %struct.A* getelementptr inbounds ([0 x %struct.A]* bitcast ([0 x i8]* @g to [0 x %struct.A]*), i32 0, i64 1)
}
llvm-svn: 134972
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions