diff options
author | Erik Verbruggen <erikjv@me.com> | 2011-10-14 15:31:08 +0000 |
---|---|---|
committer | Erik Verbruggen <erikjv@me.com> | 2011-10-14 15:31:08 +0000 |
commit | 6164ea1d75385b6fc3c19e5ab9bb686298436a5a (patch) | |
tree | 93408352a553eb9fecd58404f4a18ff5676988a8 /lib/Sema/SemaCodeComplete.cpp | |
parent | 3a919e7110407ae7609bb6edc57aac16a5990661 (diff) |
Added clang_getCompletionAnnotation and clang_getCompletionNumAnnotations to
retrieve annotations from completion string.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141953 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 56b351c4cf..405d626ae9 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -2424,6 +2424,12 @@ CodeCompletionResult::CreateCodeCompletionString(Sema &S, Result.AddTextChunk("::"); return Result.TakeString(); } + + for (Decl::attr_iterator i = ND->attr_begin(); i != ND->attr_end(); ++i) { + if (AnnotateAttr *Attr = dyn_cast_or_null<AnnotateAttr>(*i)) { + Result.AddAnnotation(Result.getAllocator().CopyString(Attr->getAnnotation())); + } + } AddResultTypeChunk(S.Context, Policy, ND, Result); |