Skip to content

Commit 525b733

Browse files
committed
Squash the new logic into the existing bit in PCM
1 parent 8c2989f commit 525b733

File tree

5 files changed

+6
-13
lines changed

5 files changed

+6
-13
lines changed

clang/include/clang/Serialization/ASTBitCodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace serialization {
4242
/// Version 4 of AST files also requires that the version control branch and
4343
/// revision match exactly, since there is no backward compatibility of
4444
/// AST files at this time.
45-
const unsigned VERSION_MAJOR = 31;
45+
const unsigned VERSION_MAJOR = 30;
4646

4747
/// AST file minor version number supported by this version of
4848
/// Clang.
@@ -52,7 +52,7 @@ const unsigned VERSION_MAJOR = 31;
5252
/// for the previous version could still support reading the new
5353
/// version by ignoring new kinds of subblocks), this number
5454
/// should be increased.
55-
const unsigned VERSION_MINOR = 0;
55+
const unsigned VERSION_MINOR = 1;
5656

5757
/// An ID number that refers to an identifier in an AST file.
5858
///

clang/include/clang/Serialization/ModuleFile.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ struct InputFileInfo {
6969
bool Overridden;
7070
bool Transient;
7171
bool TopLevel;
72-
bool TopLevelAmongAffecting;
7372
bool ModuleMap;
7473
};
7574

clang/lib/Serialization/ASTReader.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2444,10 +2444,9 @@ InputFileInfo ASTReader::getInputFileInfo(ModuleFile &F, unsigned ID) {
24442444
R.Overridden = static_cast<bool>(Record[3]);
24452445
R.Transient = static_cast<bool>(Record[4]);
24462446
R.TopLevel = static_cast<bool>(Record[5]);
2447-
R.TopLevelAmongAffecting = static_cast<bool>(Record[6]);
2448-
R.ModuleMap = static_cast<bool>(Record[7]);
2447+
R.ModuleMap = static_cast<bool>(Record[6]);
24492448
std::tie(R.FilenameAsRequested, R.Filename) = [&]() {
2450-
uint16_t AsRequestedLength = Record[8];
2449+
uint16_t AsRequestedLength = Record[7];
24512450

24522451
std::string NameAsRequested = Blob.substr(0, AsRequestedLength).str();
24532452
std::string Name = Blob.substr(AsRequestedLength).str();

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,6 @@ struct InputFileEntry {
16451645
bool IsTransient;
16461646
bool BufferOverridden;
16471647
bool IsTopLevel;
1648-
bool IsTopLevelAmongAffecting;
16491648
bool IsModuleMap;
16501649
uint32_t ContentHash[2];
16511650

@@ -1681,7 +1680,6 @@ void ASTWriter::WriteInputFiles(SourceManager &SourceMgr,
16811680
IFAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Overridden
16821681
IFAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Transient
16831682
IFAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Top-level
1684-
IFAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Top-level affect
16851683
IFAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Module map
16861684
IFAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 16)); // Name as req. len
16871685
IFAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // Name as req. + name
@@ -1720,9 +1718,7 @@ void ASTWriter::WriteInputFiles(SourceManager &SourceMgr,
17201718
Entry.IsSystemFile = isSystem(File.getFileCharacteristic());
17211719
Entry.IsTransient = Cache->IsTransient;
17221720
Entry.BufferOverridden = Cache->BufferOverridden;
1723-
Entry.IsTopLevel = File.getIncludeLoc().isInvalid();
1724-
Entry.IsTopLevelAmongAffecting =
1725-
getAffectingIncludeLoc(SourceMgr, File).isInvalid();
1721+
Entry.IsTopLevel = getAffectingIncludeLoc(SourceMgr, File).isInvalid();
17261722
Entry.IsModuleMap = isModuleMap(File.getFileCharacteristic());
17271723

17281724
auto ContentHash = hash_code(-1);
@@ -1788,7 +1784,6 @@ void ASTWriter::WriteInputFiles(SourceManager &SourceMgr,
17881784
Entry.BufferOverridden,
17891785
Entry.IsTransient,
17901786
Entry.IsTopLevel,
1791-
Entry.IsTopLevelAmongAffecting,
17921787
Entry.IsModuleMap,
17931788
NameAsRequested.size()};
17941789

clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ ModuleDepCollectorPP::handleTopLevelModule(const Module *M) {
616616
MDC.ScanInstance.getASTReader()->visitInputFileInfos(
617617
*MF, /*IncludeSystem=*/true,
618618
[&](const serialization::InputFileInfo &IFI, bool IsSystem) {
619-
if (!(IFI.TopLevelAmongAffecting && IFI.ModuleMap))
619+
if (!(IFI.TopLevel && IFI.ModuleMap))
620620
return;
621621
if (StringRef(IFI.FilenameAsRequested)
622622
.ends_with("__inferred_module.map"))

0 commit comments

Comments
 (0)