Clang libtool not parsing c++ file when i do # include <iostream>

I've written a clang libtool . When i add # include to the input file , it
seg-faults. My code is like this:-

int main(int argc, const char **argv) {
  static cl::OptionCategory MyToolCategory("my-tool options");
  CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);
  ClangTool Tool(OptionsParser.getCompilations(),
                 OptionsParser.getSourcePathList());
  return Tool.run(newFrontendActionFactory<MyFrontendAction>().get());
}

I've written a clang libtool . When i add # include to the input file , it
seg-faults. My code is like this:-

int main(int argc, const char **argv) {
  static cl::OptionCategory MyToolCategory("my-tool options");
  CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);
  ClangTool Tool(OptionsParser.getCompilations(),
                 OptionsParser.getSourcePathList());
  return Tool.run(newFrontendActionFactory<MyFrontendAction>().get());
}

A stack trace would be most helpful... What does "MyFrontendAction" doe?