in facebook-clang-plugins/libtooling/ASTExporter.h [1373:1395]
void ASTExporter<ATDWriter>::VisitTranslationUnitDecl(
const TranslationUnitDecl *D) {
VisitDecl(D);
VisitDeclContext(D);
bool IsObjCArcOn = D->getASTContext().getLangOpts().ObjCAutoRefCount;
ObjectScope Scope(OF, 4 + IsObjCArcOn);
OF.emitTag("input_path");
OF.emitString(
Options.normalizeSourcePath(Options.inputFile.getFile().str().c_str()));
OF.emitTag("input_kind");
dumpInputKind(Options.inputFile.getKind());
OF.emitTag("integer_type_widths");
dumpIntegerTypeWidths(Context.getTargetInfo());
OF.emitFlag("is_objc_arc_on", IsObjCArcOn);
OF.emitTag("types");
const auto &types = Context.getTypes();
ArrayScope aScope(OF, types.size() + 1); // + 1 for nullptr
for (const Type *type : types) {
dumpType(type);
}
// Just in case, add NoneType to dumped types
dumpType(nullptr);
}