@@ -123,17 +123,10 @@ namespace clang {
123123extern llvm::cl::opt<bool > ClSanitizeGuardChecks;
124124}
125125
126- // Default filename used for profile generation.
127- static std::string getDefaultProfileGenName () {
128- return DebugInfoCorrelate || ProfileCorrelate != InstrProfCorrelator::NONE
129- ? " default_%m.proflite"
130- : " default_%m.profraw" ;
131- }
132-
133126// Path and name of file used for profile generation
134127static std::string getProfileGenName (const CodeGenOptions &CodeGenOpts) {
135128 std::string FileName = CodeGenOpts.InstrProfileOutput .empty ()
136- ? getDefaultProfileGenName ()
129+ ? llvm::driver:: getDefaultProfileGenName ()
137130 : CodeGenOpts.InstrProfileOutput ;
138131 if (CodeGenOpts.ContinuousProfileSync )
139132 FileName = " %c" + FileName;
@@ -835,44 +828,45 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
835828
836829 if (CodeGenOpts.hasProfileIRInstr ())
837830 // -fprofile-generate.
838- PGOOpt = PGOOptions (getProfileGenName (CodeGenOpts), " " , " " ,
839- CodeGenOpts. MemoryProfileUsePath , nullptr ,
840- PGOOptions::IRInstr , PGOOptions::NoCSAction ,
841- ClPGOColdFuncAttr, CodeGenOpts. DebugInfoForProfiling ,
842- /* PseudoProbeForProfiling= */ false ,
843- CodeGenOpts.AtomicProfileUpdate );
831+ PGOOpt = PGOOptions (
832+ getProfileGenName ( CodeGenOpts), " " , " " ,
833+ CodeGenOpts. MemoryProfileUsePath , nullptr , PGOOptions::IRInstr ,
834+ PGOOptions::NoCSAction, llvm::ClPGOColdFuncAttr ,
835+ CodeGenOpts. DebugInfoForProfiling ,
836+ /* PseudoProbeForProfiling= */ false , CodeGenOpts.AtomicProfileUpdate );
844837 else if (CodeGenOpts.hasProfileIRUse ()) {
845838 // -fprofile-use.
846839 auto CSAction = CodeGenOpts.hasProfileCSIRUse () ? PGOOptions::CSIRUse
847840 : PGOOptions::NoCSAction;
848841 PGOOpt = PGOOptions (CodeGenOpts.ProfileInstrumentUsePath , " " ,
849842 CodeGenOpts.ProfileRemappingFile ,
850843 CodeGenOpts.MemoryProfileUsePath , VFS,
851- PGOOptions::IRUse, CSAction, ClPGOColdFuncAttr,
844+ PGOOptions::IRUse, CSAction, llvm:: ClPGOColdFuncAttr,
852845 CodeGenOpts.DebugInfoForProfiling );
853846 } else if (!CodeGenOpts.SampleProfileFile .empty ())
854847 // -fprofile-sample-use
855848 PGOOpt = PGOOptions (
856849 CodeGenOpts.SampleProfileFile , " " , CodeGenOpts.ProfileRemappingFile ,
857850 CodeGenOpts.MemoryProfileUsePath , VFS, PGOOptions::SampleUse,
858- PGOOptions::NoCSAction, ClPGOColdFuncAttr,
851+ PGOOptions::NoCSAction, llvm:: ClPGOColdFuncAttr,
859852 CodeGenOpts.DebugInfoForProfiling , CodeGenOpts.PseudoProbeForProfiling );
860853 else if (!CodeGenOpts.MemoryProfileUsePath .empty ())
861854 // -fmemory-profile-use (without any of the above options)
862- PGOOpt = PGOOptions (" " , " " , " " , CodeGenOpts.MemoryProfileUsePath , VFS,
863- PGOOptions::NoAction, PGOOptions::NoCSAction,
864- ClPGOColdFuncAttr, CodeGenOpts.DebugInfoForProfiling );
865- else if (CodeGenOpts.PseudoProbeForProfiling )
866- // -fpseudo-probe-for-profiling
867855 PGOOpt =
868- PGOOptions (" " , " " , " " , /* MemoryProfile= */ " " , nullptr ,
856+ PGOOptions (" " , " " , " " , CodeGenOpts. MemoryProfileUsePath , VFS ,
869857 PGOOptions::NoAction, PGOOptions::NoCSAction,
870- ClPGOColdFuncAttr, CodeGenOpts.DebugInfoForProfiling , true );
858+ llvm::ClPGOColdFuncAttr, CodeGenOpts.DebugInfoForProfiling );
859+ else if (CodeGenOpts.PseudoProbeForProfiling )
860+ // -fpseudo-probe-for-profiling
861+ PGOOpt = PGOOptions (" " , " " , " " , /* MemoryProfile=*/ " " , nullptr ,
862+ PGOOptions::NoAction, PGOOptions::NoCSAction,
863+ llvm::ClPGOColdFuncAttr,
864+ CodeGenOpts.DebugInfoForProfiling , true );
871865 else if (CodeGenOpts.DebugInfoForProfiling )
872866 // -fdebug-info-for-profiling
873867 PGOOpt = PGOOptions (" " , " " , " " , /* MemoryProfile=*/ " " , nullptr ,
874868 PGOOptions::NoAction, PGOOptions::NoCSAction,
875- ClPGOColdFuncAttr, true );
869+ llvm:: ClPGOColdFuncAttr, true );
876870
877871 // Check to see if we want to generate a CS profile.
878872 if (CodeGenOpts.hasProfileCSIRInstr ()) {
0 commit comments