Skip to content

Commit 1614d63

Browse files
committed
[NFC] Remove unused codes after 4a7be42
There are still some unused codes remained after 4a7be42. And this patch tries to remove them.
1 parent d584468 commit 1614d63

File tree

7 files changed

+5
-18
lines changed

7 files changed

+5
-18
lines changed

clang/include/clang/Basic/DiagnosticFrontendKinds.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,6 @@ def err_module_build_requires_fmodules : Error<
213213
"module compilation requires '-fmodules'">;
214214
def err_module_interface_requires_cpp_modules : Error<
215215
"module interface compilation requires '-std=c++20' or '-fmodules-ts'">;
216-
def err_header_module_requires_modules : Error<
217-
"header module compilation requires '-fmodules', '-std=c++20', or "
218-
"'-fmodules-ts'">;
219216
def warn_module_config_mismatch : Warning<
220217
"module file %0 cannot be loaded due to a configuration mismatch with the current "
221218
"compilation">, InGroup<DiagGroup<"module-file-config-mismatch">>, DefaultError;

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11095,7 +11095,7 @@ def err_invalid_type_for_program_scope_var : Error<
1109511095
let CategoryName = "Modules Issue" in {
1109611096
def err_module_decl_in_module_map_module : Error<
1109711097
"'module' declaration found while building module from module map">;
11098-
def err_module_decl_in_header_module : Error<
11098+
def err_module_decl_in_header_unit : Error<
1109911099
"'module' declaration found while building header unit">;
1110011100
def err_module_interface_implementation_mismatch : Error<
1110111101
"missing 'export' specifier in module declaration while "

clang/include/clang/Basic/LangOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,6 @@ class LangOptions : public LangOptionsBase {
110110
/// Compiling a module from a module map.
111111
CMK_ModuleMap,
112112

113-
/// Compiling a module from a list of header files.
114-
CMK_HeaderModule,
115-
116113
/// Compiling a module header unit.
117114
CMK_HeaderUnit,
118115

clang/include/clang/Driver/Action.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ class Action {
5858
OffloadClass,
5959
PreprocessJobClass,
6060
PrecompileJobClass,
61-
HeaderModulePrecompileJobClass,
6261
ExtractAPIJobClass,
6362
AnalyzeJobClass,
6463
MigrateJobClass,
@@ -431,8 +430,7 @@ class PrecompileJobAction : public JobAction {
431430
PrecompileJobAction(Action *Input, types::ID OutputType);
432431

433432
static bool classof(const Action *A) {
434-
return A->getKind() == PrecompileJobClass ||
435-
A->getKind() == HeaderModulePrecompileJobClass;
433+
return A->getKind() == PrecompileJobClass;
436434
}
437435
};
438436

clang/lib/Driver/ToolChain.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,6 @@ Tool *ToolChain::getTool(Action::ActionClass AC) const {
395395

396396
case Action::CompileJobClass:
397397
case Action::PrecompileJobClass:
398-
case Action::HeaderModulePrecompileJobClass:
399398
case Action::PreprocessJobClass:
400399
case Action::ExtractAPIJobClass:
401400
case Action::AnalyzeJobClass:

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4558,11 +4558,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
45584558
InputInfo ExtractAPIPlaceholderInput(Inputs[0].getType(), "extract-api",
45594559
"extract-api");
45604560

4561-
const InputInfo &Input = [&]() -> const InputInfo & {
4562-
if (IsExtractAPI)
4563-
return ExtractAPIPlaceholderInput;
4564-
return Inputs[0];
4565-
}();
4561+
const InputInfo &Input =
4562+
IsExtractAPI ? ExtractAPIPlaceholderInput : Inputs[0];
45664563

45674564
InputInfoList ExtractAPIInputs;
45684565
InputInfoList HostOffloadingInputs;

clang/lib/Sema/SemaModule.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,8 @@ Sema::ActOnModuleDecl(SourceLocation StartLoc, SourceLocation ModuleLoc,
225225
Diag(ModuleLoc, diag::err_module_decl_in_module_map_module);
226226
return nullptr;
227227

228-
case LangOptions::CMK_HeaderModule:
229228
case LangOptions::CMK_HeaderUnit:
230-
Diag(ModuleLoc, diag::err_module_decl_in_header_module);
229+
Diag(ModuleLoc, diag::err_module_decl_in_header_unit);
231230
return nullptr;
232231
}
233232

0 commit comments

Comments
 (0)