diff options
| author | Douglas Yung <douglas.yung@sony.com> | 2023-01-25 19:11:08 -0800 |
|---|---|---|
| committer | Douglas Yung <douglas.yung@sony.com> | 2023-01-25 19:11:08 -0800 |
| commit | bce910242e7269446683cfcaffd3ebf5281a9125 (patch) | |
| tree | 8b117ac672f868e39ea9f7cf643cf70d66f32473 /llvm/tools/llvm-cov/CodeCoverage.cpp | |
| parent | d4e3a1dcf6494874c1cc4f180c780641593d2ab0 (diff) | |
| download | llvm-bce910242e7269446683cfcaffd3ebf5281a9125.zip llvm-bce910242e7269446683cfcaffd3ebf5281a9125.tar.gz llvm-bce910242e7269446683cfcaffd3ebf5281a9125.tar.bz2 | |
Revert "[llvm-cov] Look up object files using debuginfod"
This reverts commit efbc8bb18eda63007216ad0cb5a8de04963eddd5.
This change is causing failures when detecting curl on several build bots:
- https://lab.llvm.org/buildbot/#/builders/247/builds/884
- https://lab.llvm.org/buildbot/#/builders/231/builds/7688
- https://lab.llvm.org/buildbot/#/builders/121/builds/27389
- https://lab.llvm.org/buildbot/#/builders/230/builds/8464
- https://lab.llvm.org/buildbot/#/builders/57/builds/24209
- https://lab.llvm.org/buildbot/#/builders/127/builds/42722
Diffstat (limited to 'llvm/tools/llvm-cov/CodeCoverage.cpp')
| -rw-r--r-- | llvm/tools/llvm-cov/CodeCoverage.cpp | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp index 7366059..2b2eda5 100644 --- a/llvm/tools/llvm-cov/CodeCoverage.cpp +++ b/llvm/tools/llvm-cov/CodeCoverage.cpp @@ -23,10 +23,6 @@ #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Triple.h" -#include "llvm/Debuginfod/BuildIDFetcher.h" -#include "llvm/Debuginfod/Debuginfod.h" -#include "llvm/Debuginfod/HTTPClient.h" -#include "llvm/Object/BuildID.h" #include "llvm/ProfileData/Coverage/CoverageMapping.h" #include "llvm/ProfileData/InstrProfReader.h" #include "llvm/Support/CommandLine.h" @@ -183,8 +179,6 @@ private: /// Allowlist from -name-allowlist to be used for filtering. std::unique_ptr<SpecialCaseList> NameAllowlist; - - std::unique_ptr<object::BuildIDFetcher> BIDFetcher; }; } @@ -441,7 +435,7 @@ std::unique_ptr<CoverageMapping> CodeCoverageTool::load() { ObjectFilename); auto CoverageOrErr = CoverageMapping::load(ObjectFilenames, PGOFilename, CoverageArches, - ViewOpts.CompilationDirectory, BIDFetcher.get()); + ViewOpts.CompilationDirectory); if (Error E = CoverageOrErr.takeError()) { error("Failed to load coverage: " + toString(std::move(E))); return nullptr; @@ -653,14 +647,6 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) { cl::opt<bool> DebugDump("dump", cl::Optional, cl::desc("Show internal debug dump")); - cl::list<std::string> DebugFileDirectory( - "debug-file-directory", - cl::desc("Directories to search for object files by build ID")); - cl::opt<bool> Debuginfod( - "debuginfod", cl::ZeroOrMore, - cl::desc("Use debuginfod to look up object files from profile"), - cl::init(canUseDebuginfod())); - cl::opt<CoverageViewOptions::OutputFormat> Format( "format", cl::desc("Output format for line-based coverage reports"), cl::values(clEnumValN(CoverageViewOptions::OutputFormat::Text, "text", @@ -763,18 +749,12 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) { auto commandLineParser = [&, this](int argc, const char **argv) -> int { cl::ParseCommandLineOptions(argc, argv, "LLVM code coverage tool\n"); ViewOpts.Debug = DebugDump; - if (Debuginfod) { - HTTPClient::initialize(); - BIDFetcher = std::make_unique<DebuginfodFetcher>(DebugFileDirectory); - } else { - BIDFetcher = std::make_unique<object::BuildIDFetcher>(DebugFileDirectory); - } if (!CovFilename.empty()) ObjectFilenames.emplace_back(CovFilename); for (const std::string &Filename : CovFilenames) ObjectFilenames.emplace_back(Filename); - if (ObjectFilenames.empty() && !Debuginfod && DebugFileDirectory.empty()) { + if (ObjectFilenames.empty()) { errs() << "No filenames specified!\n"; ::exit(1); } @@ -887,8 +867,10 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) { } CoverageArches.emplace_back(Arch); } - if (CoverageArches.size() != 1 && - CoverageArches.size() != ObjectFilenames.size()) { + if (CoverageArches.size() == 1) + CoverageArches.insert(CoverageArches.end(), ObjectFilenames.size() - 1, + CoverageArches[0]); + if (CoverageArches.size() != ObjectFilenames.size()) { error("Number of architectures doesn't match the number of objects"); return 1; } |
