-/**
- * Main function provides all initialization before starting analysis of AST. Diagnostic Client is initialized,
- * Command line options are processed.
- */
-int main(int argc, char **argv)
-{
- if(argc==1 || strncmp(argv[1],"-help",5)==0)
- {
- cout<<endl<<" Boost Statechart Viewer - help"<<endl;
- cout<<"================================"<<endl;
- cout<<"The program can be used almost the same way as a C compiler. You will typically need to specify locations for all header files except of the files stored in system folder(in Linux: /usr/...) using -I option. Of course you can specify the output filename (-o option). Program displays all diagnostic messages like compilers. If an error occurs the program stops."<<endl<<endl;
- return 0;
- }
- string inputFilename = "";
- string outputFilename = "graph.dot"; // initialize output Filename
- DiagnosticOptions dopts;
- dopts.ShowColors=1;
- MyDiagnosticClient *mdc = new MyDiagnosticClient(llvm::errs(), dopts);
- llvm::IntrusiveRefCntPtr<DiagnosticIDs> dis(new DiagnosticIDs());
- DiagnosticsEngine diag(dis,mdc);
- FileManager fm( * new FileSystemOptions());
- SourceManager sm (diag, fm);
-
- Driver TheDriver(LLVM_BINDIR, llvm::sys::getDefaultTargetTriple(), "", false, diag);
- TheDriver.setCheckInputsExist(true);
- TheDriver.CCCIsCXX = 1;
- TheDriver.ResourceDir = LLVM_PREFIX "/lib/clang/" CLANG_VERSION_STRING;