HomePhabricator

Fix a "memset clearing an object of non-trivial type" warning in…

Authored by labath on Mar 19 2019, 8:05 AM.

Description

Fix a "memset clearing an object of non-trivial type" warning in EmulateInstruction

This is a new warning which started appearing as of gcc-8. The Opcode
class has a non-trivial constructor, so the idea of the warning is that
code should use that to initialize the object instead of using memset
(which can perturb class invariants set up by the constructor). In this
case, the Opcode default constructor was already clearing the object's
fields so we can just drop the memset call.

While I'm touching the EmulateInstruction constructor, I also move the
initialization of other members into the class declaration.

llvm-svn: 356459

Details

Committed
labathMar 19 2019, 8:05 AM
Parents
rG165435ffa088: Ensure that const variables declared at namespace scope correctly have external…
Branches
Unknown
Tags
Unknown