summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/Error.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-07-01 12:56:27 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-07-01 12:56:27 +0000
commit6def304209dd2152457c1ffda7330a6ac4e076f1 (patch)
treef0b47d1c1dcc683f50552e6850ac19aa6987ed58 /llvm/lib/Object/Error.cpp
parent6ae400d12256de0547c1b06919d126f664c78d7e (diff)
downloadbcm5719-llvm-6def304209dd2152457c1ffda7330a6ac4e076f1.tar.gz
bcm5719-llvm-6def304209dd2152457c1ffda7330a6ac4e076f1.zip
Return ErrorOr from getSection.
This also improves the logic of what is an error: * getSection(uint_32): only return an error if the index is out of bounds. The index 0 corresponds to a perfectly valid entry. * getSection(Elf_Sym): Returns null for symbols that normally don't have sections and error for out of bound indexes. In many places this just moves the report_fatal_error up the stack, but those can then be fixed in smaller patches. llvm-svn: 241156
Diffstat (limited to 'llvm/lib/Object/Error.cpp')
-rw-r--r--llvm/lib/Object/Error.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Object/Error.cpp b/llvm/lib/Object/Error.cpp
index 5d613d77609..7ca2f12f092 100644
--- a/llvm/lib/Object/Error.cpp
+++ b/llvm/lib/Object/Error.cpp
@@ -43,6 +43,8 @@ std::string _object_error_category::message(int EV) const {
return "The end of the file was unexpectedly encountered";
case object_error::string_table_non_null_end:
return "String table must end with a null terminator";
+ case object_error::invalid_section_index:
+ return "Invalid section index";
case object_error::bitcode_section_not_found:
return "Bitcode section not found in object file";
case object_error::macho_small_load_command:
OpenPOWER on IntegriCloud