[PATCH] D61781: [Object] Change ObjectFile::getSectionContents to use Expected

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 13 21:21:20 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rLLD360648: [Object] Change ObjectFile::getSectionContents to return… (authored by MaskRay, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D61781?vs=199004&id=199369#toc

Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61781/new/

https://reviews.llvm.org/D61781

Files:
  COFF/Chunks.cpp
  COFF/Driver.cpp
  COFF/InputFiles.cpp


Index: COFF/Driver.cpp
===================================================================
--- COFF/Driver.cpp
+++ COFF/Driver.cpp
@@ -863,7 +863,8 @@
     ArrayRef<Symbol *> Syms = Obj->getSymbols();
     if (Obj->AddrsigSec) {
       ArrayRef<uint8_t> Contents;
-      Obj->getCOFFObj()->getSectionContents(Obj->AddrsigSec, Contents);
+      cantFail(
+          Obj->getCOFFObj()->getSectionContents(Obj->AddrsigSec, Contents));
       const uint8_t *Cur = Contents.begin();
       while (Cur != Contents.end()) {
         unsigned Size;
Index: COFF/InputFiles.cpp
===================================================================
--- COFF/InputFiles.cpp
+++ COFF/InputFiles.cpp
@@ -176,7 +176,7 @@
 
   if (Name == ".drectve") {
     ArrayRef<uint8_t> Data;
-    COFFObj->getSectionContents(Sec, Data);
+    cantFail(COFFObj->getSectionContents(Sec, Data));
     Directives = StringRef((const char *)Data.data(), Data.size());
     return nullptr;
   }
Index: COFF/Chunks.cpp
===================================================================
--- COFF/Chunks.cpp
+++ COFF/Chunks.cpp
@@ -586,7 +586,7 @@
 
 ArrayRef<uint8_t> SectionChunk::getContents() const {
   ArrayRef<uint8_t> A;
-  File->getCOFFObj()->getSectionContents(Header, A);
+  cantFail(File->getCOFFObj()->getSectionContents(Header, A));
   return A;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61781.199369.patch
Type: text/x-patch
Size: 1327 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190514/32790961/attachment.bin>


More information about the llvm-commits mailing list