Lines Matching defs:ASTUnit

1 //===--- ASTUnit.cpp - ASTUnit utility --------------------------*- C++ -*-===//
10 // ASTUnit Implementation.
14 #include "clang/Frontend/ASTUnit.h"
87 /// \brief Temporary files that should be removed when the ASTUnit is
109 typedef llvm::DenseMap<const ASTUnit *,
122 // Use the mutex because there can be an alive thread destroying an ASTUnit.
131 static OnDiskData &getOnDiskData(const ASTUnit *AU) {
142 static void erasePreambleFile(const ASTUnit *AU) {
146 static void removeOnDiskEntry(const ASTUnit *AU) {
158 static void setPreambleFile(const ASTUnit *AU, StringRef preambleFile) {
162 static const std::string &getPreambleFile(const ASTUnit *AU) {
184 struct ASTUnit::ASTWriterData {
192 void ASTUnit::clearFileLevelDecls() {
196 void ASTUnit::CleanTemporaryFiles() {
200 void ASTUnit::addTemporaryFile(StringRef TempFile) {
210 /// \brief Tracks the number of ASTUnit objects that are currently active.
215 ASTUnit::ASTUnit(bool _MainFileIsAST)
234 ASTUnit::~ASTUnit() {
261 void ASTUnit::setPreprocessor(Preprocessor *pp) { PP = pp; }
337 void ASTUnit::CacheCodeCompletionResults() {
480 void ASTUnit::ClearCachedCompletionResults() {
621 ASTMutationListener *ASTUnit::getASTMutationListener() {
627 ASTDeserializationListener *ASTUnit::getDeserializationListener() {
634 ASTUnit::getBufferForFile(StringRef Filename, std::string *ErrorStr) {
644 /// \brief Configure the diagnostics object for use with ASTUnit.
645 void ASTUnit::ConfigureDiags(IntrusiveRefCntPtr<DiagnosticsEngine> Diags,
646 ASTUnit &AST, bool CaptureDiagnostics) {
652 std::unique_ptr<ASTUnit> ASTUnit::LoadFromASTFile(
659 std::unique_ptr<ASTUnit> AST(new ASTUnit(true));
662 llvm::CrashRecoveryContextCleanupRegistrar<ASTUnit>
820 ASTUnit &Unit;
824 TopLevelDeclTrackerConsumer(ASTUnit &_Unit, unsigned &Hash)
879 ASTUnit &Unit;
891 TopLevelDeclTrackerAction(ASTUnit &_Unit) : Unit(_Unit) {}
900 ASTUnit &Unit;
904 explicit PrecompilePreambleAction(ASTUnit &Unit)
919 ASTUnit &Unit;
926 PrecompilePreambleConsumer(ASTUnit &Unit, PrecompilePreambleAction *Action,
1032 /// \returns True if a failure occurred that causes the ASTUnit not to
1034 bool ASTUnit::Parse(std::shared_ptr<PCHContainerOperations> PCHContainerOps,
1162 // Keep the ownership of the data in the ASTUnit because the client may
1189 ASTUnit::ComputedPreamble
1190 ASTUnit::ComputePreamble(CompilerInvocation &Invocation, unsigned MaxLines) {
1246 ASTUnit::PreambleFileHash
1247 ASTUnit::PreambleFileHash::createForFile(off_t Size, time_t ModTime) {
1255 ASTUnit::PreambleFileHash ASTUnit::PreambleFileHash::createForMemoryBuffer(
1269 bool operator==(const ASTUnit::PreambleFileHash &LHS,
1270 const ASTUnit::PreambleFileHash &RHS) {
1285 static ASTUnit::StandaloneFixIt makeStandaloneFixIt(const SourceManager &SM,
1288 ASTUnit::StandaloneFixIt OutFix;
1297 static ASTUnit::StandaloneDiagnostic
1300 ASTUnit::StandaloneDiagnostic OutDiag;
1342 ASTUnit::getMainBufferWithPrecompiledPreamble(
1641 void ASTUnit::RealizeTopLevelDeclsFromPreamble() {
1655 void ASTUnit::transferASTDataFromCompilerInstance(CompilerInstance &CI) {
1674 StringRef ASTUnit::getMainFileName() const {
1692 StringRef ASTUnit::getASTFileName() const {
1701 ASTUnit *ASTUnit::create(CompilerInvocation *CI,
1705 std::unique_ptr<ASTUnit> AST;
1706 AST.reset(new ASTUnit(false));
1723 ASTUnit *ASTUnit::LoadFromCompilerInvocationAction(
1727 ASTUnit *Unit, bool Persistent, StringRef ResourceFilesPath,
1731 std::unique_ptr<ASTUnit> *ErrAST) {
1734 std::unique_ptr<ASTUnit> OwnAST;
1735 ASTUnit *AST = Unit;
1758 llvm::CrashRecoveryContextCleanupRegistrar<ASTUnit>
1866 bool ASTUnit::LoadFromCompilerInvocation(
1894 std::unique_ptr<ASTUnit> ASTUnit::LoadFromCompilerInvocation(
1903 std::unique_ptr<ASTUnit> AST(new ASTUnit(false));
1918 llvm::CrashRecoveryContextCleanupRegistrar<ASTUnit>
1930 ASTUnit *ASTUnit::LoadFromCommandLine(
1940 llvm::Optional<StringRef> ModuleFormat, std::unique_ptr<ASTUnit> *ErrAST) {
1977 std::unique_ptr<ASTUnit> AST;
1978 AST.reset(new ASTUnit(false));
2004 llvm::CrashRecoveryContextCleanupRegistrar<ASTUnit>
2010 // ASTUnit.
2021 bool ASTUnit::Reparse(std::shared_ptr<PCHContainerOperations> PCHContainerOps,
2078 /// results from an ASTUnit with the code-completion results provided to it,
2082 ASTUnit &AST;
2086 AugmentedCodeCompleteConsumer(ASTUnit &AST, CodeCompleteConsumer &Next,
2231 for (ASTUnit::cached_completion_iterator
2308 void ASTUnit::CodeComplete(
2456 bool ASTUnit::Save(StringRef File) {
2502 bool ASTUnit::serialize(raw_ostream &OS) {
2517 void ASTUnit::TranslateStoredDiagnostics(
2568 void ASTUnit::addFileLevelDecl(Decl *D) {
2609 void ASTUnit::findFileRegionDecls(FileID File, unsigned Offset, unsigned Length,
2652 SourceLocation ASTUnit::getLocation(const FileEntry *File,
2659 SourceLocation ASTUnit::getLocation(const FileEntry *File,
2669 SourceLocation ASTUnit::mapLocationFromPreamble(SourceLocation Loc) {
2690 SourceLocation ASTUnit::mapLocationToPreamble(SourceLocation Loc) {
2708 bool ASTUnit::isInPreambleFileID(SourceLocation Loc) {
2719 bool ASTUnit::isInMainFileID(SourceLocation Loc) {
2730 SourceLocation ASTUnit::getEndOfPreambleFileID() {
2741 SourceLocation ASTUnit::getStartOfMainFileID() {
2753 ASTUnit::getLocalPreprocessingEntities() const {
2767 bool ASTUnit::visitLocalTopLevelDecls(void *context, DeclVisitorFn Fn) {
2779 for (ASTUnit::top_level_iterator TL = top_level_begin(),
2789 const FileEntry *ASTUnit::getPCHFile() {
2816 bool ASTUnit::isModuleFile() {
2820 void ASTUnit::PreambleData::countLines() const {
2832 ASTUnit::ConcurrencyState::ConcurrencyState() {
2836 ASTUnit::ConcurrencyState::~ConcurrencyState() {
2840 void ASTUnit::ConcurrencyState::start() {
2842 assert(acquired && "Concurrent access to ASTUnit!");
2845 void ASTUnit::ConcurrencyState::finish() {
2851 ASTUnit::ConcurrencyState::ConcurrencyState() { Mutex = nullptr; }
2852 ASTUnit::ConcurrencyState::~ConcurrencyState() {}
2853 void ASTUnit::ConcurrencyState::start() {}
2854 void ASTUnit::ConcurrencyState::finish() {}