|
|
|
|
|
by Dylan16807
2601 days ago
|
|
Lots of mainstream compilers already have passes that check if every field in an object is definitely assigned. They use this to provide errors or warnings. That step is 90% of the work. Once you can do that, it's straightforward to assess that every field is assigned after a memset, with no intervening reads, and then remove the memset. |
|
I spent several years working on a production grade compiler and I can assure you it's not. But keep just making things up off the top of your head if it makes you feel smart.