2011-06-16 07:25:17 +08:00
|
|
|
//===-- arcmt-test.cpp - ARC Migration Tool testbed -----------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "clang/ARCMigrate/ARCMT.h"
|
2016-07-19 03:02:11 +08:00
|
|
|
#include "clang/AST/ASTContext.h"
|
|
|
|
#include "clang/Frontend/PCHContainerOperations.h"
|
2011-06-16 07:25:17 +08:00
|
|
|
#include "clang/Frontend/TextDiagnosticPrinter.h"
|
|
|
|
#include "clang/Frontend/Utils.h"
|
2012-12-04 17:25:21 +08:00
|
|
|
#include "clang/Frontend/VerifyDiagnosticConsumer.h"
|
2011-06-16 07:25:17 +08:00
|
|
|
#include "clang/Lex/Preprocessor.h"
|
2016-07-19 03:02:11 +08:00
|
|
|
#include "clang/Lex/PreprocessorOptions.h"
|
2011-07-10 04:00:58 +08:00
|
|
|
#include "llvm/Support/FileSystem.h"
|
2012-12-04 17:25:21 +08:00
|
|
|
#include "llvm/Support/MemoryBuffer.h"
|
2016-07-19 03:02:11 +08:00
|
|
|
#include "llvm/Support/Path.h"
|
2011-06-16 07:25:17 +08:00
|
|
|
#include "llvm/Support/Signals.h"
|
2014-06-13 01:19:42 +08:00
|
|
|
#include <system_error>
|
2011-06-16 07:25:17 +08:00
|
|
|
|
|
|
|
using namespace clang;
|
|
|
|
using namespace arcmt;
|
|
|
|
|
|
|
|
static llvm::cl::opt<bool>
|
|
|
|
CheckOnly("check-only",
|
|
|
|
llvm::cl::desc("Just check for issues that need to be handled manually"));
|
|
|
|
|
|
|
|
//static llvm::cl::opt<bool>
|
|
|
|
//TestResultForARC("test-result",
|
|
|
|
//llvm::cl::desc("Test the result of transformations by parsing it in ARC mode"));
|
|
|
|
|
|
|
|
static llvm::cl::opt<bool>
|
|
|
|
OutputTransformations("output-transformations",
|
|
|
|
llvm::cl::desc("Print the source transformations"));
|
|
|
|
|
|
|
|
static llvm::cl::opt<bool>
|
|
|
|
VerifyDiags("verify",llvm::cl::desc("Verify emitted diagnostics and warnings"));
|
|
|
|
|
|
|
|
static llvm::cl::opt<bool>
|
|
|
|
VerboseOpt("v", llvm::cl::desc("Enable verbose output"));
|
|
|
|
|
2011-07-10 04:00:58 +08:00
|
|
|
static llvm::cl::opt<bool>
|
|
|
|
VerifyTransformedFiles("verify-transformed-files",
|
|
|
|
llvm::cl::desc("Read pairs of file mappings (typically the output of "
|
|
|
|
"c-arcmt-test) and compare their contents with the filenames "
|
|
|
|
"provided in command-line"));
|
|
|
|
|
|
|
|
static llvm::cl::opt<std::string>
|
|
|
|
RemappingsFile("remappings-file",
|
|
|
|
llvm::cl::desc("Pairs of file mappings (typically the output of "
|
|
|
|
"c-arcmt-test)"));
|
|
|
|
|
|
|
|
static llvm::cl::list<std::string>
|
|
|
|
ResultFiles(llvm::cl::Positional, llvm::cl::desc("<filename>..."));
|
|
|
|
|
2011-06-16 07:25:17 +08:00
|
|
|
static llvm::cl::extrahelp extraHelp(
|
|
|
|
"\nusage with compiler args: arcmt-test [options] --args [compiler flags]\n");
|
|
|
|
|
|
|
|
// This function isn't referenced outside its translation unit, but it
|
|
|
|
// can't use the "static" keyword because its address is used for
|
|
|
|
// GetMainExecutable (since some platforms don't support taking the
|
|
|
|
// address of main, and some platforms can't implement GetMainExecutable
|
|
|
|
// without being given the address of a function in the main executable).
|
2013-06-26 13:03:40 +08:00
|
|
|
std::string GetExecutablePath(const char *Argv0) {
|
2011-06-16 07:25:17 +08:00
|
|
|
// This just needs to be some symbol in the binary; C++ doesn't
|
|
|
|
// allow taking the address of ::main however.
|
|
|
|
void *MainAddr = (void*) (intptr_t) GetExecutablePath;
|
2013-06-26 13:03:40 +08:00
|
|
|
return llvm::sys::fs::getMainExecutable(Argv0, MainAddr);
|
2011-06-16 07:25:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void printSourceLocation(SourceLocation loc, ASTContext &Ctx,
|
2011-07-23 18:55:15 +08:00
|
|
|
raw_ostream &OS);
|
2011-06-16 07:25:17 +08:00
|
|
|
static void printSourceRange(CharSourceRange range, ASTContext &Ctx,
|
2011-07-23 18:55:15 +08:00
|
|
|
raw_ostream &OS);
|
2011-06-16 07:25:17 +08:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
class PrintTransforms : public MigrationProcess::RewriteListener {
|
|
|
|
ASTContext *Ctx;
|
2011-07-23 18:55:15 +08:00
|
|
|
raw_ostream &OS;
|
2011-06-16 07:25:17 +08:00
|
|
|
|
|
|
|
public:
|
2011-07-23 18:55:15 +08:00
|
|
|
PrintTransforms(raw_ostream &OS)
|
2014-06-08 16:38:04 +08:00
|
|
|
: Ctx(nullptr), OS(OS) {}
|
2011-06-16 07:25:17 +08:00
|
|
|
|
2014-03-15 15:47:46 +08:00
|
|
|
void start(ASTContext &ctx) override { Ctx = &ctx; }
|
2014-06-08 16:38:04 +08:00
|
|
|
void finish() override { Ctx = nullptr; }
|
2011-06-16 07:25:17 +08:00
|
|
|
|
2014-03-15 15:47:46 +08:00
|
|
|
void insert(SourceLocation loc, StringRef text) override {
|
2011-06-16 07:25:17 +08:00
|
|
|
assert(Ctx);
|
|
|
|
OS << "Insert: ";
|
|
|
|
printSourceLocation(loc, *Ctx, OS);
|
|
|
|
OS << " \"" << text << "\"\n";
|
|
|
|
}
|
|
|
|
|
2014-03-15 15:47:46 +08:00
|
|
|
void remove(CharSourceRange range) override {
|
2011-06-16 07:25:17 +08:00
|
|
|
assert(Ctx);
|
|
|
|
OS << "Remove: ";
|
|
|
|
printSourceRange(range, *Ctx, OS);
|
|
|
|
OS << '\n';
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
} // anonymous namespace
|
|
|
|
|
2011-07-23 18:55:15 +08:00
|
|
|
static bool checkForMigration(StringRef resourcesPath,
|
2011-07-24 01:14:25 +08:00
|
|
|
ArrayRef<const char *> Args) {
|
2012-10-24 06:26:28 +08:00
|
|
|
IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions();
|
2011-09-26 07:39:51 +08:00
|
|
|
DiagnosticConsumer *DiagClient =
|
2012-10-24 06:26:28 +08:00
|
|
|
new TextDiagnosticPrinter(llvm::errs(), &*DiagOpts);
|
2012-02-20 22:00:23 +08:00
|
|
|
IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
|
|
|
|
IntrusiveRefCntPtr<DiagnosticsEngine> Diags(
|
2012-10-24 06:26:28 +08:00
|
|
|
new DiagnosticsEngine(DiagID, &*DiagOpts, DiagClient));
|
2011-06-16 07:25:17 +08:00
|
|
|
// Chain in -verify checker, if requested.
|
2014-06-08 16:38:04 +08:00
|
|
|
VerifyDiagnosticConsumer *verifyDiag = nullptr;
|
2011-06-16 07:25:17 +08:00
|
|
|
if (VerifyDiags) {
|
2011-09-26 08:38:03 +08:00
|
|
|
verifyDiag = new VerifyDiagnosticConsumer(*Diags);
|
2011-06-16 07:25:17 +08:00
|
|
|
Diags->setClient(verifyDiag);
|
|
|
|
}
|
|
|
|
|
2011-06-16 08:53:46 +08:00
|
|
|
CompilerInvocation CI;
|
2011-12-23 11:05:38 +08:00
|
|
|
if (!CompilerInvocation::CreateFromArgs(CI, Args.begin(), Args.end(), *Diags))
|
|
|
|
return true;
|
2011-06-16 07:25:17 +08:00
|
|
|
|
2011-06-16 08:53:46 +08:00
|
|
|
if (CI.getFrontendOpts().Inputs.empty()) {
|
2011-06-16 07:25:17 +08:00
|
|
|
llvm::errs() << "error: no input files\n";
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2011-11-18 07:01:24 +08:00
|
|
|
if (!CI.getLangOpts()->ObjC1)
|
2011-06-16 07:25:17 +08:00
|
|
|
return false;
|
|
|
|
|
2015-06-21 02:53:08 +08:00
|
|
|
arcmt::checkForManualIssues(CI, CI.getFrontendOpts().Inputs[0],
|
2015-07-17 09:19:54 +08:00
|
|
|
std::make_shared<PCHContainerOperations>(),
|
2011-06-18 08:53:41 +08:00
|
|
|
Diags->getClient());
|
|
|
|
return Diags->getClient()->getNumErrors() > 0;
|
2011-06-16 07:25:17 +08:00
|
|
|
}
|
|
|
|
|
2011-07-23 18:55:15 +08:00
|
|
|
static void printResult(FileRemapper &remapper, raw_ostream &OS) {
|
2012-03-07 04:06:33 +08:00
|
|
|
PreprocessorOptions PPOpts;
|
|
|
|
remapper.applyMappings(PPOpts);
|
2011-06-16 07:25:17 +08:00
|
|
|
// The changed files will be in memory buffers, print them.
|
2014-07-07 15:47:20 +08:00
|
|
|
for (const auto &RB : PPOpts.RemappedFileBuffers)
|
|
|
|
OS << RB.second->getBuffer();
|
2011-06-16 07:25:17 +08:00
|
|
|
}
|
|
|
|
|
2011-07-23 18:55:15 +08:00
|
|
|
static bool performTransformations(StringRef resourcesPath,
|
2011-07-24 01:14:25 +08:00
|
|
|
ArrayRef<const char *> Args) {
|
2011-06-16 07:25:17 +08:00
|
|
|
// Check first.
|
|
|
|
if (checkForMigration(resourcesPath, Args))
|
|
|
|
return true;
|
|
|
|
|
2012-10-24 06:26:28 +08:00
|
|
|
IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions();
|
2011-09-26 07:39:51 +08:00
|
|
|
DiagnosticConsumer *DiagClient =
|
2012-10-24 06:26:28 +08:00
|
|
|
new TextDiagnosticPrinter(llvm::errs(), &*DiagOpts);
|
2012-02-20 22:00:23 +08:00
|
|
|
IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
|
|
|
|
IntrusiveRefCntPtr<DiagnosticsEngine> TopDiags(
|
2012-10-24 06:26:28 +08:00
|
|
|
new DiagnosticsEngine(DiagID, &*DiagOpts, &*DiagClient));
|
2011-06-16 07:25:17 +08:00
|
|
|
|
2011-06-16 08:53:46 +08:00
|
|
|
CompilerInvocation origCI;
|
2011-12-23 11:05:38 +08:00
|
|
|
if (!CompilerInvocation::CreateFromArgs(origCI, Args.begin(), Args.end(),
|
|
|
|
*TopDiags))
|
|
|
|
return true;
|
2011-06-16 07:25:17 +08:00
|
|
|
|
2011-06-16 08:53:46 +08:00
|
|
|
if (origCI.getFrontendOpts().Inputs.empty()) {
|
2011-06-16 07:25:17 +08:00
|
|
|
llvm::errs() << "error: no input files\n";
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2011-11-18 07:01:24 +08:00
|
|
|
if (!origCI.getLangOpts()->ObjC1)
|
2011-06-16 07:25:17 +08:00
|
|
|
return false;
|
|
|
|
|
2015-07-17 09:19:54 +08:00
|
|
|
MigrationProcess migration(origCI, std::make_shared<PCHContainerOperations>(),
|
|
|
|
DiagClient);
|
2011-06-16 07:25:17 +08:00
|
|
|
|
2011-11-04 23:58:08 +08:00
|
|
|
std::vector<TransformFn>
|
2012-01-27 04:57:58 +08:00
|
|
|
transforms = arcmt::getAllTransformations(origCI.getLangOpts()->getGC(),
|
|
|
|
origCI.getMigratorOpts().NoFinalizeRemoval);
|
2011-06-16 07:25:17 +08:00
|
|
|
assert(!transforms.empty());
|
|
|
|
|
2014-03-08 04:03:18 +08:00
|
|
|
std::unique_ptr<PrintTransforms> transformPrinter;
|
2011-06-16 07:25:17 +08:00
|
|
|
if (OutputTransformations)
|
|
|
|
transformPrinter.reset(new PrintTransforms(llvm::outs()));
|
|
|
|
|
|
|
|
for (unsigned i=0, e = transforms.size(); i != e; ++i) {
|
|
|
|
bool err = migration.applyTransform(transforms[i], transformPrinter.get());
|
|
|
|
if (err) return true;
|
|
|
|
|
|
|
|
if (VerboseOpt) {
|
|
|
|
if (i == e-1)
|
|
|
|
llvm::errs() << "\n##### FINAL RESULT #####\n";
|
|
|
|
else
|
|
|
|
llvm::errs() << "\n##### OUTPUT AFTER "<< i+1 <<". TRANSFORMATION #####\n";
|
|
|
|
printResult(migration.getRemapper(), llvm::errs());
|
|
|
|
llvm::errs() << "\n##########################\n\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!OutputTransformations)
|
|
|
|
printResult(migration.getRemapper(), llvm::outs());
|
|
|
|
|
|
|
|
// FIXME: TestResultForARC
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-07-23 18:55:15 +08:00
|
|
|
static bool filesCompareEqual(StringRef fname1, StringRef fname2) {
|
2011-07-10 04:00:58 +08:00
|
|
|
using namespace llvm;
|
|
|
|
|
2014-07-07 01:43:24 +08:00
|
|
|
ErrorOr<std::unique_ptr<MemoryBuffer>> file1 = MemoryBuffer::getFile(fname1);
|
2011-07-10 04:00:58 +08:00
|
|
|
if (!file1)
|
|
|
|
return false;
|
2014-03-08 04:03:18 +08:00
|
|
|
|
2014-07-07 01:43:24 +08:00
|
|
|
ErrorOr<std::unique_ptr<MemoryBuffer>> file2 = MemoryBuffer::getFile(fname2);
|
2011-07-10 04:00:58 +08:00
|
|
|
if (!file2)
|
|
|
|
return false;
|
|
|
|
|
2014-07-07 01:43:24 +08:00
|
|
|
return file1.get()->getBuffer() == file2.get()->getBuffer();
|
2011-07-10 04:00:58 +08:00
|
|
|
}
|
|
|
|
|
2011-07-24 01:14:25 +08:00
|
|
|
static bool verifyTransformedFiles(ArrayRef<std::string> resultFiles) {
|
2011-07-10 04:00:58 +08:00
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
assert(!resultFiles.empty());
|
|
|
|
|
|
|
|
std::map<StringRef, StringRef> resultMap;
|
|
|
|
|
|
|
|
for (ArrayRef<std::string>::iterator
|
|
|
|
I = resultFiles.begin(), E = resultFiles.end(); I != E; ++I) {
|
|
|
|
StringRef fname(*I);
|
|
|
|
if (!fname.endswith(".result")) {
|
|
|
|
errs() << "error: filename '" << fname
|
|
|
|
<< "' does not have '.result' extension\n";
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
resultMap[sys::path::stem(fname)] = fname;
|
|
|
|
}
|
|
|
|
|
2014-07-07 01:43:24 +08:00
|
|
|
ErrorOr<std::unique_ptr<MemoryBuffer>> inputBuf = std::error_code();
|
2011-07-10 04:00:58 +08:00
|
|
|
if (RemappingsFile.empty())
|
2014-07-07 01:43:24 +08:00
|
|
|
inputBuf = MemoryBuffer::getSTDIN();
|
2011-07-10 04:00:58 +08:00
|
|
|
else
|
2014-07-07 01:43:24 +08:00
|
|
|
inputBuf = MemoryBuffer::getFile(RemappingsFile);
|
2011-07-10 04:00:58 +08:00
|
|
|
if (!inputBuf) {
|
|
|
|
errs() << "error: could not read remappings input\n";
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
SmallVector<StringRef, 8> strs;
|
2014-07-07 01:43:24 +08:00
|
|
|
inputBuf.get()->getBuffer().split(strs, "\n", /*MaxSplit=*/-1,
|
|
|
|
/*KeepEmpty=*/false);
|
2011-07-10 04:00:58 +08:00
|
|
|
|
|
|
|
if (strs.empty()) {
|
|
|
|
errs() << "error: no files to verify from stdin\n";
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (strs.size() % 2 != 0) {
|
|
|
|
errs() << "error: files to verify are not original/result pairs\n";
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (unsigned i = 0, e = strs.size(); i != e; i += 2) {
|
|
|
|
StringRef inputOrigFname = strs[i];
|
|
|
|
StringRef inputResultFname = strs[i+1];
|
|
|
|
|
|
|
|
std::map<StringRef, StringRef>::iterator It;
|
|
|
|
It = resultMap.find(sys::path::filename(inputOrigFname));
|
|
|
|
if (It == resultMap.end()) {
|
|
|
|
errs() << "error: '" << inputOrigFname << "' is not in the list of "
|
|
|
|
<< "transformed files to verify\n";
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-09-12 02:10:13 +08:00
|
|
|
if (!sys::fs::exists(It->second)) {
|
2011-07-10 04:00:58 +08:00
|
|
|
errs() << "error: '" << It->second << "' does not exist\n";
|
|
|
|
return true;
|
|
|
|
}
|
2014-09-12 02:10:13 +08:00
|
|
|
if (!sys::fs::exists(inputResultFname)) {
|
2011-07-10 04:00:58 +08:00
|
|
|
errs() << "error: '" << inputResultFname << "' does not exist\n";
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!filesCompareEqual(It->second, inputResultFname)) {
|
|
|
|
errs() << "error: '" << It->second << "' is different than "
|
|
|
|
<< "'" << inputResultFname << "'\n";
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
resultMap.erase(It);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!resultMap.empty()) {
|
|
|
|
for (std::map<StringRef, StringRef>::iterator
|
|
|
|
I = resultMap.begin(), E = resultMap.end(); I != E; ++I)
|
|
|
|
errs() << "error: '" << I->second << "' was not verified!\n";
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-06-16 07:25:17 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Misc. functions.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
static void printSourceLocation(SourceLocation loc, ASTContext &Ctx,
|
2011-07-23 18:55:15 +08:00
|
|
|
raw_ostream &OS) {
|
2011-06-16 07:25:17 +08:00
|
|
|
SourceManager &SM = Ctx.getSourceManager();
|
|
|
|
PresumedLoc PL = SM.getPresumedLoc(loc);
|
|
|
|
|
|
|
|
OS << llvm::sys::path::filename(PL.getFilename());
|
|
|
|
OS << ":" << PL.getLine() << ":"
|
|
|
|
<< PL.getColumn();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void printSourceRange(CharSourceRange range, ASTContext &Ctx,
|
2011-07-23 18:55:15 +08:00
|
|
|
raw_ostream &OS) {
|
2011-06-16 07:25:17 +08:00
|
|
|
SourceManager &SM = Ctx.getSourceManager();
|
2012-03-11 15:00:24 +08:00
|
|
|
const LangOptions &langOpts = Ctx.getLangOpts();
|
2011-06-16 07:25:17 +08:00
|
|
|
|
|
|
|
PresumedLoc PL = SM.getPresumedLoc(range.getBegin());
|
|
|
|
|
|
|
|
OS << llvm::sys::path::filename(PL.getFilename());
|
|
|
|
OS << " [" << PL.getLine() << ":"
|
|
|
|
<< PL.getColumn();
|
|
|
|
OS << " - ";
|
|
|
|
|
|
|
|
SourceLocation end = range.getEnd();
|
|
|
|
PL = SM.getPresumedLoc(end);
|
|
|
|
|
|
|
|
unsigned endCol = PL.getColumn() - 1;
|
|
|
|
if (!range.isTokenRange())
|
|
|
|
endCol += Lexer::MeasureTokenLength(end, SM, langOpts);
|
|
|
|
OS << PL.getLine() << ":" << endCol << "]";
|
|
|
|
}
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Command line processing.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
int main(int argc, const char **argv) {
|
|
|
|
void *MainAddr = (void*) (intptr_t) GetExecutablePath;
|
2016-06-09 08:53:41 +08:00
|
|
|
llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);
|
2011-06-16 07:25:17 +08:00
|
|
|
|
|
|
|
std::string
|
|
|
|
resourcesPath = CompilerInvocation::GetResourcesPath(argv[0], MainAddr);
|
|
|
|
|
|
|
|
int optargc = 0;
|
|
|
|
for (; optargc != argc; ++optargc) {
|
|
|
|
if (StringRef(argv[optargc]) == "--args")
|
|
|
|
break;
|
|
|
|
}
|
2012-02-08 03:36:38 +08:00
|
|
|
llvm::cl::ParseCommandLineOptions(optargc, argv, "arcmt-test");
|
2011-07-10 04:00:58 +08:00
|
|
|
|
|
|
|
if (VerifyTransformedFiles) {
|
|
|
|
if (ResultFiles.empty()) {
|
|
|
|
llvm::cl::PrintHelpMessage();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return verifyTransformedFiles(ResultFiles);
|
|
|
|
}
|
|
|
|
|
2011-06-16 07:25:17 +08:00
|
|
|
if (optargc == argc) {
|
|
|
|
llvm::cl::PrintHelpMessage();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2011-07-24 01:14:25 +08:00
|
|
|
ArrayRef<const char*> Args(argv+optargc+1, argc-optargc-1);
|
2011-06-16 07:25:17 +08:00
|
|
|
|
|
|
|
if (CheckOnly)
|
|
|
|
return checkForMigration(resourcesPath, Args);
|
|
|
|
|
|
|
|
return performTransformations(resourcesPath, Args);
|
|
|
|
}
|