Unify the code for requiring a complete type and move it into a single
place. The only functional change is that the "cannot start a definition
of an incomplete type" is upgrated from a runtime error/warning to an
lldbassert. An plain assert might also be fine, since (AFAICT) this can
only happen in case of a programmer error.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp | ||
---|---|---|
1339 | This has to be a TagDecl so why use auto? |
LGTM too, thanks!
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp | ||
---|---|---|
1339 | const TagDecl *td = ClangUtil::GetAsTagDecl(type); |
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp | ||
---|---|---|
1339 | I think this is a borderline case of "use auto when the type is obvious" policy -- the type name is embedded in the function name, but there's technically no guarantee that it really returns that (it could return an Expected<TagDecl> among other things). OTOH, the name is short enough to just spell it out. |
This has to be a TagDecl so why use auto?