[llvm-commits] llvm-gcc: take object size from target, not source, in VIEW_CONVERT_EXPR

Duncan Sands baldrick at free.fr
Thu Mar 8 04:35:29 PST 2007


VIEW_CONVERT_EXPR is sometimes used as a way of specifying the size of
an object when the size would otherwise be unknown.  In the (Ada)
testcase an array, the type of which involves placeholder expressions,
is view converted to an array type with length 2 (the compiler knows it
has length 2, but presumably considers it too hard to work out what value
should be substituted in the placeholder in order to get length 2 out,
so uses a VIEW_CONVERT_EXPR instead).  I think this can only happen for
lvalues, though I'm not completely sure.  This patch special cases
view conversion of aggregate lvalues, using the size of the target type
rather than the source type in the call to EmitAggregateCopy.

Ciao,

Duncan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vce.diff
Type: text/x-diff
Size: 2506 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070308/a5060be3/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vce-test.diff
Type: text/x-diff
Size: 389 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070308/a5060be3/attachment-0001.diff>


More information about the llvm-commits mailing list