[LLVMdev] Structure memory layout

Jin Gu Kang jaykang10 at imrc.kist.re.kr
Tue Oct 19 22:22:54 PDT 2010


Hi renato,

First, I really appreciate your answer. :)

The IR in an previous e-mail is incomplete so far and
I am converting it to various shape.

My team members decided to add new types to solve the bitfield's alignment problem.

Let's consider your previous examples:

struct testChar { char a:3;  char b:4;  char c:3;  char d:2; };
struct testShort { short a:3;  short b:4;  short c:3;  short d:2; };
struct testInt { int a:3;  int b:4;  int c:3;  int d:2; };

In future, our IRs will be represented as following:

%Char = type { c3, c4, c3, c2 }
%Short = type { s3, s4, s3, s2 }
%Int = type { i3, i4, i3, i2 }

This was just concept and I didn't implement it yet.

I usually try to modify original llvm system as less as possible,
so I prefer adding new types to modifying original llvm types.

I will report your opinion to my team members and we will discuss that.

Thanks for your answer,
Jin-Gu Kang



More information about the llvm-dev mailing list