[LLVMdev] PROPOSAL: IR representation of detailed struct assignment information

Krzysztof Parzyszek kparzysz at codeaurora.org
Thu Aug 30 13:30:51 PDT 2012


On 8/28/2012 12:22 AM, Chris Lattner wrote:
> Instead of implementing this, it would be a lot easier for clang to walk a type and produce a mask describing all the holes in a type, using a simple recursive algorithm (where union intersects the member "hole sets", finding that byte 3/4 of the union is a hole).
>
> Given this, it makes a lot more sense to explicitly model this hole set in an MDNode (e.g. by using a list of byte ranges?) instead of representing the holes with a null pointer constant of some IR type.

I guess I'm late to the party, but another possibility would be to model 
structure types as lists of members with their offsets from the 
beginning of the parent aggregate.  This would require extensive changes 
to LLVM, so I'm not sure if it's an option.


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation




More information about the llvm-dev mailing list