]> granicus.if.org Git - clang/commit
Switch clang_createTranslationUnitFromSourceFile to use ASTUnit::LoadFromCommandLine.
authorDaniel Dunbar <daniel@zuster.org>
Thu, 3 Dec 2009 01:54:28 +0000 (01:54 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 3 Dec 2009 01:54:28 +0000 (01:54 +0000)
commit8506dde586459887b7e14e23a30af8ac5be5adb6
tree225f74cef434c055a01d7bd05e353315b9aed520
parent27682a3e9339168ec42c0d6a1dd82ee9d75ecced
Switch clang_createTranslationUnitFromSourceFile to use ASTUnit::LoadFromCommandLine.
 - This is much faster, as it avoids the overhead of dumping an AST file to disk and reloading it.
 - For debugging purposes, there is a clang_setUseExternalASTGeneration hook which can be used to disable this.

On the Sketch Cocoa app, the speedup is pretty nice, especially when using a PCH file while scanning the source:

Wall time to c-index-test all files (no PCH):
Old: 23.4221
New: 12.3884

Wall time to c-index-test all files (with a PCH, and "local" mode):
Old: 10.9233
New:  1.9038

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