Remove bogus std::error_code returns form SectionRef.
There are two methods in SectionRef that can fail:
* getName: The index into the string table can be invalid.
* getContents: The section might point to invalid contents.
Every other method will always succeed and returning and std::error_code just
complicates the code. For example, a section can have an invalid alignment,
but if we are able to get to the section structure at all and create a
SectionRef, we will always be able to read that invalid alignment.
llvm-svn: 219314
diff --git a/llvm/lib/ProfileData/CoverageMappingReader.cpp b/llvm/lib/ProfileData/CoverageMappingReader.cpp
index 3eb87e6..987aab6 100644
--- a/llvm/lib/ProfileData/CoverageMappingReader.cpp
+++ b/llvm/lib/ProfileData/CoverageMappingReader.cpp
@@ -333,7 +333,8 @@
std::error_code load(SectionRef &Section) {
if (auto Err = Section.getContents(Data))
return Err;
- return Section.getAddress(Address);
+ Address = Section.getAddress();
+ return instrprof_error::success;
}
std::error_code get(uint64_t Pointer, size_t Size, StringRef &Result) {