[cfe-commits] r46859 - in /cfe/trunk: CodeGen/CGExpr.cpp CodeGen/CodeGenTypes.cpp test/CodeGen/bitfield.c
Eli Friedman
eli.friedman at gmail.com
Fri Feb 8 19:15:08 PST 2008
On Feb 8, 2008 12:02 PM, Lauro Ramos Venancio <lauro.venancio at gmail.com> wrote:
> Nowadays, I think we should change the placeBitfield function
> (CodeGenType.cpp) to provide more information making easier to
> implement bitfield initializer.
Okay. Ideally, what I would need is, for every declared field in a
bitfield, something like the following:
struct BitFieldPiece {
unsigned LLVMFieldNo;
unsigned StartBit;
unsigned EndBit;
}
typedef std::vector<BitFieldPiece> BitFieldLayoutData;
This data makes the initializers relatively easy to implement, and
avoids any dependency on platform-specific bitfield layout rules, no
matter how strange they are. (I don't know how strange the rules can
get, though, so I'm not sure if this much generality is needed.)
-Eli
More information about the cfe-commits
mailing list