@@ -174,9 +174,7 @@ static cl::opt<std::string> WorkloadDefinitions(
174
174
" }" ),
175
175
cl::Hidden);
176
176
177
- static cl::opt<std::string>
178
- ContextualProfile (" thinlto-pgo-ctx-prof" ,
179
- cl::desc (" Path to a contextual profile." ), cl::Hidden);
177
+ extern cl::opt<std::string> UseCtxProfile;
180
178
181
179
namespace llvm {
182
180
extern cl::opt<bool > EnableMemProfContextDisambiguation;
@@ -671,7 +669,7 @@ class WorkloadImportsManager : public ModuleImportsManager {
671
669
672
670
void loadFromCtxProf () {
673
671
std::error_code EC;
674
- auto BufferOrErr = MemoryBuffer::getFileOrSTDIN (ContextualProfile );
672
+ auto BufferOrErr = MemoryBuffer::getFileOrSTDIN (UseCtxProfile );
675
673
if (std::error_code EC = BufferOrErr.getError ()) {
676
674
report_fatal_error (" Failed to open contextual profile file" );
677
675
return ;
@@ -722,12 +720,12 @@ class WorkloadImportsManager : public ModuleImportsManager {
722
720
const ModuleSummaryIndex &Index,
723
721
DenseMap<StringRef, FunctionImporter::ExportSetTy> *ExportLists)
724
722
: ModuleImportsManager(IsPrevailing, Index, ExportLists) {
725
- if (ContextualProfile .empty () == WorkloadDefinitions.empty ()) {
723
+ if (UseCtxProfile .empty () == WorkloadDefinitions.empty ()) {
726
724
report_fatal_error (
727
725
" Pass only one of: -thinlto-pgo-ctx-prof or -thinlto-workload-def" );
728
726
return ;
729
727
}
730
- if (!ContextualProfile .empty ())
728
+ if (!UseCtxProfile .empty ())
731
729
loadFromCtxProf ();
732
730
else
733
731
loadFromJson ();
@@ -749,7 +747,7 @@ std::unique_ptr<ModuleImportsManager> ModuleImportsManager::create(
749
747
IsPrevailing,
750
748
const ModuleSummaryIndex &Index,
751
749
DenseMap<StringRef, FunctionImporter::ExportSetTy> *ExportLists) {
752
- if (WorkloadDefinitions.empty () && ContextualProfile .empty ()) {
750
+ if (WorkloadDefinitions.empty () && UseCtxProfile .empty ()) {
753
751
LLVM_DEBUG (dbgs () << " [Workload] Using the regular imports manager.\n " );
754
752
return std::unique_ptr<ModuleImportsManager>(
755
753
new ModuleImportsManager (IsPrevailing, Index, ExportLists));
0 commit comments