aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/ObjectFile.cpp
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2019-10-21 11:06:38 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2019-10-21 11:06:38 +0000
commit2bf01dcbaa6723c9c41f8d6005a1f69818ddbd23 (patch)
treef9862a0f5568ba2e6e46f55e85ba2b720c50853e /llvm/lib/Object/ObjectFile.cpp
parentbac5f6bd21de81a9041a94c12b49eb108dbc77c4 (diff)
downloadllvm-2bf01dcbaa6723c9c41f8d6005a1f69818ddbd23.zip
llvm-2bf01dcbaa6723c9c41f8d6005a1f69818ddbd23.tar.gz
llvm-2bf01dcbaa6723c9c41f8d6005a1f69818ddbd23.tar.bz2
[llvm/Object] - Make ELFObjectFile::getRelocatedSection return Expected<section_iterator>
It returns just a section_iterator currently and have a report_fatal_error call inside. This change adds a way to return errors and handle them on caller sides. The patch also changes/improves current users and adds test cases. Differential revision: https://reviews.llvm.org/D69167 llvm-svn: 375408
Diffstat (limited to 'llvm/lib/Object/ObjectFile.cpp')
-rw-r--r--llvm/lib/Object/ObjectFile.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp
index 75e0952..e0e63a5 100644
--- a/llvm/lib/Object/ObjectFile.cpp
+++ b/llvm/lib/Object/ObjectFile.cpp
@@ -84,7 +84,8 @@ bool ObjectFile::isBerkeleyData(DataRefImpl Sec) const {
return isSectionData(Sec);
}
-section_iterator ObjectFile::getRelocatedSection(DataRefImpl Sec) const {
+Expected<section_iterator>
+ObjectFile::getRelocatedSection(DataRefImpl Sec) const {
return section_iterator(SectionRef(Sec, this));
}