From c6ecd76be593d21eec78deb78c3fef2ca22e989a Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Wed, 13 Sep 2017 14:07:23 -0500 Subject: [PATCH] ICG does not compile with llvm 5.0 #476 Added a preprocessor check for llvm version >= 5. If true use clang::InputKind::CXX instead of clang::IK_CXX --- trick_source/codegen/Interface_Code_Gen/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/trick_source/codegen/Interface_Code_Gen/main.cpp b/trick_source/codegen/Interface_Code_Gen/main.cpp index c04120c4..f19cfcea 100644 --- a/trick_source/codegen/Interface_Code_Gen/main.cpp +++ b/trick_source/codegen/Interface_Code_Gen/main.cpp @@ -127,7 +127,11 @@ int main(int argc, char * argv[]) { // Set all of the defaults to c++ #if (LIBCLANG_MAJOR > 3) || ((LIBCLANG_MAJOR == 3) && (LIBCLANG_MINOR >= 9)) llvm::Triple trip (to.Triple) ; +#if (LIBCLANG_MAJOR >= 5) + clang::CompilerInvocation::setLangDefaults(ci.getLangOpts(), clang::InputKind::CXX, trip, ppo) ; +#else clang::CompilerInvocation::setLangDefaults(ci.getLangOpts(), clang::IK_CXX, trip, ppo) ; +#endif // setting the language defaults clears the c++11 flag. ci.getLangOpts().CPlusPlus11 = true ; #endif