diff options
author | Zequan Wu <zequanwu@google.com> | 2023-10-31 10:41:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-31 10:41:01 -0400 |
commit | 4b383d0af93136b80841fc140da0823dfc441dd4 (patch) | |
tree | 1038902b1f527884091f14a7cbbc6ebaba72c78a /llvm/tools/llvm-profdata/llvm-profdata.cpp | |
parent | 4c01a58008055aa8a7ce6e1a770216cd86664711 (diff) | |
download | llvm-4b383d0af93136b80841fc140da0823dfc441dd4.zip llvm-4b383d0af93136b80841fc140da0823dfc441dd4.tar.gz llvm-4b383d0af93136b80841fc140da0823dfc441dd4.tar.bz2 |
[Profile] Refactor profile correlation. (#70712)
Refactor some code from https://github.com/llvm/llvm-project/pull/69493.
Rebase of https://github.com/llvm/llvm-project/pull/69656 on top of main
as it was messed up.
Diffstat (limited to 'llvm/tools/llvm-profdata/llvm-profdata.cpp')
-rw-r--r-- | llvm/tools/llvm-profdata/llvm-profdata.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp index 7d665a8..f05029e1 100644 --- a/llvm/tools/llvm-profdata/llvm-profdata.cpp +++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp @@ -426,8 +426,9 @@ mergeInstrProfile(const WeightedFileVector &Inputs, StringRef DebugInfoFilename, std::unique_ptr<InstrProfCorrelator> Correlator; if (!DebugInfoFilename.empty()) { - if (auto Err = - InstrProfCorrelator::get(DebugInfoFilename).moveInto(Correlator)) + if (auto Err = InstrProfCorrelator::get(DebugInfoFilename, + InstrProfCorrelator::DEBUG_INFO) + .moveInto(Correlator)) exitWithError(std::move(Err), DebugInfoFilename); if (auto Err = Correlator->correlateProfileData(MaxDbgCorrelationWarnings)) exitWithError(std::move(Err), DebugInfoFilename); @@ -2893,7 +2894,9 @@ static int showDebugInfoCorrelation(const std::string &Filename, if (SFormat == ShowFormat::Json) exitWithError("JSON output is not supported for debug info correlation"); std::unique_ptr<InstrProfCorrelator> Correlator; - if (auto Err = InstrProfCorrelator::get(Filename).moveInto(Correlator)) + if (auto Err = + InstrProfCorrelator::get(Filename, InstrProfCorrelator::DEBUG_INFO) + .moveInto(Correlator)) exitWithError(std::move(Err), Filename); if (SFormat == ShowFormat::Yaml) { if (auto Err = Correlator->dumpYaml(MaxDbgCorrelationWarnings, OS)) |