<html><body><div><br><br>On 13 Oct, 2011,at 06:26 PM, Douglas Gregor <dgregor@applecom> wrote:<br><br></div><div><blockquote type="cite"><div class="msg-quote"><div class="_stretch">
--- a/include/clang/Sema/CodeCompleteConsumer.h<br>
+++ b/include/clang/Sema/CodeCompleteConsumer.h<br>
@@ -435,12 +435,15 @@ private:<br>
   <br>
   /// \brief The availability of this code-completion result.<br>
   unsigned Availability : 2;<br>
+<br>
+  unsigned NumAnnotations;<br>
<br>
Shouldn't we use less than 32 bits for the number of annotations?</div></div></blockquote><span> </span></div><div>I changed it to unsigned NumAnnotations : 8 but with alignment I do not know if this will have any impact. Also, there is a unsigned NumChunks (so a full 32 bit unsigned), which I guess is also be a bit on the large side. So maybe I should give them both a :16?</div><div><br></div><div><blockquote type="cite"><div class="msg-quote"><div class="_stretch"><br>
+CXString clang_getCompletionAnnotation(CXCompletionString completion_string,<br>
+                                       unsigned annotation_number) {<br>
+  CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;<br>
+  return CCStr? createCXString(CCStr->getAnnotation(annotation_number))<br>
+              : createCXString((const char *) 0);<br>
+}<br>
+<br>
<br>
Returning an empty CXString to mean "no more annotations" makes for a very subtle distinction with, e.g.,<br>
<br>
        int blah __attribute__((annotate("one"), annotate(""), annotate("three")));<br>
<br>
I'd feel slightly better if there were a clang_getCompletionNumAnnotations(CXCompletionString) function for the client to use.</div></div></blockquote><span> </span></div><div><span>Done, and I added that line above to the test. New patch attached.</span></div><div><span><br></span></div><div><span>-- Erik.</span></div><div><span><br></span></div></body></html>