The goal is to enable tools that use libclang to parse c/c++ code to display additional errors and warnings emitted by plugins.
Normally libclang does not load any plugins when its parsing code through clang_parseTranslationUnit.
This patch moves the plugin loading code from ExecuteCompilerInvocation to the class CompilerInstance and
adds the method calls to ASTUnit::Parse and ExecuteCompilerInvocation.
I additionally added the symbols that are needed for the plugin to link against libclang to tools/libclang/libclang.exports.
If one links the plugin against libclang it works from the vim plugin YouCompleteMe and clang itself.
Details
- Reviewers
klimek rsmith doug.gregor
Diff Detail
Event Timeline
Thanks a lot for working on this!
- Some general high level feedback inline
- Can you please upload the next patch with full context (http://llvm.org/docs/Phabricator.html)
With svn, you do that by typing:
$ svn diff --diff-cmd=diff -x -U999999
examples/PrintFunctionNames/CMakeLists.txt | ||
---|---|---|
13 | The other code around doesn't seem to have spaces in parenthesis. The general guideline in llvm is to be consistent with the code around you - that makes reviewing much more pleasurable ;) | |
examples/PrintFunctionNames/PrintFunctionNames.cpp | ||
26–42 | Can you clang-format over it. | |
31 | I think having a field in the middle between methods leads to it getting lost. Also, does this have to be public? There are basically 2 ways in llvm/clang to sort classes: |
With the nits fixed, it generally looks good from my side. The question is who the right owner is to give the good to go. Looping in Richard to delegate to the right person.
examples/PrintFunctionNames/PrintFunctionNames.cpp | ||
---|---|---|
26 | No need for the _. CI(CI) works fine (and does TheRightThing). | |
include/clang/Frontend/CompilerInstance.h | ||
713 | Please make comments start with a capital letter. | |
lib/Frontend/CompilerInstance.cpp | ||
1626 | This comment seems superfluous :) | |
lib/FrontendTool/ExecuteCompilerInvocation.cpp | ||
182 | As does this now. |
I'm definitely not the right reviewer for this. Richard or Doug make much more sense.
The other code around doesn't seem to have spaces in parenthesis. The general guideline in llvm is to be consistent with the code around you - that makes reviewing much more pleasurable ;)