r176682 - [libclang] Introduce clang_findIncludesInFile, that can be used to retrieve all #import/#include directives in a specific file.

Argyrios Kyrtzidis akyrtzi at gmail.com
Fri Mar 8 08:31:51 PST 2013


On Mar 8, 2013, at 6:23 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote:

> On Fri, Mar 8, 2013 at 4:32 AM, Argyrios Kyrtzidis <akyrtzi at gmail.com> wrote:
>> +void clang_findIncludesInFile(CXTranslationUnit TU, CXFile file,
>> +                              CXCursorAndRangeVisitor visitor) {
>> +  LogRef Log = Logger::make(LLVM_FUNCTION_NAME);
>> +
>> +  if (!TU) {
>> +    if (Log)
>> +      *Log << "Null CXTranslationUnit";
>> +    return;
>> +  }
> 
> Hi Argyrios,
> 
> The libclang logging infrastructure is essentially used to implement
> "libclang debug mode" that we were discussing, right?  I could add
> logging to functions in CXComment.cpp, where instead of failing we
> return a safe-but-nonsense value.  What is your opinion on this?

I fully endorse more logging, the more the merrier :-)

At some point I want to add different "detail level" for each logger, so then we can specify something like LIBCLANG_LOGGING=<detail level> and choose how "noisy" we want the logging.
(also it'd be nice having a way to specify the set of functions you only want logging for).

> 
> Dmitri
> 
> -- 
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130308/e98640fd/attachment.html>


More information about the cfe-commits mailing list