Try to fix build failure caused by r322097

Avoid mapping during output when Detail is nullptr; otherwise, an empty
"Detail" field will be populated in YAML output.

llvm-svn: 322116
This commit is contained in:
Eric Liu 2018-01-09 20:26:49 +00:00
parent 56cca7437c
commit 72b3855bf5
1 changed files with 2 additions and 1 deletions

View File

@ -92,7 +92,8 @@ template <> struct MappingTraits<Symbol> {
IO.mapOptional("CompletionSnippetInsertText",
Sym.CompletionSnippetInsertText);
IO.mapOptional("Detail", Sym.Detail);
if (!IO.outputting() || Sym.Detail)
IO.mapOptional("Detail", Sym.Detail);
}
};