This is an archive of the discontinued LLVM Phabricator instance.

[Modules] Teach Clang to survive ambiguous macros which come from system headers even if they arrived when merging non-system modules.
ClosedPublic

Authored by chandlerc on Mar 12 2015, 8:06 PM.

Details

Summary

The idea of this code is that we don't want to warn the user about
macros defined multiple times by their system headers with slightly
different definitions. We should have this behavior if either the
macro comes from a system module, or the definition within the module
comes from a system header. Previously, we would warn on ambiguous
macros being merged when they came from a users modules even though they
only showed up via system headers.

By surviving this we can handle common system header macro differences
like differing 'const' qualification of pointers due to some headers
predating 'const' being valid in C code, even when those systems headers
are pre-built into a system module.

Diff Detail

Event Timeline

chandlerc updated this revision to Diff 21893.Mar 12 2015, 8:06 PM
chandlerc retitled this revision from to [Modules] Teach Clang to survive ambiguous macros which come from system headers even if they arrived when merging non-system modules..
chandlerc updated this object.
chandlerc edited the test plan for this revision. (Show Details)
chandlerc added a reviewer: rsmith.
chandlerc added a subscriber: Unknown Object (MLST).

I should have mentioned, I'll simplify the test case to something more precise prior to committing now that I know what the nature of the bug is.

I'm mostly interested in whether you agree with my reasoning about the fix.

rsmith accepted this revision.Mar 12 2015, 8:11 PM
rsmith edited edge metadata.

OK, makes sense.

This revision is now accepted and ready to land.Mar 12 2015, 8:11 PM
This revision was automatically updated to reflect the committed changes.