From 7fbd97f641aac5aa047b16fb075e30826023ca09 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Sat, 9 Jul 2011 20:00:58 +0000 Subject: [arcmt] Introduce new '-ccc-arcmt-migrate ' ARC migration driver option. This is a new mode of migration, where we avoid modifying the original files but we emit temporary files instead. will be used to keep migration process metadata. Currently the temporary files that are produced are put in the system's temp directory but we can put them in the if is necessary. Also introduce new ARC migration functions in libclang whose only purpose, currently, is to accept and provide pairs of original file/transformed file to map from the originals to the files after transformations are applied. Finally introduce the c-arcmt-test utility that exercises the new libclang functions, update arcmt-test, and add tests for the whole process. rdar://9735086. llvm-svn: 134844 --- clang/lib/Frontend/CompilerInvocation.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'clang/lib/Frontend') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index ebc3340a3d5..02a5088f934 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -431,6 +431,13 @@ static void FrontendOptsToArgs(const FrontendOptions &Opts, case FrontendOptions::ARCMT_Modify: Res.push_back("-arcmt-modify"); break; + case FrontendOptions::ARCMT_Migrate: + Res.push_back("-arcmt-migrate"); + break; + } + if (!Opts.ARCMTMigrateDir.empty()) { + Res.push_back("-arcmt-migrate-directory"); + Res.push_back(Opts.ARCMTMigrateDir); } bool NeedLang = false; @@ -1251,7 +1258,8 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args, Opts.ARCMTAction = FrontendOptions::ARCMT_None; if (const Arg *A = Args.getLastArg(OPT_arcmt_check, - OPT_arcmt_modify)) { + OPT_arcmt_modify, + OPT_arcmt_migrate)) { switch (A->getOption().getID()) { default: llvm_unreachable("missed a case"); @@ -1261,8 +1269,12 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args, case OPT_arcmt_modify: Opts.ARCMTAction = FrontendOptions::ARCMT_Modify; break; + case OPT_arcmt_migrate: + Opts.ARCMTAction = FrontendOptions::ARCMT_Migrate; + break; } } + Opts.ARCMTMigrateDir = Args.getLastArgValue(OPT_arcmt_migrate_directory); InputKind DashX = IK_None; if (const Arg *A = Args.getLastArg(OPT_x)) { -- cgit v1.2.3