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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 12 23:00:54 PDT 2019


MaskRay marked an inline comment as done.
MaskRay added inline comments.


================
Comment at: lld/COFF/Driver.cpp:866
       ArrayRef<uint8_t> Contents;
-      Obj->getCOFFObj()->getSectionContents(Obj->AddrsigSec, Contents);
+      cantFail(Obj->getCOFFObj()->getSectionContents(Obj->AddrsigSec, Contents));
       const uint8_t *Cur = Contents.begin();
----------------
@ruiu What I am less confident is whether I should use `cantFail` here. If the error checking has been done before, `cantFail` is the best.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61781





More information about the llvm-commits mailing list