From: Douglas Gregor Date: Tue, 29 Nov 2011 22:42:06 +0000 (+0000) Subject: Eliminate the -emit-module option, which emitted a module by parsing a X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6649014b792f8a4b1bc1e8be8f844a72220af508;p=clang Eliminate the -emit-module option, which emitted a module by parsing a source file (e.g., a header). Immediately steal this useful option name for building modules from a module map file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145444 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index 01e4e4b687..6525d24d18 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -378,9 +378,7 @@ def ast_view : Flag<"-ast-view">, def print_decl_contexts : Flag<"-print-decl-contexts">, HelpText<"Print DeclContexts and their Decls">; def emit_module : Flag<"-emit-module">, - HelpText<"Generate pre-compiled module file">; -def emit_module_from_map : Flag<"-emit-module-from-map">, - HelpText<"Generate pre-compiled module file from module map">; + HelpText<"Generate pre-compiled module file from a module map">; def emit_pth : Flag<"-emit-pth">, HelpText<"Generate pre-tokenized header file">; def emit_pch : Flag<"-emit-pch">, diff --git a/include/clang/Frontend/FrontendActions.h b/include/clang/Frontend/FrontendActions.h index 19d8c520c3..0c78a06746 100644 --- a/include/clang/Frontend/FrontendActions.h +++ b/include/clang/Frontend/FrontendActions.h @@ -80,9 +80,6 @@ protected: virtual bool hasASTFileSupport() const { return false; } public: - /// \brief Create a new action - explicit GeneratePCHAction(bool MakeModule) : MakeModule(MakeModule) { } - /// \brief Compute the AST consumer arguments that will be used to /// create the PCHGenerator instance returned by CreateASTConsumer. /// diff --git a/include/clang/Frontend/FrontendOptions.h b/include/clang/Frontend/FrontendOptions.h index 6e3d7a39c9..fa6d044ce0 100644 --- a/include/clang/Frontend/FrontendOptions.h +++ b/include/clang/Frontend/FrontendOptions.h @@ -35,7 +35,6 @@ namespace frontend { EmitObj, ///< Emit a .o file. FixIt, ///< Parse and apply any fixits to the source. GenerateModule, ///< Generate pre-compiled module. - GenerateModuleFromMap, ///< Generate pre-compiled module from module map. GeneratePCH, ///< Generate pre-compiled header. GeneratePTH, ///< Generate pre-tokenized header. InitOnly, ///< Only execute frontend initialization. diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 4977b4f30a..6b5c8cf5b5 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -409,7 +409,6 @@ static const char *getActionName(frontend::ActionKind Kind) { case frontend::EmitObj: return "-emit-obj"; case frontend::FixIt: return "-fixit"; case frontend::GenerateModule: return "-emit-module"; - case frontend::GenerateModuleFromMap: return "-emit-module-from-map"; case frontend::GeneratePCH: return "-emit-pch"; case frontend::GeneratePTH: return "-emit-pth"; case frontend::InitOnly: return "-init-only"; @@ -1274,8 +1273,6 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args, Opts.ProgramAction = frontend::FixIt; break; case OPT_emit_module: Opts.ProgramAction = frontend::GenerateModule; break; - case OPT_emit_module_from_map: - Opts.ProgramAction = frontend::GenerateModuleFromMap; break; case OPT_emit_pch: Opts.ProgramAction = frontend::GeneratePCH; break; case OPT_emit_pth: diff --git a/lib/Frontend/FrontendActions.cpp b/lib/Frontend/FrontendActions.cpp index 8e2e21564f..418dbf4cd8 100644 --- a/lib/Frontend/FrontendActions.cpp +++ b/lib/Frontend/FrontendActions.cpp @@ -86,7 +86,7 @@ ASTConsumer *GeneratePCHAction::CreateASTConsumer(CompilerInstance &CI, if (!CI.getFrontendOpts().RelocatablePCH) Sysroot.clear(); - return new PCHGenerator(CI.getPreprocessor(), OutputFile, MakeModule, + return new PCHGenerator(CI.getPreprocessor(), OutputFile, /*Module=*/false, Sysroot, OS); } diff --git a/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/lib/FrontendTool/ExecuteCompilerInvocation.cpp index db76886095..fec12e3b11 100644 --- a/lib/FrontendTool/ExecuteCompilerInvocation.cpp +++ b/lib/FrontendTool/ExecuteCompilerInvocation.cpp @@ -49,9 +49,8 @@ static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) { case EmitCodeGenOnly: return new EmitCodeGenOnlyAction(); case EmitObj: return new EmitObjAction(); case FixIt: return new FixItAction(); - case GenerateModule: return new GeneratePCHAction(true); - case GenerateModuleFromMap: return new GenerateModuleAction; - case GeneratePCH: return new GeneratePCHAction(false); + case GenerateModule: return new GenerateModuleAction; + case GeneratePCH: return new GeneratePCHAction; case GeneratePTH: return new GeneratePTHAction(); case InitOnly: return new InitOnlyAction(); case ParseSyntaxOnly: return new SyntaxOnlyAction(); diff --git a/test/Modules/diamond.c b/test/Modules/diamond.c index 195e1da456..59181c533d 100644 --- a/test/Modules/diamond.c +++ b/test/Modules/diamond.c @@ -21,8 +21,8 @@ void test_diamond(int i, float f, double d, char c) { } // RUN: rm -rf %t -// RUN: %clang_cc1 -emit-module-from-map -fmodule-cache-path %t -fmodule-name=diamond_top %S/Inputs/module.map -// RUN: %clang_cc1 -emit-module-from-map -fmodule-cache-path %t -fmodule-name=diamond_left %S/Inputs/module.map -// RUN: %clang_cc1 -emit-module-from-map -fmodule-cache-path %t -fmodule-name=diamond_right %S/Inputs/module.map -// RUN: %clang_cc1 -emit-module-from-map -fmodule-cache-path %t -fmodule-name=diamond_bottom %S/Inputs/module.map +// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=diamond_top %S/Inputs/module.map +// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=diamond_left %S/Inputs/module.map +// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=diamond_right %S/Inputs/module.map +// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=diamond_bottom %S/Inputs/module.map // RUN: %clang_cc1 -fmodule-cache-path %t %s -verify diff --git a/test/Modules/irgen.c b/test/Modules/irgen.c index 6479f06b26..a3d5aa0534 100644 --- a/test/Modules/irgen.c +++ b/test/Modules/irgen.c @@ -1,5 +1,5 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -fmodule-cache-path %t -emit-module-from-map -fmodule-name=irgen -triple x86_64-apple-darwin10 %S/Inputs/module.map +// RUN: %clang_cc1 -fmodule-cache-path %t -emit-module -fmodule-name=irgen -triple x86_64-apple-darwin10 %S/Inputs/module.map // RUN: %clang_cc1 -fmodule-cache-path %t -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s __import_module__ irgen; diff --git a/test/Modules/load_failure.c b/test/Modules/load_failure.c index d33b7cf398..e278eb5aff 100644 --- a/test/Modules/load_failure.c +++ b/test/Modules/load_failure.c @@ -7,7 +7,7 @@ __import_module__ load_failure; #endif // RUN: rm -rf %t -// RUN: %clang_cc1 -x c++ -fmodule-cache-path %t -fdisable-module-hash -emit-module-from-map -fmodule-name=load_failure %S/Inputs/module.map +// RUN: %clang_cc1 -x c++ -fmodule-cache-path %t -fdisable-module-hash -emit-module -fmodule-name=load_failure %S/Inputs/module.map // RUN: %clang_cc1 -fmodule-cache-path %t -fdisable-module-hash %s -DNONEXISTENT 2>&1 | FileCheck -check-prefix=CHECK-NONEXISTENT %s // CHECK-NONEXISTENT: load_failure.c:2:19: fatal error: module 'load_nonexistent' not found diff --git a/test/Modules/lookup.cpp b/test/Modules/lookup.cpp index 30177dc73c..2bb53da66f 100644 --- a/test/Modules/lookup.cpp +++ b/test/Modules/lookup.cpp @@ -15,8 +15,8 @@ void test(int i, float f) { } // RUN: rm -rf %t -// RUN: %clang_cc1 -emit-module-from-map -fmodule-cache-path %t -fmodule-name=lookup_left_cxx -x c++ %S/Inputs/module.map -verify -// RUN: %clang_cc1 -emit-module-from-map -fmodule-cache-path %t -fmodule-name=lookup_right_cxx -x c++ %S/Inputs/module.map -verify +// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=lookup_left_cxx -x c++ %S/Inputs/module.map -verify +// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=lookup_right_cxx -x c++ %S/Inputs/module.map -verify // RUN: %clang_cc1 -x c++ -fmodule-cache-path %t %s -verify // RUN: %clang_cc1 -ast-print -x c++ -fmodule-cache-path %t %s | FileCheck -check-prefix=CHECK-PRINT %s diff --git a/test/Modules/lookup.m b/test/Modules/lookup.m index ff2df9807f..29713fd769 100644 --- a/test/Modules/lookup.m +++ b/test/Modules/lookup.m @@ -9,8 +9,8 @@ void test(id x) { } // RUN: rm -rf %t -// RUN: %clang_cc1 -fmodule-cache-path %t -emit-module-from-map -x objective-c -fmodule-name=lookup_left_objc %S/Inputs/module.map -// RUN: %clang_cc1 -fmodule-cache-path %t -emit-module-from-map -x objective-c -fmodule-name=lookup_right_objc %S/Inputs/module.map +// RUN: %clang_cc1 -fmodule-cache-path %t -emit-module -x objective-c -fmodule-name=lookup_left_objc %S/Inputs/module.map +// RUN: %clang_cc1 -fmodule-cache-path %t -emit-module -x objective-c -fmodule-name=lookup_right_objc %S/Inputs/module.map // RUN: %clang_cc1 -x objective-c -fmodule-cache-path %t -verify %s // RUN: %clang_cc1 -ast-print -x objective-c -fmodule-cache-path %t %s | FileCheck -check-prefix=CHECK-PRINT %s diff --git a/test/Modules/macros.c b/test/Modules/macros.c index 3eb0dbb3be..0b58133dcf 100644 --- a/test/Modules/macros.c +++ b/test/Modules/macros.c @@ -1,5 +1,5 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -emit-module-from-map -fmodule-cache-path %t -fmodule-name=macros %S/Inputs/module.map +// RUN: %clang_cc1 -emit-module -fmodule-cache-path %t -fmodule-name=macros %S/Inputs/module.map // RUN: %clang_cc1 -verify -fmodule-cache-path %t %s // RUN: %clang_cc1 -E -fmodule-cache-path %t %s | FileCheck -check-prefix CHECK-PREPROCESSED %s diff --git a/test/Modules/module-private.cpp b/test/Modules/module-private.cpp index 500c587010..eb932a8eb8 100644 --- a/test/Modules/module-private.cpp +++ b/test/Modules/module-private.cpp @@ -1,6 +1,6 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -fmodule-cache-path %t -fmodule-name=module_private_left -x c++ -emit-module-from-map %S/Inputs/module.map -// RUN: %clang_cc1 -fmodule-cache-path %t -fmodule-name=module_private_right -x c++ -emit-module-from-map %S/Inputs/module.map +// RUN: %clang_cc1 -fmodule-cache-path %t -fmodule-name=module_private_left -x c++ -emit-module %S/Inputs/module.map +// RUN: %clang_cc1 -fmodule-cache-path %t -fmodule-name=module_private_right -x c++ -emit-module %S/Inputs/module.map // RUN: %clang_cc1 -fmodule-cache-path %t %s -verify __import_module__ module_private_left; diff --git a/test/Modules/objc-categories.m b/test/Modules/objc-categories.m index 598687dedc..70a6bf8dd1 100644 --- a/test/Modules/objc-categories.m +++ b/test/Modules/objc-categories.m @@ -1,8 +1,8 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -fmodule-cache-path %t -x objective-c -fmodule-name=category_top -emit-module-from-map %S/Inputs/module.map -// RUN: %clang_cc1 -fmodule-cache-path %t -x objective-c -fmodule-name=category_left -emit-module-from-map %S/Inputs/module.map -// RUN: %clang_cc1 -fmodule-cache-path %t -x objective-c -fmodule-name=category_right -emit-module-from-map %S/Inputs/module.map -// RUN: %clang_cc1 -fmodule-cache-path %t -x objective-c -fmodule-name=category_bottom -emit-module-from-map %S/Inputs/module.map +// RUN: %clang_cc1 -fmodule-cache-path %t -x objective-c -fmodule-name=category_top -emit-module %S/Inputs/module.map +// RUN: %clang_cc1 -fmodule-cache-path %t -x objective-c -fmodule-name=category_left -emit-module %S/Inputs/module.map +// RUN: %clang_cc1 -fmodule-cache-path %t -x objective-c -fmodule-name=category_right -emit-module %S/Inputs/module.map +// RUN: %clang_cc1 -fmodule-cache-path %t -x objective-c -fmodule-name=category_bottom -emit-module %S/Inputs/module.map // RUN: %clang_cc1 -fmodule-cache-path %t %s -verify __import_module__ category_bottom; diff --git a/test/Modules/redeclarations.m b/test/Modules/redeclarations.m index da856ac8d2..c00ca11f50 100644 --- a/test/Modules/redeclarations.m +++ b/test/Modules/redeclarations.m @@ -5,7 +5,7 @@ __import_module__ redeclarations_right; @end // RUN: rm -rf %t -// RUN: %clang_cc1 -x objective-c -fmodule-cache-path %t -emit-module-from-map -fmodule-name=redeclarations_left %S/Inputs/module.map -// RUN: %clang_cc1 -x objective-c -fmodule-cache-path %t -emit-module-from-map -fmodule-name=redeclarations_right %S/Inputs/module.map +// RUN: %clang_cc1 -x objective-c -fmodule-cache-path %t -emit-module -fmodule-name=redeclarations_left %S/Inputs/module.map +// RUN: %clang_cc1 -x objective-c -fmodule-cache-path %t -emit-module -fmodule-name=redeclarations_right %S/Inputs/module.map // RUN: %clang_cc1 -fmodule-cache-path %t %s -verify