[AVR] Fix reads of uninitialized variables from constructor of AVRSubtarget
authorDylan McKay <me@dylanmckay.io>
Thu, 12 Mar 2020 11:51:30 +0000 (00:51 +1300)
committerDylan McKay <me@dylanmckay.io>
Thu, 12 Mar 2020 11:57:19 +0000 (00:57 +1300)
commit2cf4b4de0c7b290bc52843d3aecc23ff496a8729
tree6eaa621c12c698c8218f2497a13c4ca478c729a4
parentd5edcb90643104d6911da5c0ff44c4f33fff992f
[AVR] Fix reads of uninitialized variables from constructor of AVRSubtarget

The initialization order was not correct. These bugs were discovered by
valgrind. They appear to work fine in practice but this patch should
unblock switching the AVR backend on by default as now a standard AVR
llc invocation runs without memory errors.

The AVRISelLowering constructor would run before the subtarget boolean
fields were initialized to false. Now, the initialization order is
correct.
llvm/lib/Target/AVR/AVRSubtarget.cpp
llvm/lib/Target/AVR/AVRSubtarget.h