[llvm] 10b6d09 - Revert "[llvm-cov] Warn when -arch spec is missing/invalid for universal binary"
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 13 16:33:01 PDT 2020
Author: Vedant Kumar
Date: 2020-10-13T16:32:31-07:00
New Revision: 10b6d0901f70738037e3f23e5b441be7ecb94d65
URL: https://github.com/llvm/llvm-project/commit/10b6d0901f70738037e3f23e5b441be7ecb94d65
DIFF: https://github.com/llvm/llvm-project/commit/10b6d0901f70738037e3f23e5b441be7ecb94d65.diff
LOG: Revert "[llvm-cov] Warn when -arch spec is missing/invalid for universal binary"
This reverts commit b81d4bfb44c14575130bb06c047728b69c3213aa.
It's causing some bots to fail to build due to: "error: no matching
function for call to ‘__iterator_category".
Added:
Modified:
llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
llvm/test/tools/llvm-cov/universal-binary.c
Removed:
################################################################################
diff --git a/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h b/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
index 2f285bf54a6a..bf0dffc9653c 100644
--- a/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
+++ b/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
@@ -55,8 +55,7 @@ enum class coveragemap_error {
unsupported_version,
truncated,
malformed,
- decompression_failed,
- invalid_or_missing_arch_specifier
+ decompression_failed
};
const std::error_category &coveragemap_category();
diff --git a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
index 87dab212bdcd..ec840a3f628e 100644
--- a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
+++ b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
@@ -816,8 +816,6 @@ static std::string getCoverageMapErrString(coveragemap_error Err) {
return "Malformed coverage data";
case coveragemap_error::decompression_failed:
return "Failed to decompress coverage data (zlib)";
- case coveragemap_error::invalid_or_missing_arch_specifier:
- return "`-arch` specifier is invalid or missing for universal binary";
}
llvm_unreachable("A value of coveragemap_error has no message.");
}
diff --git a/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp b/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
index c110ab701e86..b75738bc360c 100644
--- a/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
+++ b/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
@@ -950,18 +950,6 @@ loadBinaryFormat(std::unique_ptr<Binary> Bin, StringRef Arch) {
BytesInAddress, Endian);
}
-/// Determine whether \p Arch is invalid or empty, given \p Bin.
-static bool isArchSpecifierInvalidOrMissing(Binary *Bin, StringRef Arch) {
- // If we have a universal binary and Arch doesn't identify any of its slices,
- // it's user error.
- if (auto *Universal = dyn_cast<MachOUniversalBinary>(Bin))
- return none_of(Universal->objects(),
- [Arch](const MachOUniversalBinary::ObjectForArch &Obj) {
- return Obj.getArchFlagName() == Arch;
- });
- return false;
-}
-
Expected<std::vector<std::unique_ptr<BinaryCoverageReader>>>
BinaryCoverageReader::create(
MemoryBufferRef ObjectBuffer, StringRef Arch,
@@ -982,10 +970,6 @@ BinaryCoverageReader::create(
return BinOrErr.takeError();
std::unique_ptr<Binary> Bin = std::move(BinOrErr.get());
- if (isArchSpecifierInvalidOrMissing(Bin.get(), Arch))
- return make_error<CoverageMapError>(
- coveragemap_error::invalid_or_missing_arch_specifier);
-
// MachO universal binaries which contain archives need to be treated as
// archives, not as regular binaries.
if (auto *Universal = dyn_cast<MachOUniversalBinary>(Bin.get())) {
diff --git a/llvm/test/tools/llvm-cov/universal-binary.c b/llvm/test/tools/llvm-cov/universal-binary.c
index f8d5346bc579..635cd32146eb 100644
--- a/llvm/test/tools/llvm-cov/universal-binary.c
+++ b/llvm/test/tools/llvm-cov/universal-binary.c
@@ -10,9 +10,8 @@ int main(int argc, const char *argv[]) {}
// COMBINED: showTemplateInstantiations.cpp
// COMBINED-NEXT: universal-binary.c
-// RUN: not llvm-cov show %S/Inputs/universal-binary -instr-profile %t.profdata -path-equivalence=/tmp,%S %s 2>&1 | FileCheck --check-prefix=WRONG-ARCH %s
// RUN: not llvm-cov show %S/Inputs/universal-binary -instr-profile %t.profdata -path-equivalence=/tmp,%S %s -arch i386 2>&1 | FileCheck --check-prefix=WRONG-ARCH %s
-// WRONG-ARCH: Failed to load coverage: `-arch` specifier is invalid or missing for universal binary
+// WRONG-ARCH: Failed to load coverage
// RUN: not llvm-cov show %S/Inputs/universal-binary -instr-profile %t.profdata -path-equivalence=/tmp,%S %s -arch definitly_a_made_up_architecture 2>&1 | FileCheck --check-prefix=MADE-UP-ARCH %s
// MADE-UP-ARCH: Unknown architecture: definitly_a_made_up_architecture
More information about the llvm-commits
mailing list