[cfe-commits] r111166 - in /cfe/trunk: include/clang/Driver/CC1Options.td include/clang/Frontend/FrontendOptions.h lib/Frontend/CompilerInvocation.cpp lib/Frontend/ExecuteCompilerInvocation.cpp
Sebastian Redl
sebastian.redl at getdesigned.at
Mon Aug 16 11:17:11 PDT 2010
Author: cornedbee
Date: Mon Aug 16 13:17:11 2010
New Revision: 111166
URL: http://llvm.org/viewvc/llvm-project?rev=111166&view=rev
Log:
Add two options for playing with modules.
Modified:
cfe/trunk/include/clang/Driver/CC1Options.td
cfe/trunk/include/clang/Frontend/FrontendOptions.h
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/lib/Frontend/ExecuteCompilerInvocation.cpp
Modified: cfe/trunk/include/clang/Driver/CC1Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=111166&r1=111165&r2=111166&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Mon Aug 16 13:17:11 2010
@@ -350,8 +350,13 @@
def rewrite_macros : Flag<"-rewrite-macros">,
HelpText<"Expand macros without full preprocessing">;
+def create_module : Flag<"-create-module">,
+ HelpText<"Create a module definition file">;
}
+def import_module : Separate<"-import-module">,
+ HelpText<"Import a module definition file">;
+
def relocatable_pch : Flag<"-relocatable-pch">,
HelpText<"Whether to build a relocatable precompiled header">;
def chained_pch : Flag<"-chained-pch">,
Modified: cfe/trunk/include/clang/Frontend/FrontendOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/FrontendOptions.h?rev=111166&r1=111165&r2=111166&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/FrontendOptions.h (original)
+++ cfe/trunk/include/clang/Frontend/FrontendOptions.h Mon Aug 16 13:17:11 2010
@@ -25,6 +25,7 @@
ASTPrintXML, ///< Parse ASTs and print them in XML.
ASTView, ///< Parse ASTs and view them in Graphviz.
BoostCon, ///< BoostCon mode.
+ CreateModule, ///< Create module definition
DumpRawTokens, ///< Dump out raw tokens.
DumpTokens, ///< Dump out preprocessed tokens.
EmitAssembly, ///< Emit a .s file.
@@ -109,6 +110,9 @@
/// \brief The list of AST files to merge.
std::vector<std::string> ASTMergeFiles;
+ /// \brief The list of modules to import.
+ std::vector<std::string> Modules;
+
/// \brief A list of arguments to forward to LLVM's option processing; this
/// should only be used for debugging and experimental features.
std::vector<std::string> LLVMArgs;
Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=111166&r1=111165&r2=111166&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Mon Aug 16 13:17:11 2010
@@ -319,6 +319,7 @@
case frontend::ASTPrintXML: return "-ast-print-xml";
case frontend::ASTView: return "-ast-view";
case frontend::BoostCon: return "-boostcon";
+ case frontend::CreateModule: return "-create-module";
case frontend::DumpRawTokens: return "-dump-raw-tokens";
case frontend::DumpTokens: return "-dump-tokens";
case frontend::EmitAssembly: return "-S";
@@ -422,6 +423,10 @@
Res.push_back("-ast-merge");
Res.push_back(Opts.ASTMergeFiles[i]);
}
+ for (unsigned i = 0, e = Opts.Modules.size(); i != e; ++i) {
+ Res.push_back("-import-module");
+ Res.push_back(Opts.Modules[i]);
+ }
for (unsigned i = 0, e = Opts.LLVMArgs.size(); i != e; ++i) {
Res.push_back("-mllvm");
Res.push_back(Opts.LLVMArgs[i]);
@@ -1015,6 +1020,8 @@
Opts.ProgramAction = frontend::RunAnalysis; break;
case OPT_Eonly:
Opts.ProgramAction = frontend::RunPreprocessorOnly; break;
+ case OPT_create_module:
+ Opts.ProgramAction = frontend::CreateModule; break;
}
}
@@ -1058,6 +1065,7 @@
Opts.ASTMergeFiles = Args.getAllArgValues(OPT_ast_merge);
Opts.LLVMArgs = Args.getAllArgValues(OPT_mllvm);
Opts.FixWhatYouCan = Args.hasArg(OPT_fix_what_you_can);
+ Opts.Modules = Args.getAllArgValues(OPT_import_module);
InputKind DashX = IK_None;
if (const Arg *A = Args.getLastArg(OPT_x)) {
Modified: cfe/trunk/lib/Frontend/ExecuteCompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ExecuteCompilerInvocation.cpp?rev=111166&r1=111165&r2=111166&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ExecuteCompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/ExecuteCompilerInvocation.cpp Mon Aug 16 13:17:11 2010
@@ -39,6 +39,7 @@
case ASTPrintXML: return new ASTPrintXMLAction();
case ASTView: return new ASTViewAction();
case BoostCon: return new BoostConAction();
+ case CreateModule: return 0;
case DumpRawTokens: return new DumpRawTokensAction();
case DumpTokens: return new DumpTokensAction();
case EmitAssembly: return new EmitAssemblyAction();
More information about the cfe-commits
mailing list