summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index 1aa57bbbc76..d8bcf10f075 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -1907,8 +1907,8 @@ uint64_t MachOObjectFile::getSectionSize(DataRefImpl Sec) const {
return SectSize;
}
-std::error_code MachOObjectFile::getSectionContents(DataRefImpl Sec,
- StringRef &Res) const {
+Expected<ArrayRef<uint8_t>>
+MachOObjectFile::getSectionContents(DataRefImpl Sec) const {
uint32_t Offset;
uint64_t Size;
@@ -1922,8 +1922,7 @@ std::error_code MachOObjectFile::getSectionContents(DataRefImpl Sec,
Size = Sect.size;
}
- Res = this->getData().substr(Offset, Size);
- return std::error_code();
+ return arrayRefFromStringRef(getData().substr(Offset, Size));
}
uint64_t MachOObjectFile::getSectionAlignment(DataRefImpl Sec) const {
OpenPOWER on IntegriCloud