[cfe-dev] Calling clang_reparseTranslationUnit does not make use of Precompiled Preamble flag

Eran Ifrah eran.ifrah at gmail.com
Sun Nov 20 06:26:17 PST 2011


Hello,

Under Windows (MinGW/G++ 4.6.1, Windows 7) the
CXTranslationUnit_*PrecompiledPreamble flag has no effect whatsoever
when calling clang_reparseTranslationUnit

It seems (after alot of struggling compiling clang under Windows /
MinGW...) that the problem is related to the CXUnsavedFile.

If I call:

clang_reparseTranslationUnit(TU, 1, &unsavedFile,
clang_defaultReparseOptions(TU)); ==> clangs does not precompile the
preamble

But if I will call it like this:
clang_reparseTranslationUnit(TU, 0, NULL,
clang_defaultReparseOptions(TU)); ==> clang precompiles the preamble

I observed this behavior while debugging it / set LIBCLANG_TIMING=1
In both clang 2.9 (official precompiled binaries) and in clang.dll
built from SVN trunk.

Also worth mentioning that under Linux, in both cases libclang is
precompiling the preamble

Is this behavior intentional? or is it a bug?

-- 
Eran Ifrah
Author of the cross platform, open source C++ IDE: http://www.codelite.org
TimeWarden, a parental control software: http://www.smartkoders.com



More information about the cfe-dev mailing list