Page MenuHomePhabricator

Keep a list of already-included pragma-once files for mods.
Needs ReviewPublic

Authored by oontvoo on Tue, Mar 10, 11:30 AM.

Details

Reviewers
jyknight
Summary

Keep a set of already-included pragma-once files for mods.

Diff Detail

Unit TestsFailed

TimeTest
30 msClang.Modules::header-in-imported-module.c
Script: -- : 'RUN: at line 1'; rm -rf /mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/build/tools/clang/test/Modules/Output/header-in-imported-module.c.tmp
130 msClang.PCH::include-timestamp.cpp
Script: -- : 'RUN: at line 4'; mkdir -p /mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/build/tools/clang/test/PCH/Output/include-timestamp.cpp.tmp-dir

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
oontvoo updated this revision to Diff 249717.Wed, Mar 11, 12:00 PM

Wrong name

I suspect we also need to support saving/loading some of this information in the serialized AST, e.g. clang/lib/Serialization/ASTWriter.cpp has code to save the HeaderInfo data, around line 1650. And around line 2174, code to save the macros per submodule. We'll also need to save the pragma-once-header-state per-submodule too, I think.

clang/lib/Lex/HeaderSearch.cpp
1313

I don't think whether the header you're trying to include is modular or not (isModuleHeader) should matter here, just whether we have a current module M or not.

1315

I wonder if this should be just using the CurSubmoduleState. Actually, is "M" even needed in this function at all -- why isn't everything just using CurSubmoduleState? (It's very likely I'm just confused about what the semantics of this are...).

oontvoo marked an inline comment as done.Mon, Mar 16, 2:16 PM
oontvoo added inline comments.
clang/lib/Lex/HeaderSearch.cpp
1315

"Is M needed ... ?"

Yes - I think so because if we're looking at Module header, then I *think* the header's content will/should be visible to the submods in it.

On the other hand (ie., the else branch), if we're looking a "regular" header, then it should not be visible to the submods

oontvoo marked an inline comment as done and an inline comment as not done.Mon, Mar 16, 2:23 PM
oontvoo added inline comments.
clang/lib/Lex/HeaderSearch.cpp
1315

[not done - re-opening for question]

oontvoo marked an inline comment as not done.Mon, Mar 16, 2:38 PM
oontvoo updated this revision to Diff 251801.Fri, Mar 20, 4:40 PM
oontvoo marked an inline comment as done.

Additional change: Also keep "Importers" and de/serialise these.

oontvoo updated this revision to Diff 251804.Fri, Mar 20, 4:52 PM

Removed accidentally committed file.

oontvoo updated this revision to Diff 252110.Mon, Mar 23, 11:38 AM

Updated the reader to read the UIDs first, then we'll build up the Importers list at the end.

oontvoo updated this revision to Diff 252117.Mon, Mar 23, 12:14 PM
oontvoo marked an inline comment as done.

Add a PendingHeaderSearch set

oontvoo updated this revision to Diff 252118.Mon, Mar 23, 12:20 PM

Clear pending action.

oontvoo updated this revision to Diff 252203.Mon, Mar 23, 7:48 PM

(hopefully) Final revision ... running out of idea for edit comment

oontvoo updated this revision to Diff 252205.Mon, Mar 23, 8:01 PM

Fix build errors

oontvoo updated this revision to Diff 252206.Mon, Mar 23, 8:07 PM

Clang format

Harbormaster failed remote builds in B50204: Diff 252206!
Harbormaster failed remote builds in B50203: Diff 252205!
oontvoo updated this revision to Diff 252371.Tue, Mar 24, 10:38 AM

clang format

oontvoo marked an inline comment as done.Tue, Mar 24, 10:40 AM

Addressed comments. PTAL. Thanks!

@jyknight Actually, please hold on on the review ... still working on it

oontvoo updated this revision to Diff 252685.Wed, Mar 25, 3:06 PM

Handle the case where the file is first seen

oontvoo updated this revision to Diff 252728.Wed, Mar 25, 7:06 PM

Typo - missing ! operator

oontvoo updated this revision to Diff 252735.Wed, Mar 25, 8:45 PM

<No comment>

oontvoo updated this revision to Diff 252768.Thu, Mar 26, 1:46 AM

Handle textual headers

oontvoo updated this revision to Diff 252791.Thu, Mar 26, 4:01 AM

Handle includes/import from outer mods

oontvoo updated this revision to Diff 253155.Fri, Mar 27, 9:53 AM

Also serialise non-mods' imported headers

oontvoo updated this revision to Diff 253162.Fri, Mar 27, 10:22 AM

Add tests

oontvoo updated this revision to Diff 253175.Fri, Mar 27, 11:20 AM

Merge master

oontvoo updated this revision to Diff 253245.Fri, Mar 27, 4:05 PM

Updated tests and get it to pass

oontvoo updated this revision to Diff 253289.Fri, Mar 27, 8:57 PM

cleanup logging

oontvoo updated this revision to Diff 253382.Sat, Mar 28, 3:41 PM

Update tests

oontvoo updated this revision to Diff 253388.Sat, Mar 28, 6:29 PM

Add more tests (From Bug 39206)