[cfe-dev] Fwd: Compiler version vs precompile header

Anton Korobeynikov anton at korobeynikov.info
Sat Jul 28 08:58:58 PDT 2012


---------- Forwarded message ----------
From: Luc Bourhis <luc_j_bourhis at mac.com>
Date: Sat, Jul 28, 2012 at 7:57 PM
Subject: Re: [cfe-dev] Compiler version vs precompile header
To: Anton Korobeynikov <anton at korobeynikov.info>
Cc: Luc Bourhis <luc_j_bourhis at mac.com>


>> I am trying to write a Python script that would check whether an existing precompiled header is compatible with clang (I use SCons as a build system and I would like to make that check to ensure the compilation will not fail later). Do the bytes following CPCH at the beginning of the precompile header  carry some meaning e.g.?
> Have you read http://clang.llvm.org/docs/PCHInternals.html and around?

Yes but it looked to me that I would need to program against the llvm
libraries to do the proper way. Using the clang Python bindings would
be the only option. I get them if I install a clang official release
but not if I use what comes with Xcode. Or am I mistaken?

Actually, I had missed the mention of llvm-bcanalyzer: llvm-bcanalyzer
-dump shows me a section VERSION_CONTROL_BRANCH_REVISION. It looks
like comparing the compiler version against the info of that section
does the trick. Is that a correct approach?

Thanks,

Luc Bourhis



-- 
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University




More information about the cfe-dev mailing list