pet.cc: extract out update_arrays
[pet.git] / main.cc
blobed6cb4a835a347b8f18c91222682fcb719f1851c
1 #include <string>
2 #include <llvm/Support/CommandLine.h>
4 #include <isl/ctx.h>
6 #include "scop.h"
7 #include "scop_yaml.h"
9 using namespace std;
11 static llvm::cl::opt<string> InputFilename(llvm::cl::Positional,
12 llvm::cl::Required, llvm::cl::desc("<input file>"));
13 static llvm::cl::opt<bool> AutoDetect("autodetect",
14 llvm::cl::desc("Autodetect scops"));
16 int main(int argc, char *argv[])
18 isl_ctx *ctx = isl_ctx_alloc();
19 pet_scop *scop;
21 llvm::cl::ParseCommandLineOptions(argc, argv);
23 scop = pet_scop_extract_from_C_source(ctx, InputFilename.c_str(), NULL,
24 AutoDetect);
26 if (scop)
27 pet_scop_emit(stdout, scop);
29 pet_scop_free(scop);
31 isl_ctx_free(ctx);
32 return 0;