[PATCH] D140333: [lld][COFF] Fix lld-link crash when several .obj files built with /Zi refer to a .pdb file that failed to load

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 20 15:38:24 PST 2022


aganea added inline comments.


================
Comment at: lld/COFF/InputFiles.cpp:899
 
+bool PDBInputFile::hasLoadError() const { return loadErrorStr.has_value(); }
+Error PDBInputFile::getLoadError() const {
----------------
I wouldn't add those two accessor functions, and would keep `loadErrorStr` public. The intent is already clear enough by accessing `std::optional` and you seem to only use `getLoadError` once. What about moving the `make_error..` line to the call site and compose it with `createFileError`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140333



More information about the llvm-commits mailing list