Skip to content

Commit 9cad088

Browse files
committed
fixup! [ASTWriter] Do not allocate source location space for module maps used only for textual headers
Add _ to the enumerator names
1 parent 5611185 commit 9cad088

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ GetAffectingModuleMaps(const Preprocessor &PP, Module *RootModule) {
187187
// Module maps used only by textual headers are special. Their FileID is
188188
// non-affecting, but their FileEntry is (i.e. must be written as InputFile).
189189
enum AffectedReason : bool {
190-
ARTextualHeader = 0,
191-
ARImportOrTextualHeader = 1,
190+
AR_TextualHeader = 0,
191+
AR_ImportOrTextualHeader = 1,
192192
};
193193
auto AssignMostImportant = [](AffectedReason &L, AffectedReason R) {
194194
L = std::max(L, R);
@@ -232,7 +232,7 @@ GetAffectingModuleMaps(const Preprocessor &PP, Module *RootModule) {
232232

233233
// Handle all the affecting modules referenced from the root module.
234234

235-
CollectModuleMapsForHierarchy(RootModule, ARImportOrTextualHeader);
235+
CollectModuleMapsForHierarchy(RootModule, AR_ImportOrTextualHeader);
236236

237237
std::queue<const Module *> Q;
238238
Q.push(RootModule);
@@ -241,9 +241,9 @@ GetAffectingModuleMaps(const Preprocessor &PP, Module *RootModule) {
241241
Q.pop();
242242

243243
for (const Module *ImportedModule : CurrentModule->Imports)
244-
CollectModuleMapsForHierarchy(ImportedModule, ARImportOrTextualHeader);
244+
CollectModuleMapsForHierarchy(ImportedModule, AR_ImportOrTextualHeader);
245245
for (const Module *UndeclaredModule : CurrentModule->UndeclaredUses)
246-
CollectModuleMapsForHierarchy(UndeclaredModule, ARImportOrTextualHeader);
246+
CollectModuleMapsForHierarchy(UndeclaredModule, AR_ImportOrTextualHeader);
247247

248248
for (auto *M : CurrentModule->submodules())
249249
Q.push(M);
@@ -272,7 +272,7 @@ GetAffectingModuleMaps(const Preprocessor &PP, Module *RootModule) {
272272

273273
for (const auto &KH : HS.findResolvedModulesForHeader(*File))
274274
if (const Module *M = KH.getModule())
275-
CollectModuleMapsForHierarchy(M, ARTextualHeader);
275+
CollectModuleMapsForHierarchy(M, AR_TextualHeader);
276276
}
277277

278278
// FIXME: This algorithm is not correct for module map hierarchies where
@@ -296,7 +296,7 @@ GetAffectingModuleMaps(const Preprocessor &PP, Module *RootModule) {
296296
llvm::DenseSet<const FileEntry *> ModuleFileEntries;
297297
llvm::DenseSet<FileID> ModuleFileIDs;
298298
for (auto [FID, Reason] : ModuleMaps) {
299-
if (Reason == ARImportOrTextualHeader)
299+
if (Reason == AR_ImportOrTextualHeader)
300300
ModuleFileIDs.insert(FID);
301301
if (auto *FE = SM.getFileEntryForID(FID))
302302
ModuleFileEntries.insert(FE);

0 commit comments

Comments
 (0)