]> granicus.if.org Git - clang/commitdiff
Eliminate the -emit-module option, which emitted a module by parsing a
authorDouglas Gregor <dgregor@apple.com>
Tue, 29 Nov 2011 22:42:06 +0000 (22:42 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 29 Nov 2011 22:42:06 +0000 (22:42 +0000)
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

15 files changed:
include/clang/Driver/CC1Options.td
include/clang/Frontend/FrontendActions.h
include/clang/Frontend/FrontendOptions.h
lib/Frontend/CompilerInvocation.cpp
lib/Frontend/FrontendActions.cpp
lib/FrontendTool/ExecuteCompilerInvocation.cpp
test/Modules/diamond.c
test/Modules/irgen.c
test/Modules/load_failure.c
test/Modules/lookup.cpp
test/Modules/lookup.m
test/Modules/macros.c
test/Modules/module-private.cpp
test/Modules/objc-categories.m
test/Modules/redeclarations.m

index 01e4e4b687509c7fd4a61010a6f5780057eb9d5d..6525d24d18c46513d6acc3f013424a4efe320477 100644 (file)
@@ -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">,
index 19d8c520c36eb93aa3fe727b4a269fcbab421610..0c78a06746f69c0388ef7a9d0d5c0c13118ffd72 100644 (file)
@@ -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.
   ///
index 6e3d7a39c916f3f7fcb96ee8dd57c87ad991c848..fa6d044ce04b65d32f857dc14006ed423d18d977 100644 (file)
@@ -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.
index 4977b4f30aece23673353e046eeb98c941db6733..6b5c8cf5b568ad768cda506c51b319282f059ebb 100644 (file)
@@ -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:
index 8e2e21564ffee154561ae03a18932119c104f14c..418dbf4cd80fad74d524d28054d5bb81e56aa9cf 100644 (file)
@@ -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);
 }
 
index db76886095b250be978d7c1b36cf1d84692bb657..fec12e3b11db2fc7f9e820691bc202218e29aa9b 100644 (file)
@@ -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();
index 195e1da4563a6480b27fa0dc26cdde36591e87e5..59181c533d48f7c4431af6f7a81f17af4d8a5180 100644 (file)
@@ -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
index 6479f06b2696442128e75f190f61653565c77253..a3d5aa0534c5648864056c3758d5c439fe33bda8 100644 (file)
@@ -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;
index d33b7cf3986d41c1ffc00dbfbbbc5f45c88a37e4..e278eb5aff8fd45969c6599774ab7cfb9d31cd5a 100644 (file)
@@ -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
 
index 30177dc73c1c97515ddb9fc4cfd90b44f293273d..2bb53da66f14edf7d7ab6d3750ff4b0c52d0c91a 100644 (file)
@@ -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
 
index ff2df9807f63c349912dd25cd8a895025ffec26a..29713fd769ea7d5640e1cea0fc23b1bd09dfef0c 100644 (file)
@@ -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
 
index 3eb0dbb3be494511098cc252f9b54c6082f2f7fe..0b58133dcf77d31f31f1274e4511239ed2348454 100644 (file)
@@ -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
 
index 500c58701017d9f0b83f4e596f97a7afe8656dbd..eb932a8eb850fd1a8158d67c6292715b26e1023e 100644 (file)
@@ -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;
index 598687dedcb826051f42d6a532451391bf168f25..70a6bf8dd1d3e9ebaf90e1e34ea3f770fa8cde25 100644 (file)
@@ -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;
index da856ac8d2d8602278b68c3930f5c8047f6c7ca3..c00ca11f508f4f6bc80a83abfc0603490424faa2 100644 (file)
@@ -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