[Syntax] Represent missing optioanl nodes as nullptr (#14300)

Allocating RawSyntax/SyntaxData for missing optional node is a waste of
resource.
This commit is contained in:
Rintaro Ishizaki
2018-01-31 19:24:00 +09:00
committed by GitHub
parent 7905d30dc2
commit fced748790
26 changed files with 175 additions and 261 deletions

View File

@@ -1799,7 +1799,7 @@ void SwiftEditorDocument::readSyntaxInfo(EditorConsumer &Consumer) {
llvm::raw_string_ostream OS(SyntaxContent);
json::Output JsonOut(OS);
auto Root = Impl.SyntaxInfo->getSourceFile().getSyntaxRoot().getRaw();
JsonOut << Root;
JsonOut << *Root;
Consumer.handleSerializedSyntaxTree(OS.str());
}