llvm.org GIT mirror llvm / f6b6c37
Replace memcpys by a static_cast and an integral promotion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172108 91177308-0d34-0410-b5e6-96231b3b80d8 Dmitri Gribenko 7 years ago
1 changed file(s) with 4 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
784784 // Type of "flags" field varies depending on "kind" field.
785785 // Use memcpy here to avoid breaking strict aliasing rules.
786786 if (kf.kind == kindA) {
787 AFlags aflags;
788 memcpy(&aflags, &kf.flags, sizeof(aflags));
787 AFlags aflags = static_cast(kf.flags);
789788 io.mapRequired("flags", aflags);
790 memcpy(&kf.flags, &aflags, sizeof(kf.flags));
789 kf.flags = aflags;
791790 } else {
792 BFlags bflags;
793 memcpy(&bflags, &kf.flags, sizeof(bflags));
791 BFlags bflags = static_cast(kf.flags);
794792 io.mapRequired("flags", bflags);
795 memcpy(&kf.flags, &bflags, sizeof(kf.flags));
793 kf.flags = bflags;
796794 }
797795 }
798796 };