Skip to content

Commit 4357175

Browse files
authored
[re-format][Modules] Follow-up formatting to "Mention which AST file's options differ from the current TU options." (#102484)
Fix formatting for fdf8e3e.
1 parent 22a1302 commit 4357175

File tree

4 files changed

+208
-168
lines changed

4 files changed

+208
-168
lines changed

clang/include/clang/Serialization/ASTReader.h

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ class ASTReaderListener {
130130
///
131131
/// \returns true to indicate the options are invalid or false otherwise.
132132
virtual bool ReadLanguageOptions(const LangOptions &LangOpts,
133-
StringRef ModuleFilename,
134-
bool Complain,
133+
StringRef ModuleFilename, bool Complain,
135134
bool AllowCompatibleDifferences) {
136135
return false;
137136
}
@@ -140,7 +139,8 @@ class ASTReaderListener {
140139
///
141140
/// \returns true to indicate the target options are invalid, or false
142141
/// otherwise.
143-
virtual bool ReadTargetOptions(const TargetOptions &TargetOpts, StringRef ModuleFilename, bool Complain,
142+
virtual bool ReadTargetOptions(const TargetOptions &TargetOpts,
143+
StringRef ModuleFilename, bool Complain,
144144
bool AllowCompatibleDifferences) {
145145
return false;
146146
}
@@ -151,8 +151,7 @@ class ASTReaderListener {
151151
/// otherwise.
152152
virtual bool
153153
ReadDiagnosticOptions(IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts,
154-
StringRef ModuleFilename,
155-
bool Complain) {
154+
StringRef ModuleFilename, bool Complain) {
156155
return false;
157156
}
158157

@@ -266,13 +265,14 @@ class ChainedASTReaderListener : public ASTReaderListener {
266265
bool ReadFullVersionInformation(StringRef FullVersion) override;
267266
void ReadModuleName(StringRef ModuleName) override;
268267
void ReadModuleMapFile(StringRef ModuleMapPath) override;
269-
bool ReadLanguageOptions(const LangOptions &LangOpts, StringRef ModuleFilename, bool Complain,
268+
bool ReadLanguageOptions(const LangOptions &LangOpts,
269+
StringRef ModuleFilename, bool Complain,
270270
bool AllowCompatibleDifferences) override;
271-
bool ReadTargetOptions(const TargetOptions &TargetOpts, StringRef ModuleFilename, bool Complain,
271+
bool ReadTargetOptions(const TargetOptions &TargetOpts,
272+
StringRef ModuleFilename, bool Complain,
272273
bool AllowCompatibleDifferences) override;
273274
bool ReadDiagnosticOptions(IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts,
274-
StringRef ModuleFilename,
275-
bool Complain) override;
275+
StringRef ModuleFilename, bool Complain) override;
276276
bool ReadFileSystemOptions(const FileSystemOptions &FSOpts,
277277
bool Complain) override;
278278

@@ -281,8 +281,8 @@ class ChainedASTReaderListener : public ASTReaderListener {
281281
StringRef SpecificModuleCachePath,
282282
bool Complain) override;
283283
bool ReadPreprocessorOptions(const PreprocessorOptions &PPOpts,
284-
StringRef ModuleFilename,
285-
bool ReadMacros, bool Complain,
284+
StringRef ModuleFilename, bool ReadMacros,
285+
bool Complain,
286286
std::string &SuggestedPredefines) override;
287287

288288
void ReadCounter(const serialization::ModuleFile &M, unsigned Value) override;
@@ -306,16 +306,17 @@ class PCHValidator : public ASTReaderListener {
306306
PCHValidator(Preprocessor &PP, ASTReader &Reader)
307307
: PP(PP), Reader(Reader) {}
308308

309-
bool ReadLanguageOptions(const LangOptions &LangOpts, StringRef ModuleFilename, bool Complain,
309+
bool ReadLanguageOptions(const LangOptions &LangOpts,
310+
StringRef ModuleFilename, bool Complain,
310311
bool AllowCompatibleDifferences) override;
311-
bool ReadTargetOptions(const TargetOptions &TargetOpts, StringRef ModuleFilename, bool Complain,
312+
bool ReadTargetOptions(const TargetOptions &TargetOpts,
313+
StringRef ModuleFilename, bool Complain,
312314
bool AllowCompatibleDifferences) override;
313315
bool ReadDiagnosticOptions(IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts,
314-
StringRef ModuleFilename,
315-
bool Complain) override;
316+
StringRef ModuleFilename, bool Complain) override;
316317
bool ReadPreprocessorOptions(const PreprocessorOptions &PPOpts,
317-
StringRef ModuleFilename,
318-
bool ReadMacros, bool Complain,
318+
StringRef ModuleFilename, bool ReadMacros,
319+
bool Complain,
319320
std::string &SuggestedPredefines) override;
320321
bool ReadHeaderSearchOptions(const HeaderSearchOptions &HSOpts,
321322
StringRef ModuleFilename,
@@ -335,8 +336,8 @@ class SimpleASTReaderListener : public ASTReaderListener {
335336
SimpleASTReaderListener(Preprocessor &PP) : PP(PP) {}
336337

337338
bool ReadPreprocessorOptions(const PreprocessorOptions &PPOpts,
338-
StringRef ModuleFilename,
339-
bool ReadMacros, bool Complain,
339+
StringRef ModuleFilename, bool ReadMacros,
340+
bool Complain,
340341
std::string &SuggestedPredefines) override;
341342
};
342343

@@ -1377,10 +1378,12 @@ class ASTReader
13771378
SmallVectorImpl<ImportedModule> &Loaded,
13781379
const ModuleFile *ImportedBy,
13791380
unsigned ClientLoadCapabilities);
1380-
static ASTReadResult ReadOptionsBlock(
1381-
llvm::BitstreamCursor &Stream, StringRef Filename, unsigned ClientLoadCapabilities,
1382-
bool AllowCompatibleConfigurationMismatch, ASTReaderListener &Listener,
1383-
std::string &SuggestedPredefines);
1381+
static ASTReadResult
1382+
ReadOptionsBlock(llvm::BitstreamCursor &Stream, StringRef Filename,
1383+
unsigned ClientLoadCapabilities,
1384+
bool AllowCompatibleConfigurationMismatch,
1385+
ASTReaderListener &Listener,
1386+
std::string &SuggestedPredefines);
13841387

13851388
/// Read the unhashed control block.
13861389
///
@@ -1389,13 +1392,11 @@ class ASTReader
13891392
ASTReadResult readUnhashedControlBlock(ModuleFile &F, bool WasImportedBy,
13901393
unsigned ClientLoadCapabilities);
13911394

1392-
static ASTReadResult
1393-
readUnhashedControlBlockImpl(ModuleFile *F, llvm::StringRef StreamData,
1394-
StringRef Filename,
1395-
unsigned ClientLoadCapabilities,
1396-
bool AllowCompatibleConfigurationMismatch,
1397-
ASTReaderListener *Listener,
1398-
bool ValidateDiagnosticOptions);
1395+
static ASTReadResult readUnhashedControlBlockImpl(
1396+
ModuleFile *F, llvm::StringRef StreamData, StringRef Filename,
1397+
unsigned ClientLoadCapabilities,
1398+
bool AllowCompatibleConfigurationMismatch, ASTReaderListener *Listener,
1399+
bool ValidateDiagnosticOptions);
13991400

14001401
llvm::Error ReadASTBlock(ModuleFile &F, unsigned ClientLoadCapabilities);
14011402
llvm::Error ReadExtensionBlock(ModuleFile &F);
@@ -1408,21 +1409,26 @@ class ASTReader
14081409
unsigned ClientLoadCapabilities);
14091410
llvm::Error ReadSubmoduleBlock(ModuleFile &F,
14101411
unsigned ClientLoadCapabilities);
1411-
static bool ParseLanguageOptions(const RecordData &Record, StringRef ModuleFilename, bool Complain,
1412+
static bool ParseLanguageOptions(const RecordData &Record,
1413+
StringRef ModuleFilename, bool Complain,
14121414
ASTReaderListener &Listener,
14131415
bool AllowCompatibleDifferences);
1414-
static bool ParseTargetOptions(const RecordData &Record, StringRef ModuleFilename, bool Complain,
1416+
static bool ParseTargetOptions(const RecordData &Record,
1417+
StringRef ModuleFilename, bool Complain,
14151418
ASTReaderListener &Listener,
14161419
bool AllowCompatibleDifferences);
1417-
static bool ParseDiagnosticOptions(const RecordData &Record, StringRef ModuleFilename, bool Complain,
1420+
static bool ParseDiagnosticOptions(const RecordData &Record,
1421+
StringRef ModuleFilename, bool Complain,
14181422
ASTReaderListener &Listener);
14191423
static bool ParseFileSystemOptions(const RecordData &Record, bool Complain,
14201424
ASTReaderListener &Listener);
1421-
static bool ParseHeaderSearchOptions(const RecordData &Record, StringRef ModuleFilename, bool Complain,
1425+
static bool ParseHeaderSearchOptions(const RecordData &Record,
1426+
StringRef ModuleFilename, bool Complain,
14221427
ASTReaderListener &Listener);
14231428
static bool ParseHeaderSearchPaths(const RecordData &Record, bool Complain,
14241429
ASTReaderListener &Listener);
1425-
static bool ParsePreprocessorOptions(const RecordData &Record, StringRef ModuleFilename, bool Complain,
1430+
static bool ParsePreprocessorOptions(const RecordData &Record,
1431+
StringRef ModuleFilename, bool Complain,
14261432
ASTReaderListener &Listener,
14271433
std::string &SuggestedPredefines);
14281434

clang/lib/Frontend/ASTUnit.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,8 @@ class ASTInfoCollector : public ASTReaderListener {
536536
LangOpt(LangOpt), TargetOpts(TargetOpts), Target(Target),
537537
Counter(Counter) {}
538538

539-
bool ReadLanguageOptions(const LangOptions &LangOpts, StringRef ModuleFilename, bool Complain,
539+
bool ReadLanguageOptions(const LangOptions &LangOpts,
540+
StringRef ModuleFilename, bool Complain,
540541
bool AllowCompatibleDifferences) override {
541542
if (InitializedLanguage)
542543
return false;
@@ -598,14 +599,15 @@ class ASTInfoCollector : public ASTReaderListener {
598599
}
599600

600601
bool ReadPreprocessorOptions(const PreprocessorOptions &PPOpts,
601-
StringRef ModuleFilename,
602-
bool ReadMacros, bool Complain,
602+
StringRef ModuleFilename, bool ReadMacros,
603+
bool Complain,
603604
std::string &SuggestedPredefines) override {
604605
this->PPOpts = PPOpts;
605606
return false;
606607
}
607608

608-
bool ReadTargetOptions(const TargetOptions &TargetOpts, StringRef ModuleFilename, bool Complain,
609+
bool ReadTargetOptions(const TargetOptions &TargetOpts,
610+
StringRef ModuleFilename, bool Complain,
609611
bool AllowCompatibleDifferences) override {
610612
// If we've already initialized the target, don't do it again.
611613
if (Target)

clang/lib/Frontend/FrontendActions.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,8 @@ namespace {
622622
Out.indent(2) << "Module map file: " << ModuleMapPath << "\n";
623623
}
624624

625-
bool ReadLanguageOptions(const LangOptions &LangOpts, StringRef ModuleFilename, bool Complain,
625+
bool ReadLanguageOptions(const LangOptions &LangOpts,
626+
StringRef ModuleFilename, bool Complain,
626627
bool AllowCompatibleDifferences) override {
627628
Out.indent(2) << "Language options:\n";
628629
#define LANGOPT(Name, Bits, Default, Description) \
@@ -645,7 +646,8 @@ namespace {
645646
return false;
646647
}
647648

648-
bool ReadTargetOptions(const TargetOptions &TargetOpts, StringRef ModuleFilename, bool Complain,
649+
bool ReadTargetOptions(const TargetOptions &TargetOpts,
650+
StringRef ModuleFilename, bool Complain,
649651
bool AllowCompatibleDifferences) override {
650652
Out.indent(2) << "Target options:\n";
651653
Out.indent(4) << " Triple: " << TargetOpts.Triple << "\n";
@@ -665,7 +667,8 @@ namespace {
665667
}
666668

667669
bool ReadDiagnosticOptions(IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts,
668-
StringRef ModuleFilename, bool Complain) override {
670+
StringRef ModuleFilename,
671+
bool Complain) override {
669672
Out.indent(2) << "Diagnostic options:\n";
670673
#define DIAGOPT(Name, Bits, Default) DUMP_BOOLEAN(DiagOpts->Name, #Name);
671674
#define ENUM_DIAGOPT(Name, Type, Bits, Default) \
@@ -718,8 +721,8 @@ namespace {
718721
}
719722

720723
bool ReadPreprocessorOptions(const PreprocessorOptions &PPOpts,
721-
StringRef ModuleFilename,
722-
bool ReadMacros, bool Complain,
724+
StringRef ModuleFilename, bool ReadMacros,
725+
bool Complain,
723726
std::string &SuggestedPredefines) override {
724727
Out.indent(2) << "Preprocessor options:\n";
725728
DUMP_BOOLEAN(PPOpts.UsePredefines,

0 commit comments

Comments
 (0)