r192494 - Adds Microsoft compatiable C++ record layout code to clang.

Will Wilson will at indefiant.com
Tue Feb 11 00:34:51 PST 2014


Hi Warren,

I've been using PCH with clang on Windows quite heavily (although for
custom AST analysis only) and have a bit of experience with clang
serialization code. As far as I can tell everything you rely on should
already be serialized - at least local tests on large Windows codebases
don't reveal any issues with the !D->getASTContext().getExternalSource()
conditional removed. Probably the best bet would be to add a few basic
tests using a PCH and try removing the conditional. YMMV but I think you
might be pleasantly surprised and find you have no work to do.

Thanks for the great work on it!
Will.


On 11 February 2014 09:03, Warren Hunt <whunt at google.com> wrote:

> There is no code in the MS Record Layout builder to handle external
> sources so the behavior is unlikely to be correct in the case of an
> external source (hence the guard).  I don't know anything about how PCH
> works or interacts with clang on windows.  I'll try to get a better answer
> for you but in the time being I'd suggest not using PCH and clang on
> windows in combination.
>
> -Warren
>
>
> On Thu, Feb 6, 2014 at 4:23 PM, Will Wilson <will at indefiant.com> wrote:
>
>> Hi Warren,
>>
>> I've just been hunting a bug in MS mode where records were being given
>> different layouts depending on if the TU was built with a PCH or not. In
>> the end I tracked it down to ASTContext::getASTRecordLayout() introduced
>> in r192494:
>>
>>   if (isMsLayout(D) && !D->getASTContext().getExternalSource()) {
>>     NewEntry = BuildMicrosoftASTRecordLayout(D);
>>
>> Removing the "&& !D->getASTContext().getExternalSource()" restored the
>> expected behaviour. Is this check still needed?
>>
>> Cheers,
>> Will.
>>
>
>


-- 
*Indefiant Ltd.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140211/22737ecc/attachment.html>


More information about the cfe-commits mailing list