Lines Matching defs:AST

15 #include "clang/AST/ASTConsumer.h"
16 #include "clang/AST/ASTContext.h"
17 #include "clang/AST/DeclVisitor.h"
18 #include "clang/AST/StmtVisitor.h"
19 #include "clang/AST/TypeOrdering.h"
235 // If we loaded from an AST file, balance out the BeginSourceFile call.
646 ASTUnit &AST, bool CaptureDiagnostics) {
649 Diags->setClient(new StoredDiagnosticConsumer(AST.StoredDiagnostics));
659 std::unique_ptr<ASTUnit> AST(new ASTUnit(true));
663 ASTUnitCleanup(AST.get());
668 ConfigureDiags(Diags, *AST, CaptureDiagnostics);
670 AST->OnlyLocalDecls = OnlyLocalDecls;
671 AST->CaptureDiagnostics = CaptureDiagnostics;
672 AST->Diagnostics = Diags;
674 AST->FileMgr = new FileManager(FileSystemOpts, VFS);
675 AST->UserFilesAreVolatile = UserFilesAreVolatile;
676 AST->SourceMgr = new SourceManager(AST->getDiagnostics(),
677 AST->getFileManager(),
679 AST->HSOpts = new HeaderSearchOptions();
680 AST->HSOpts->ModuleFormat = PCHContainerRdr.getFormat();
681 AST->HeaderInfo.reset(new HeaderSearch(AST->HSOpts,
682 AST->getSourceManager(),
683 AST->getDiagnostics(),
684 AST->ASTFileLangOpts,
694 HeaderSearch &HeaderInfo = *AST->HeaderInfo;
697 AST->PP =
698 new Preprocessor(PPOpts, AST->getDiagnostics(), AST->ASTFileLangOpts,
699 AST->getSourceManager(), HeaderInfo, *AST,
702 Preprocessor &PP = *AST->PP;
704 AST->Ctx = new ASTContext(AST->ASTFileLangOpts, AST->getSourceManager(),
707 ASTContext &Context = *AST->Ctx;
712 AST->Reader = new ASTReader(PP, Context, PCHContainerRdr, { },
717 AST->Reader->setListener(llvm::make_unique<ASTInfoCollector>(
718 *AST->PP, Context, AST->ASTFileLangOpts, AST->TargetOpts, AST->Target,
721 // Attach the AST reader to the AST context as an external AST
723 // AST file as needed.
724 // We need the external source to be set up before we read the AST, because
726 Context.setExternalSource(AST->Reader);
728 switch (AST->Reader->ReadAST(Filename, serialization::MK_MainFile,
739 AST->getDiagnostics().Report(diag::err_fe_unable_to_load_pch);
743 AST->OriginalSourceFile = AST->Reader->getOriginalSourceFile();
747 // Create an AST consumer, even though it isn't used.
748 AST->Consumer.reset(new ASTConsumer);
750 // Create a semantic analysis object and tell the AST reader about it.
751 AST->TheSema.reset(new Sema(PP, Context, *AST->Consumer));
752 AST->TheSema->Initialize();
753 AST->Reader->InitializeSema(*AST->TheSema);
756 AST->getDiagnostics().getClient()->BeginSourceFile(Context.getLangOpts(),&PP);
758 return AST;
1041 // Create the compiler instance to use for building the AST.
1074 "FIXME: AST inputs not yet supported here!");
1549 "FIXME: AST inputs not yet supported here!");
1713 std::unique_ptr<ASTUnit> AST;
1714 AST.reset(new ASTUnit(false));
1715 ConfigureDiags(Diags, *AST, CaptureDiagnostics);
1716 AST->Diagnostics = Diags;
1717 AST->Invocation = CI;
1718 AST->FileSystemOpts = CI->getFileSystemOpts();
1723 AST->FileMgr = new FileManager(AST->FileSystemOpts, VFS);
1724 AST->UserFilesAreVolatile = UserFilesAreVolatile;
1725 AST->SourceMgr = new SourceManager(AST->getDiagnostics(), *AST->FileMgr,
1728 return AST.release();
1743 ASTUnit *AST = Unit;
1744 if (!AST) {
1745 // Create the AST unit.
1747 AST = OwnAST.get();
1748 if (!AST)
1756 AST->OnlyLocalDecls = OnlyLocalDecls;
1757 AST->CaptureDiagnostics = CaptureDiagnostics;
1759 AST->PreambleRebuildCounter = PrecompilePreambleAfterNParses;
1760 AST->TUKind = Action ? Action->getTranslationUnitKind() : TU_Complete;
1761 AST->ShouldCacheCodeCompletionResults = CacheCodeCompletionResults;
1762 AST->IncludeBriefCommentsInCodeCompletion
1775 ProcessWarningOptions(AST->getDiagnostics(), CI->getDiagnosticOpts());
1777 // Create the compiler instance to use for building the AST.
1786 AST->OriginalSourceFile = Clang->getFrontendOpts().Inputs[0].getFile();
1790 Clang->setDiagnostics(&AST->getDiagnostics());
1807 "FIXME: AST inputs not yet supported here!");
1812 AST->TheSema.reset();
1813 AST->Ctx = nullptr;
1814 AST->PP = nullptr;
1815 AST->Reader = nullptr;
1818 Clang->setFileManager(&AST->getFileManager());
1821 Clang->setSourceManager(&AST->getSourceManager());
1827 TrackerAct.reset(new TopLevelDeclTrackerAction(*AST));
1836 AST->transferASTDataFromCompilerInstance(*Clang);
1846 AST->getCurrentTopLevelHashValue()));
1851 *AST, AST->getCurrentTopLevelHashValue()));
1856 AST->transferASTDataFromCompilerInstance(*Clang);
1864 AST->transferASTDataFromCompilerInstance(*Clang);
1871 return AST;
1910 // Create the AST unit.
1911 std::unique_ptr<ASTUnit> AST(new ASTUnit(false));
1912 ConfigureDiags(Diags, *AST, CaptureDiagnostics);
1913 AST->Diagnostics = Diags;
1914 AST->OnlyLocalDecls = OnlyLocalDecls;
1915 AST->CaptureDiagnostics = CaptureDiagnostics;
1916 AST->TUKind = TUKind;
1917 AST->ShouldCacheCodeCompletionResults = CacheCodeCompletionResults;
1918 AST->IncludeBriefCommentsInCodeCompletion
1920 AST->Invocation = CI;
1921 AST->FileSystemOpts = FileMgr->getFileSystemOpts();
1922 AST->FileMgr = FileMgr;
1923 AST->UserFilesAreVolatile = UserFilesAreVolatile;
1927 ASTUnitCleanup(AST.get());
1932 if (AST->LoadFromCompilerInvocation(std::move(PCHContainerOps),
1935 return AST;
1984 // Create the AST unit.
1985 std::unique_ptr<ASTUnit> AST;
1986 AST.reset(new ASTUnit(false));
1987 ConfigureDiags(Diags, *AST, CaptureDiagnostics);
1988 AST->Diagnostics = Diags;
1989 AST->FileSystemOpts = CI->getFileSystemOpts();
1994 AST->FileMgr = new FileManager(AST->FileSystemOpts, VFS);
1995 AST->OnlyLocalDecls = OnlyLocalDecls;
1996 AST->CaptureDiagnostics = CaptureDiagnostics;
1997 AST->TUKind = TUKind;
1998 AST->ShouldCacheCodeCompletionResults = CacheCodeCompletionResults;
1999 AST->IncludeBriefCommentsInCodeCompletion
2001 AST->UserFilesAreVolatile = UserFilesAreVolatile;
2002 AST->NumStoredDiagnosticsFromDriver = StoredDiagnostics.size();
2003 AST->StoredDiagnostics.swap(StoredDiagnostics);
2004 AST->Invocation = CI;
2006 AST->WriterData.reset(new ASTWriterData());
2013 ASTUnitCleanup(AST.get());
2015 if (AST->LoadFromCompilerInvocation(std::move(PCHContainerOps),
2020 AST->StoredDiagnostics.swap(AST->FailedParseDiagnostics);
2021 ErrAST->swap(AST);
2026 return AST.release();
2091 ASTUnit &AST;
2095 AugmentedCodeCompleteConsumer(ASTUnit &AST, CodeCompleteConsumer &Next,
2098 AST(AST), Next(Next)
2117 if (AST.getASTContext().getLangOpts().CPlusPlus)
2241 C = AST.cached_completion_begin(),
2242 CEnd = AST.cached_completion_end();
2279 = AST.getCachedCompletionTypes();
2393 "FIXME: AST inputs not yet supported here!");