summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2010-08-16 18:17:11 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2010-08-16 18:17:11 +0000
commit6ebb51a41d47e8743a5eae47e7fdf23aa34068aa (patch)
tree758e3da0718052eda4af91ae62695896a622a46a /clang/lib/Frontend
parentb61c07aca03841b461bc8f9b44c93be9abc0c640 (diff)
downloadbcm5719-llvm-6ebb51a41d47e8743a5eae47e7fdf23aa34068aa.tar.gz
bcm5719-llvm-6ebb51a41d47e8743a5eae47e7fdf23aa34068aa.zip
Add two options for playing with modules.
llvm-svn: 111166
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp8
-rw-r--r--clang/lib/Frontend/ExecuteCompilerInvocation.cpp1
2 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 5605f16dace..82cd75d18ab 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -319,6 +319,7 @@ static const char *getActionName(frontend::ActionKind Kind) {
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 @@ static void FrontendOptsToArgs(const FrontendOptions &Opts,
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 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
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 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
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)) {
diff --git a/clang/lib/Frontend/ExecuteCompilerInvocation.cpp b/clang/lib/Frontend/ExecuteCompilerInvocation.cpp
index c69d844ac9f..b432e8f6b66 100644
--- a/clang/lib/Frontend/ExecuteCompilerInvocation.cpp
+++ b/clang/lib/Frontend/ExecuteCompilerInvocation.cpp
@@ -39,6 +39,7 @@ static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) {
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();
OpenPOWER on IntegriCloud