From aecc0504fabb32867c5b2dea588c82b0e46b6c77 Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Tue, 10 Feb 2015 18:47:01 -0600 Subject: [PATCH] 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 --- trick_source/codegen/Interface_Code_Gen/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/trick_source/codegen/Interface_Code_Gen/main.cpp b/trick_source/codegen/Interface_Code_Gen/main.cpp index beea83a6..f509ee98 100644 --- a/trick_source/codegen/Interface_Code_Gen/main.cpp +++ b/trick_source/codegen/Interface_Code_Gen/main.cpp @@ -165,7 +165,12 @@ int main( int argc , char * argv[] ) { // Tell the compiler to use our ICGASTconsumer ICGASTConsumer *astConsumer = new ICGASTConsumer(ci, hsd, cs, pa); +#if (__clang_major__ == 3) && (__clang_minor__ >= 6) + std::unique_ptr unique_ast(astConsumer) ; + ci.setASTConsumer(std::move(unique_ast)); +#else ci.setASTConsumer(astConsumer); +#endif ci.createASTContext(); ci.createSema(clang::TU_Prefix, NULL);