Lines Matching defs:AST
15 #include "clang/AST/ASTContext.h"
16 #include "clang/AST/ASTConsumer.h"
17 #include "clang/AST/DeclVisitor.h"
18 #include "clang/AST/TypeOrdering.h"
19 #include "clang/AST/StmtVisitor.h"
537 // FIXME: This is broken, we should store the TargetOptions in the AST file.
638 ASTUnit &AST, bool CaptureDiagnostics) {
645 Client = new StoredDiagnosticConsumer(AST.StoredDiagnostics);
651 Diags->setClient(new StoredDiagnosticConsumer(AST.StoredDiagnostics));
663 OwningPtr<ASTUnit> AST(new ASTUnit(true));
667 ASTUnitCleanup(AST.get());
672 ConfigureDiags(Diags, 0, 0, *AST, CaptureDiagnostics);
674 AST->OnlyLocalDecls = OnlyLocalDecls;
675 AST->CaptureDiagnostics = CaptureDiagnostics;
676 AST->Diagnostics = Diags;
677 AST->FileMgr = new FileManager(FileSystemOpts);
678 AST->SourceMgr = new SourceManager(AST->getDiagnostics(),
679 AST->getFileManager());
680 AST->HeaderInfo.reset(new HeaderSearch(AST->getFileManager(),
681 AST->getDiagnostics(),
682 AST->ASTFileLangOpts,
691 = AST->getFileManager().getVirtualFile(RemappedFiles[I].first,
695 AST->getDiagnostics().Report(diag::err_fe_remap_missing_from_file)
703 AST->getSourceManager().overrideFileContents(FromFile, memBuf);
707 const FileEntry *ToFile = AST->FileMgr->getFile(fname);
709 AST->getDiagnostics().Report(diag::err_fe_remap_missing_to_file)
716 = AST->getFileManager().getVirtualFile(RemappedFiles[I].first,
720 AST->getDiagnostics().Report(diag::err_fe_remap_missing_from_file)
728 AST->getSourceManager().overrideFileContents(FromFile, ToFile);
734 HeaderSearch &HeaderInfo = *AST->HeaderInfo.get();
740 AST->PP = new Preprocessor(AST->getDiagnostics(), AST->ASTFileLangOpts,
741 /*Target=*/0, AST->getSourceManager(), HeaderInfo,
742 *AST,
746 Preprocessor &PP = *AST->PP;
748 AST->Ctx = new ASTContext(AST->ASTFileLangOpts,
749 AST->getSourceManager(),
756 ASTContext &Context = *AST->Ctx;
768 Reader->setListener(new ASTInfoCollector(*AST->PP, Context,
769 AST->ASTFileLangOpts, HeaderInfo,
770 AST->Target, Predefines, Counter));
778 AST->getDiagnostics().Report(diag::err_fe_unable_to_load_pch);
782 AST->OriginalSourceFile = Reader->getOriginalSourceFile();
787 // Attach the AST reader to the AST context as an external AST
789 // AST file as needed.
799 // Create an AST consumer, even though it isn't used.
800 AST->Consumer.reset(new ASTConsumer);
802 // Create a semantic analysis object and tell the AST reader about it.
803 AST->TheSema.reset(new Sema(PP, Context, *AST->Consumer));
804 AST->TheSema->Initialize();
805 ReaderPtr->InitializeSema(*AST->TheSema);
806 AST->Reader = ReaderPtr;
808 return AST.take();
1037 // Create the compiler instance to use for building the AST.
1072 "FIXME: AST inputs not yet supported here!");
1544 "FIXME: AST inputs not yet supported here!");
1669 OwningPtr<ASTUnit> AST;
1670 AST.reset(new ASTUnit(false));
1671 ConfigureDiags(Diags, 0, 0, *AST, CaptureDiagnostics);
1672 AST->Diagnostics = Diags;
1673 AST->Invocation = CI;
1674 AST->FileSystemOpts = CI->getFileSystemOpts();
1675 AST->FileMgr = new FileManager(AST->FileSystemOpts);
1676 AST->SourceMgr = new SourceManager(AST->getDiagnostics(), *AST->FileMgr);
1678 return AST.take();
1695 ASTUnit *AST = Unit;
1696 if (!AST) {
1697 // Create the AST unit.
1699 AST = OwnAST.get();
1706 AST->OnlyLocalDecls = OnlyLocalDecls;
1707 AST->CaptureDiagnostics = CaptureDiagnostics;
1709 AST->PreambleRebuildCounter = 2;
1710 AST->TUKind = Action ? Action->getTranslationUnitKind() : TU_Complete;
1711 AST->ShouldCacheCodeCompletionResults = CacheCodeCompletionResults;
1723 ProcessWarningOptions(AST->getDiagnostics(), CI->getDiagnosticOpts());
1726 AST->TargetFeatures = CI->getTargetOpts().Features;
1728 // Create the compiler instance to use for building the AST.
1736 AST->OriginalSourceFile = Clang->getFrontendOpts().Inputs[0].File;
1740 Clang->setDiagnostics(&AST->getDiagnostics());
1743 Clang->getTargetOpts().Features = AST->TargetFeatures;
1758 "FIXME: AST inputs not yet supported here!");
1763 AST->TheSema.reset();
1764 AST->Ctx = 0;
1765 AST->PP = 0;
1766 AST->Reader = 0;
1769 Clang->setFileManager(&AST->getFileManager());
1772 Clang->setSourceManager(&AST->getSourceManager());
1778 TrackerAct.reset(new TopLevelDeclTrackerAction(*AST));
1787 AST->transferASTDataFromCompilerInstance(*Clang);
1796 new MacroDefinitionTrackerPPCallbacks(AST->getCurrentTopLevelHashValue()));
1800 Consumers.push_back(new TopLevelDeclTrackerConsumer(*AST,
1801 AST->getCurrentTopLevelHashValue()));
1807 AST->transferASTDataFromCompilerInstance(*Clang);
1814 return AST;
1853 // Create the AST unit.
1854 OwningPtr<ASTUnit> AST;
1855 AST.reset(new ASTUnit(false));
1856 ConfigureDiags(Diags, 0, 0, *AST, CaptureDiagnostics);
1857 AST->Diagnostics = Diags;
1858 AST->OnlyLocalDecls = OnlyLocalDecls;
1859 AST->CaptureDiagnostics = CaptureDiagnostics;
1860 AST->TUKind = TUKind;
1861 AST->ShouldCacheCodeCompletionResults = CacheCodeCompletionResults;
1862 AST->Invocation = CI;
1866 ASTUnitCleanup(AST.get());
1871 return AST->LoadFromCompilerInvocation(PrecompilePreamble)? 0 : AST.take();
1933 // Create the AST unit.
1934 OwningPtr<ASTUnit> AST;
1935 AST.reset(new ASTUnit(false));
1936 ConfigureDiags(Diags, ArgBegin, ArgEnd, *AST, CaptureDiagnostics);
1937 AST->Diagnostics = Diags;
1939 AST->FileSystemOpts = CI->getFileSystemOpts();
1940 AST->FileMgr = new FileManager(AST->FileSystemOpts);
1941 AST->OnlyLocalDecls = OnlyLocalDecls;
1942 AST->CaptureDiagnostics = CaptureDiagnostics;
1943 AST->TUKind = TUKind;
1944 AST->ShouldCacheCodeCompletionResults = CacheCodeCompletionResults;
1945 AST->NumStoredDiagnosticsFromDriver = StoredDiagnostics.size();
1946 AST->StoredDiagnostics.swap(StoredDiagnostics);
1947 AST->Invocation = CI;
1952 ASTUnitCleanup(AST.get());
1954 if (AST->LoadFromCompilerInvocation(PrecompilePreamble)) {
1958 AST->StoredDiagnostics.swap(AST->FailedParseDiagnostics);
1959 ErrAST->swap(AST);
1964 return AST.take();
2038 ASTUnit &AST;
2042 AugmentedCodeCompleteConsumer(ASTUnit &AST, CodeCompleteConsumer &Next,
2046 Next.isOutputBinary()), AST(AST), Next(Next)
2065 if (AST.getASTContext().getLangOpts().CPlusPlus)
2191 C = AST.cached_completion_begin(),
2192 CEnd = AST.cached_completion_end();
2230 = AST.getCachedCompletionTypes();
2340 "FIXME: AST inputs not yet supported here!");