From b60320464a012237e9a6f2db93ba469eb5efe22f Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Wed, 11 Jan 2017 15:59:10 -0600 Subject: [PATCH] Detect when TRICK_ICG is used in header files and compensate for it. #375 Always differences between clang versions. --- 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 1d31c0cd..ca833e98 100644 --- a/trick_source/codegen/Interface_Code_Gen/main.cpp +++ b/trick_source/codegen/Interface_Code_Gen/main.cpp @@ -128,8 +128,13 @@ int main(int argc, char * argv[]) { hsd.addSearchDirs(include_dirs); // Add a preprocessor callback to search for TRICK_ICG +#if (LIBCLANG_MAJOR > 3) || ((LIBCLANG_MAJOR == 3) && (LIBCLANG_MINOR >= 9)) + std::unique_ptr ftg(new FindTrickICG(ci, hsd, print_trick_icg != llvm::cl::BOU_FALSE )) ; + pp.addPPCallbacks(std::move(ftg)) ; +#else FindTrickICG * ftg = new FindTrickICG(ci, hsd, print_trick_icg != llvm::cl::BOU_FALSE ) ; pp.addPPCallbacks(ftg) ; +#endif #if (LIBCLANG_MAJOR > 3) || ((LIBCLANG_MAJOR == 3) && (LIBCLANG_MINOR >= 8)) pp.getBuiltinInfo().initializeBuiltins(pp.getIdentifierTable(), pp.getLangOpts());