From 1d5ae1026e831016fc29fd927877c86af904481f Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 23 Oct 2019 17:51:42 +0000 Subject: Vendor import of stripped llvm trunk r375505, the last commit before the upstream Subversion repository was made read-only, and the LLVM project migrated to GitHub: https://llvm.org/svn/llvm-project/llvm/trunk@375505 --- lib/Object/ObjectFile.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/Object/ObjectFile.cpp') diff --git a/lib/Object/ObjectFile.cpp b/lib/Object/ObjectFile.cpp index 101f5dcc0821..e0e63a5a7d76 100644 --- a/lib/Object/ObjectFile.cpp +++ b/lib/Object/ObjectFile.cpp @@ -67,8 +67,10 @@ Error ObjectFile::printSymbolName(raw_ostream &OS, DataRefImpl Symb) const { uint32_t ObjectFile::getSymbolAlignment(DataRefImpl DRI) const { return 0; } bool ObjectFile::isSectionBitcode(DataRefImpl Sec) const { - if (Expected NameOrErr = getSectionName(Sec)) + Expected NameOrErr = getSectionName(Sec); + if (NameOrErr) return *NameOrErr == ".llvmbc"; + consumeError(NameOrErr.takeError()); return false; } @@ -82,7 +84,8 @@ bool ObjectFile::isBerkeleyData(DataRefImpl Sec) const { return isSectionData(Sec); } -section_iterator ObjectFile::getRelocatedSection(DataRefImpl Sec) const { +Expected +ObjectFile::getRelocatedSection(DataRefImpl Sec) const { return section_iterator(SectionRef(Sec, this)); } @@ -103,7 +106,7 @@ Triple ObjectFile::makeTriple() const { TheTriple.setObjectFormat(Triple::MachO); if (isCOFF()) { - const auto COFFObj = dyn_cast(this); + const auto COFFObj = cast(this); if (COFFObj->getArch() == Triple::thumb) TheTriple.setTriple("thumbv7-windows"); } @@ -127,6 +130,8 @@ ObjectFile::createObjectFile(MemoryBufferRef Object, file_magic Type) { case file_magic::pdb: case file_magic::minidump: return errorCodeToError(object_error::invalid_file_type); + case file_magic::tapi_file: + return errorCodeToError(object_error::invalid_file_type); case file_magic::elf: case file_magic::elf_relocatable: case file_magic::elf_executable: -- cgit v1.2.3