A record may have more than just FieldDecls in it. If so, then we're
likely to drop them if we only randomize the FieldDecls.
We need to be careful about anonymous structs/unions. Their fields are
made available in the RecordDecl as IndirectFieldDecls, which are listed
after the anonymous struct/union. The ordering doesn't appear to be
super important, however we place them unrandomized at the end of the
RecordDecl just in case. There's also the possiblity of
StaticAssertDecls. We also want those at the end.
All other non-FieldDecls we place at the top, just in case we get
something like:
struct foo { enum e { BORK }; enum e a; };
CA->isIncompleteArrayType() looks to be at the wrong spot. An incomplete array type is one of type IncompleteArrayType, which a ConstantArrayType is not. Are we missing test coverage, or does the hasFlexibleArrayMember() make it so that we just need to remove this check entirely?