[NFC] Improve clarity in emitInstrCountChangedRemark

Add a "CouldOnlyImpactOneFunction" bool that's true when we pass in a function.

Just cleaning up a little bit, since I'm going to add in the per-function
remarks soon from D51467.

llvm-svn: 341407
This commit is contained in:
Jessica Paquette 2018-09-04 21:03:43 +00:00
parent fd458fe205
commit 31d2e5e546
1 changed files with 4 additions and 1 deletions

View File

@ -152,8 +152,11 @@ void PMDataManager::emitInstrCountChangedRemark(Pass *P, Module &M,
if (P->getAsPMDataManager()) if (P->getAsPMDataManager())
return; return;
// Set to true if this isn't a module pass or CGSCC pass.
bool CouldOnlyImpactOneFunction = (F != nullptr);
// Do we have a function we can use to emit a remark? // Do we have a function we can use to emit a remark?
if (F == nullptr) { if (!CouldOnlyImpactOneFunction) {
// We need a function containing at least one basic block in order to output // We need a function containing at least one basic block in order to output
// remarks. Since it's possible that the first function in the module // remarks. Since it's possible that the first function in the module
// doesn't actually contain a basic block, we have to go and find one that's // doesn't actually contain a basic block, we have to go and find one that's