Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang_tokenize fails after reparsing when using precompiled preambles. #11371

Closed
llvmbot opened this issue Sep 23, 2011 · 5 comments
Closed

clang_tokenize fails after reparsing when using precompiled preambles. #11371

llvmbot opened this issue Sep 23, 2011 · 5 comments
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Sep 23, 2011

Bugzilla Link 10999
Resolution FIXED
Resolved on Sep 26, 2011 03:03
Version trunk
OS All
Attachments test program, test input for program
Reporter LLVM Bugzilla Contributor
CC @akyrtzi,@DougGregor,@tkremenek

Extended Description

For a file starting with a comment or a blank line, libclang has the following behaviour:

When calling clang_tokenize after clang_parseTranslationUnit, all tokens are returned. When then calling clang_reparseTranslationUnit and clang_tokenize, no tokens get returned. In both cases the range is the full file (so starting at line 1).

When the file starts with a function definition, it works fine. Also, when turning off precompiled preambles, it also works fine.

Attached is a program (main.cpp) which parses and reparses test.cpp and prints the number of tokens after both parses. When the first line is removed from test.cpp, it works fine.

This was tested against r140369.

@tkremenek
Copy link
Contributor

cloned to rdar://problem/10175093

@llvmbot
Copy link
Collaborator Author

llvmbot commented Sep 23, 2011

patch for c-index-test.c to expose the problem
against r140369

@llvmbot
Copy link
Collaborator Author

llvmbot commented Sep 23, 2011

c-index-test input

@llvmbot
Copy link
Collaborator Author

llvmbot commented Sep 23, 2011

c-index-test input

@akyrtzi
Copy link
Contributor

akyrtzi commented Sep 26, 2011

Fixed at r140519.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

No branches or pull requests

3 participants