[Object/COFF.h] - Stop returning std::error_code in a few methods. NFCI.

There are 4 methods that return std::error_code now,
though they do not have to because they are always succeed.
I refactored them.

This allows to simplify the code in tools a bit.

llvm-svn: 369263
This commit is contained in:
George Rimar
2019-08-19 14:32:23 +00:00
parent ac0e6c6502
commit 9d5e8a476f
7 changed files with 24 additions and 74 deletions

View File

@@ -936,29 +936,6 @@ iterator_range<base_reloc_iterator> COFFObjectFile::base_relocs() const {
return make_range(base_reloc_begin(), base_reloc_end());
}
std::error_code
COFFObjectFile::getCOFFHeader(const coff_file_header *&Res) const {
Res = COFFHeader;
return std::error_code();
}
std::error_code
COFFObjectFile::getCOFFBigObjHeader(const coff_bigobj_file_header *&Res) const {
Res = COFFBigObjHeader;
return std::error_code();
}
std::error_code COFFObjectFile::getPE32Header(const pe32_header *&Res) const {
Res = PE32Header;
return std::error_code();
}
std::error_code
COFFObjectFile::getPE32PlusHeader(const pe32plus_header *&Res) const {
Res = PE32PlusHeader;
return std::error_code();
}
std::error_code
COFFObjectFile::getDataDirectory(uint32_t Index,
const data_directory *&Res) const {