Page MenuHomePhabricator

[ASTReader] Only mark module out of date if not already compiled

Authored by bnbarham on Thu, Apr 15, 9:36 PM.



If a module contains errors (ie. it was built with
-fallow-pcm-with-compiler-errors and had errors) and was from the module
cache, it is marked as out of date - see

When a module is imported multiple times in the one compile, this caused
it to be recompiled each time - removing the existing buffer from the
module cache and replacing it. This results in various errors further
down the line.

Instead, only mark the module as out of date if it isn't already
finalized in the module cache.

Diff Detail

Event Timeline

bnbarham requested review of this revision.Thu, Apr 15, 9:36 PM
bnbarham created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptThu, Apr 15, 9:36 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
akyrtzi added inline comments.Fri, Apr 16, 10:03 AM

Is this pragma relevant for the test?

bnbarham added inline comments.Fri, Apr 16, 3:23 PM

I'll double check but I believe assertions are hit regardless, but with assertions off the test doesn't crash. Adding the #pragma causes it to crash.

akyrtzi accepted this revision.Fri, Apr 16, 5:33 PM
This revision is now accepted and ready to land.Fri, Apr 16, 5:33 PM
This revision was automatically updated to reflect the committed changes.