[PATCH] D35504: [PDB] Merge in types and items from type servers (/Zi)
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 17 17:14:34 PDT 2017
rnk added inline comments.
================
Comment at: lld/COFF/PDB.cpp:175-177
+ for (const CVType &Type : Types) {
+ if (Type.kind() != LF_TYPESERVER2)
+ break;
----------------
ruiu wrote:
> Is this possible that Types contain an LF_TYPESERVER2 and other types? If that is impossible, maybe this is more straightforward:
>
> if (Types.empty() || Types[0].kind() == LF_TYPESERVER2)
> return None;
>
> ...
The type array isn't a real collection, though. There's no .front(), no operator[], and begin() could equal end() if there was an error during deserialization even if empty() returns false.
I'll remove the for loop and use begin().
https://reviews.llvm.org/D35504
More information about the llvm-commits
mailing list