]> granicus.if.org Git - clang/commit
Enhance the IR type lowering code to be much smarter about recursively lowering
authorChris Lattner <sabre@nondot.org>
Fri, 15 Jul 2011 05:16:14 +0000 (05:16 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 15 Jul 2011 05:16:14 +0000 (05:16 +0000)
commit71305cc81bd379ddb8aa0d49e268267383202ca9
treeb912e39d2731c71463cc506f52742562630c9c6b
parent91a5755ad73c5dc1dfb167e448fdd74e75a6df56
Enhance the IR type lowering code to be much smarter about recursively lowering
types.  Fore xample, we used to lower:

struct bar { int a; };
struct foo {
 void (*FP)(struct bar);
} G;

to:

%struct.foo = type { {}* }

since the function pointer would cause recursive translation of bar and
we didn't know if that would get us into trouble.  We are now smart enough
to know that it is fine, so we get this type instead:

%struct.foo = type { void (i32)* }

Codegen still needs to be prepared for uncooperative types at any place,
which is why I let the maximally uncooperative code sit around for awhile to
help shake out the bugs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135244 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGCall.cpp
lib/CodeGen/CodeGenTypes.cpp
lib/CodeGen/CodeGenTypes.h
test/CodeGen/struct-init.c