Fix typo in size remarks for module passes
authorJessica Paquette <jpaquette@apple.com>
Fri, 31 Aug 2018 22:43:41 +0000 (22:43 +0000)
committerJessica Paquette <jpaquette@apple.com>
Fri, 31 Aug 2018 22:43:41 +0000 (22:43 +0000)
commita69696dca625cf9aed22988bd1c0d56a752221f6
treee77f96e6a11a943678c5be44098cd091a36a8bca
parent44451b3344bfba2b8566b92f7ccc445b68bccbd5
Fix typo in size remarks for module passes

ModuleCount = InstrCount was incorrect. It should have been
InstrCount = ModuleCount. This was making it emit an extra, incorrect remark
for Print Module IR.

The test didn't catch this, because it didn't ensure that the only remark
output was from the desired pass. So, it was possible to have an extra remark
come through and not fail. Updated the test so that we ensure that the last
remark that's output comes from the desired pass. This is done by ensuring
that whatever is being read after the last remark is YAML output rather than
some incorrect garbage.

llvm-svn: 341267
llvm/lib/IR/LegacyPassManager.cpp
llvm/test/Other/size-remarks.ll