]> granicus.if.org Git - clang/commit
Extend clang_getCursor() to take a 'relativeDecl' argument (so speed up searching...
authorSteve Naroff <snaroff@apple.com>
Wed, 21 Oct 2009 13:56:23 +0000 (13:56 +0000)
committerSteve Naroff <snaroff@apple.com>
Wed, 21 Oct 2009 13:56:23 +0000 (13:56 +0000)
commit6a6de8b4fc944ca1bfa4e47c516d049a0d627b0e
tree3cd9fdb048843bd8aae56efb65d740a3bc072d3c
parent727e268bd2974a7b16af65a5cfdfe47da9ebeb6c
Extend clang_getCursor() to take a 'relativeDecl' argument (so speed up searching). Without a 'relativeDecl', the algorithm is n-squared. For example, running the following command on 'Large.m' takes hours without a 'relatvieDecl'.

snaroff% time ../../Debug/bin/c-index-test Large.ast all > Large.out
snaroff% cat Large.m
#import <Cocoa/Cocoa.h>
#import <QuickTime/QuickTime.h>
#import <OpenGL/OpenGL.h>

With a 'relativeDecl', it takes <30 seconds:-)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84760 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang-c/Index.h
include/clang/Index/Utils.h
lib/Index/ResolveLocation.cpp
tools/CIndex/CIndex.cpp
tools/c-index-test/c-index-test.c