Fix coding style

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172107 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dmitri Gribenko 2013-01-10 21:10:44 +00:00
parent ff5ed5e2b4
commit 197616adda

View File

@ -782,16 +782,14 @@ namespace yaml {
struct MappingTraits<KindAndFlags> {
static void mapping(IO &io, KindAndFlags& kf) {
io.mapRequired("kind", kf.kind);
// type of flags field varies depending on kind field
// Type of "flags" field varies depending on "kind" field.
// Use memcpy here to avoid breaking strict aliasing rules.
if ( kf.kind == kindA ) {
if (kf.kind == kindA) {
AFlags aflags;
memcpy(&aflags, &kf.flags, sizeof(aflags));
io.mapRequired("flags", aflags);
memcpy(&kf.flags, &aflags, sizeof(kf.flags));
}
else {
} else {
BFlags bflags;
memcpy(&bflags, &kf.flags, sizeof(bflags));
io.mapRequired("flags", bflags);