[PATCH] D86998: [llvm-dwarfdump] Warn user when it encounters no null terminated strings.

Xing GUO via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 22:16:48 PDT 2020


Higuoxing added inline comments.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFContext.cpp:533
+    Error Err = Error::success();
+    cantFail(std::move(Err));
+
----------------
MaskRay wrote:
> `operator bool` sets the checked state if Error is in a success state.
> 
> So you can just run: `(void)!Err`
> 
> If you want to ensure an Error in a success state is also checked (not in this case), `ErrorAsOutParameter ...(&Err)`
Thanks. Actually I'm not sure about it. I didn't find anything about creating a checked error in [LLVM Programmer's manual](https://llvm.org/docs/ProgrammersManual.html).

I usually do it using

```
Error Err = Error::success();
cantFail(std::move(Err));
```

Can we record it in programmer's manual?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86998



More information about the llvm-commits mailing list