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

Argyrios Kyrtzidis kyrtzidis at apple.com
Tue Nov 29 11:21:38 PST 2011


On Nov 20, 2011, at 6:26 AM, Eran Ifrah wrote:

> 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

If you do subsequent clang_reparseTranslationUnits, is the preamble getting compiled or is it not compiled at all ?
Are you sure there's no error when parsing under windows ?

-Argyrios

> 
> 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
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list