Changed the calling argument to setASTConsumer.

The calling argument to setASTConsumer changed between clang 3.5
and 3.6.  Changed the code to create a std::unique_ptr that the
call now requires and call setASTConsumer with the unique pointer.

Fixes #15
This commit is contained in:
Alex Lin 2015-02-10 18:47:01 -06:00
parent c7e5ab1139
commit aecc0504fa

View File

@ -165,7 +165,12 @@ int main( int argc , char * argv[] ) {
// Tell the compiler to use our ICGASTconsumer // Tell the compiler to use our ICGASTconsumer
ICGASTConsumer *astConsumer = new ICGASTConsumer(ci, hsd, cs, pa); ICGASTConsumer *astConsumer = new ICGASTConsumer(ci, hsd, cs, pa);
#if (__clang_major__ == 3) && (__clang_minor__ >= 6)
std::unique_ptr<clang::ASTConsumer> unique_ast(astConsumer) ;
ci.setASTConsumer(std::move(unique_ast));
#else
ci.setASTConsumer(astConsumer); ci.setASTConsumer(astConsumer);
#endif
ci.createASTContext(); ci.createASTContext();
ci.createSema(clang::TU_Prefix, NULL); ci.createSema(clang::TU_Prefix, NULL);