[PATCH] D20982: [Symbolize] Check if the PE file has a PDB and emit an error if we can't load it
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 3 12:55:52 PDT 2016
zturner added inline comments.
================
Comment at: lib/DebugInfo/Symbolize/Symbolize.cpp:56-60
@@ -55,5 +55,7 @@
auto InfoOrErr = getOrCreateModuleInfo(ModuleName);
- if (auto EC = InfoOrErr.getError())
- return EC;
+ if (!InfoOrErr)
+ return InfoOrErr.takeError();
+ else if (!InfoOrErr.get())
+ return DILineInfo();
SymbolizableModule *Info = InfoOrErr.get();
----------------
I think this is usually written:
```
SymbolizableModule *Info = nullptr;
if (auto InfoOrErr = getOrCreateModuleInfo(ModuleName))
Info = InfoOrErr.get();
else
return InfoOrErr;
```
Almost wonder if we need a macro for this considering how frequently we do it.
http://reviews.llvm.org/D20982
More information about the llvm-commits
mailing list