diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-06-16 00:53:46 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-06-16 00:53:46 +0000 |
commit | eaed19e241359fb37da0269a64311e57cd53b83c (patch) | |
tree | 853b42ed5cb74f2b202a20cab02f11ae15af7c64 /tools/arcmt-test | |
parent | a586c74b6a50f7a299805d3426ff11caeb5b8729 (diff) |
[arcmt] Make arcmt-test accept cc1 options to make it more portable and hopefully fix MSVC failures.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133119 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/arcmt-test')
-rw-r--r-- | tools/arcmt-test/arcmt-test.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/tools/arcmt-test/arcmt-test.cpp b/tools/arcmt-test/arcmt-test.cpp index a5a7125f1e..baa3f568c0 100644 --- a/tools/arcmt-test/arcmt-test.cpp +++ b/tools/arcmt-test/arcmt-test.cpp @@ -100,22 +100,20 @@ static bool checkForMigration(llvm::StringRef resourcesPath, Diags->setClient(verifyDiag); } - llvm::OwningPtr<CompilerInvocation> CI; - CI.reset(clang::createInvocationFromCommandLine(Args, Diags)); - if (!CI) - return true; + CompilerInvocation CI; + CompilerInvocation::CreateFromArgs(CI, Args.begin(), Args.end(), *Diags); - if (CI->getFrontendOpts().Inputs.empty()) { + if (CI.getFrontendOpts().Inputs.empty()) { llvm::errs() << "error: no input files\n"; return true; } - if (!CI->getLangOpts().ObjC1) + if (!CI.getLangOpts().ObjC1) return false; - return arcmt::checkForManualIssues(*CI, - CI->getFrontendOpts().Inputs[0].second, - CI->getFrontendOpts().Inputs[0].first, + return arcmt::checkForManualIssues(CI, + CI.getFrontendOpts().Inputs[0].second, + CI.getFrontendOpts().Inputs[0].first, Diags->getClient()); } @@ -141,20 +139,19 @@ static bool performTransformations(llvm::StringRef resourcesPath, llvm::IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs()); llvm::IntrusiveRefCntPtr<Diagnostic> TopDiags(new Diagnostic(DiagID, DiagClient)); - llvm::OwningPtr<CompilerInvocation> origCI; - origCI.reset(clang::createInvocationFromCommandLine(Args, TopDiags)); - if (!origCI) - return true; + CompilerInvocation origCI; + CompilerInvocation::CreateFromArgs(origCI, Args.begin(), Args.end(), + *TopDiags); - if (origCI->getFrontendOpts().Inputs.empty()) { + if (origCI.getFrontendOpts().Inputs.empty()) { llvm::errs() << "error: no input files\n"; return true; } - if (!origCI->getLangOpts().ObjC1) + if (!origCI.getLangOpts().ObjC1) return false; - MigrationProcess migration(*origCI, DiagClient); + MigrationProcess migration(origCI, DiagClient); std::vector<TransformFn> transforms = arcmt::getAllTransformations(); assert(!transforms.empty()); |