[PATCH] D48909: [clang-doc] Update BitcodeReader to use llvm::Error

Julie Hockett via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 9 14:37:58 PDT 2018


juliehockett marked 2 inline comments as done.
juliehockett added inline comments.


================
Comment at: clang-tools-extra/clang-doc/BitcodeReader.cpp:308
-  llvm::errs() << "Invalid type for info.\n";
-  exit(1);
 }
----------------
leonardchan wrote:
> Probably not important or it's just me being picky/dumb, but is this exit the intended behavior of this program when reaching this function? If so, should the exit also be expected even when using llvm::Error?
> 
> This also applies to the other times exit() is called in these add functions.
Yes, the point of this change is to get rid of that behavior and return a useful error. That's why we change it to return that error instead of void


================
Comment at: clang-tools-extra/clang-doc/BitcodeReader.cpp:311
 
-template <> void addTypeInfo(RecordInfo *I, MemberTypeInfo &&T) {
   I->Members.emplace_back(std::move(T));
----------------
leonardchan wrote:
> Is it necessary to change the return value to llvm::Error for what were originally void functions?
See above


https://reviews.llvm.org/D48909





More information about the cfe-commits mailing list