diff options
Diffstat (limited to 'contrib/llvm/tools/llvm-cov/CodeCoverage.cpp')
-rw-r--r-- | contrib/llvm/tools/llvm-cov/CodeCoverage.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/contrib/llvm/tools/llvm-cov/CodeCoverage.cpp b/contrib/llvm/tools/llvm-cov/CodeCoverage.cpp index 4ff5330..8dc4d66 100644 --- a/contrib/llvm/tools/llvm-cov/CodeCoverage.cpp +++ b/contrib/llvm/tools/llvm-cov/CodeCoverage.cpp @@ -89,7 +89,7 @@ public: LoadedSourceFiles; bool CompareFilenamesOnly; StringMap<std::string> RemappedFilenames; - llvm::Triple::ArchType CoverageArch; + std::string CoverageArch; }; } @@ -349,15 +349,12 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) { Filters.push_back(std::unique_ptr<CoverageFilter>(StatFilterer)); } - if (Arch.empty()) - CoverageArch = llvm::Triple::ArchType::UnknownArch; - else { - CoverageArch = Triple(Arch).getArch(); - if (CoverageArch == llvm::Triple::ArchType::UnknownArch) { - errs() << "error: Unknown architecture: " << Arch << "\n"; - return 1; - } + if (!Arch.empty() && + Triple(Arch).getArch() == llvm::Triple::ArchType::UnknownArch) { + errs() << "error: Unknown architecture: " << Arch << "\n"; + return 1; } + CoverageArch = Arch; for (const auto &File : InputSourceFiles) { SmallString<128> Path(File); |