@@ -1013,7 +1013,7 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
1013
1013
1014
1014
// Prints the same analysis as dump(), but its definition is not dependent
1015
1015
// on the build.
1016
- void print ();
1016
+ void print (raw_ostream &OS );
1017
1017
1018
1018
Optional<InstructionCostDetail> getCostDetails (const Instruction *I) {
1019
1019
if (InstructionCostDetailMap.find (I) != InstructionCostDetailMap.end ())
@@ -2711,10 +2711,10 @@ InlineResult CallAnalyzer::analyze() {
2711
2711
return finalizeAnalysis ();
2712
2712
}
2713
2713
2714
- void InlineCostCallAnalyzer::print () {
2715
- #define DEBUG_PRINT_STAT (x ) dbgs() << " " #x " : " << x << " \n "
2714
+ void InlineCostCallAnalyzer::print (raw_ostream &OS ) {
2715
+ #define DEBUG_PRINT_STAT (x ) OS << " " #x " : " << x << " \n "
2716
2716
if (PrintInstructionComments)
2717
- F.print (dbgs () , &Writer);
2717
+ F.print (OS , &Writer);
2718
2718
DEBUG_PRINT_STAT (NumConstantArgs);
2719
2719
DEBUG_PRINT_STAT (NumConstantOffsetPtrArgs);
2720
2720
DEBUG_PRINT_STAT (NumAllocaArgs);
@@ -2733,7 +2733,7 @@ void InlineCostCallAnalyzer::print() {
2733
2733
2734
2734
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
2735
2735
// / Dump stats about this call's analysis.
2736
- LLVM_DUMP_METHOD void InlineCostCallAnalyzer::dump () { print (); }
2736
+ LLVM_DUMP_METHOD void InlineCostCallAnalyzer::dump () { print (dbgs () ); }
2737
2737
#endif
2738
2738
2739
2739
// / Test that there are no attribute conflicts between Caller and Callee
@@ -3127,7 +3127,8 @@ InlineCostAnnotationPrinterPass::run(Function &F,
3127
3127
ICCA.analyze ();
3128
3128
OS << " Analyzing call of " << CalledFunction->getName ()
3129
3129
<< " ... (caller:" << CI->getCaller ()->getName () << " )\n " ;
3130
- ICCA.print ();
3130
+ ICCA.print (OS);
3131
+ OS << " \n " ;
3131
3132
}
3132
3133
}
3133
3134
}
0 commit comments