From f757a12dfc91b3ac8464ba2c9971d92e4bfafbec Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 23 Aug 2010 23:00:57 +0000 Subject: Introduce new libclang API functions that determine the availability of a cursor or code-completion result, e.g., whether that result refers to an unavailable, deleted, or deprecated declaration. llvm-svn: 111858 --- clang/lib/Frontend/ASTUnit.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'clang/lib/Frontend/ASTUnit.cpp') diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 14ff75d5c6b..8a15f92045e 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -194,6 +194,7 @@ void ASTUnit::CacheCodeCompletionResults() { IsNestedNameSpecifier); CachedResult.Priority = Results[I].Priority; CachedResult.Kind = Results[I].CursorKind; + CachedResult.Availability = Results[I].Availability; // Keep track of the type of this completion in an ASTContext-agnostic // way. @@ -280,6 +281,7 @@ void ASTUnit::CacheCodeCompletionResults() { CachedResult.Priority = Results[I].Priority; CachedResult.Kind = Results[I].CursorKind; + CachedResult.Availability = Results[I].Availability; CachedResult.TypeClass = STC_Void; CachedResult.Type = 0; CachedCompletionResults.push_back(CachedResult); @@ -1644,7 +1646,8 @@ void AugmentedCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &S, } } - AllResults.push_back(Result(C->Completion, Priority, C->Kind)); + AllResults.push_back(Result(C->Completion, Priority, C->Kind, + C->Availability)); } // If we did not add any cached completion results, just forward the -- cgit v1.2.3