-sil-print-all (et al.) should print specialized functions when they are created.

This commit is contained in:
Andrew Trick
2018-02-08 11:27:46 -08:00
parent af67204b51
commit 3a15cee084
3 changed files with 25 additions and 0 deletions

View File

@@ -283,6 +283,16 @@ static bool breakBeforeRunning(StringRef fnName, SILFunctionTransform *SFT) {
&& (SFT->getID() == SILBreakOnPass || SFT->getTag() == SILBreakOnPass);
}
void SILPassManager::dumpPassInfo(const char *Title, SILTransform *Tr,
SILFunction *F) {
llvm::dbgs() << " " << Title << " #" << NumPassesRun << ", stage "
<< StageName << ", pass : " << Tr->getID()
<< " (" << Tr->getTag() << ")";
if (F)
llvm::dbgs() << ", Function: " << F->getName();
llvm::dbgs() << '\n';
}
void SILPassManager::dumpPassInfo(const char *Title, unsigned TransIdx,
SILFunction *F) {
SILTransform *Tr = Transformations[TransIdx];
@@ -541,6 +551,13 @@ SILPassManager::~SILPassManager() {
}
}
void SILPassManager::notifyOfNewFunction(SILFunction *F, SILTransform *T) {
if (doPrintAfter(T, F, SILPrintAll)) {
dumpPassInfo("*** New SIL function in ", T, F);
F->dump(getOptions().EmitVerboseSIL);
}
}
void SILPassManager::addFunctionToWorklist(SILFunction *F,
SILFunction *DerivedFrom) {
assert(F && F->isDefinition() && (isMandatoryPipeline || F->shouldOptimize())