[cfe-dev] libclang: failing assert

Argyrios Kyrtzidis kyrtzidis at apple.com
Mon Mar 18 16:07:31 PDT 2013


On Mar 17, 2013, at 8:35 AM, Erik Verbruggen <erik.verbruggen at me.com> wrote:

> 
> On Mar 16, 2013, at 18:56, Argyrios Kyrtzidis <kyrtzidis at apple.com> wrote:
> 
>> 
>> On Mar 16, 2013, at 10:48 AM, Argyrios Kyrtzidis <kyrtzidis at apple.com> wrote:
>> 
>>> On Mar 16, 2013, at 3:09 AM, Erik Verbruggen <erik.verbruggen at me.com> wrote:
>>> 
>>>> Hi,
>>>> 
>>>> When using libclang's clang_annotateTokens, I have a consistently failing assert in CIndex.cpp, line 5429. This is for both 3.2 and trunk. When I comment the assert out, everything looks to be fine. Is this assert valid, and if so, what is it checking? 
>>> 
>>> It makes sure that when lexing for preprocessor directives tokens, that any cursors produced will refer to the correct clang_tokenize'd token.
>>> Are you able to provide a preprocessed file for testing ?
>>> 
>> 
>> You can use "-E -frewrite-includes" to preserve preprocessor directives.
> 
> See attachment.

I can't reproduce using:

$ c-index-test -test-annotate-tokens=main.pp:1:1:100000:1 -x c++ main.pp > /dev/null

Does it occur with a particular source range ? What is the file whose tokens you are annotating ? Does using c-index-test on it reproduce the assertion hit ?
If yes, could you separate the includes of that file, for example:

#include "a.h"
#include "b.h"
#include "c.h"

<code>

====>

#include "preprocessed-headers.h"

<code>

-------

and see if using c-index-test on it reproduces the assertion hit ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130318/d4dddc67/attachment.html>


More information about the cfe-dev mailing list