[randstruct] Randomize all elements of a record
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; }; Link: https://github.com/KSPP/linux/issues/185 Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D123958
Loading
Please sign in to comment