From bc08a0981afb4027f4078a511616a88a18572d08 Mon Sep 17 00:00:00 2001 From: Hong Chen Date: Mon, 1 Apr 2024 11:40:17 -0500 Subject: [PATCH] Fixed missing brackets and added the rule back for the condition to call clang init preprocessor which was taken out incorrectly by the last commit. --- trick_source/codegen/Interface_Code_Gen/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trick_source/codegen/Interface_Code_Gen/main.cpp b/trick_source/codegen/Interface_Code_Gen/main.cpp index 332c67f72..b2c4df79b 100644 --- a/trick_source/codegen/Interface_Code_Gen/main.cpp +++ b/trick_source/codegen/Interface_Code_Gen/main.cpp @@ -246,7 +246,7 @@ int main(int argc, char * argv[]) { #if (LIBCLANG_MAJOR >= 10) && (LIBCLANG_MAJOR < 18) clang::InitializePreprocessor(pp, ppo, ci.getPCHContainerReader(), ci.getFrontendOpts()); -#else +#elif (LIBCLANG_MAJOR >= 18) clang::InitializePreprocessor(pp, ppo, ci.getPCHContainerReader(), ci.getFrontendOpts(), ci.getCodeGenOpts()); #endif @@ -316,7 +316,7 @@ int main(int argc, char * argv[]) { const clang::FileEntry* fileEntry = ci.getFileManager().getFile(inputFilePath); #endif free(inputFilePath); -#if (LIBCLANG_MAJOR > 3 && LIBCLANG_MAJOR < 18) || ((LIBCLANG_MAJOR == 3) && (LIBCLANG_MINOR >= 5)) +#if ((LIBCLANG_MAJOR > 3 && LIBCLANG_MAJOR < 18)) || ((LIBCLANG_MAJOR == 3) && (LIBCLANG_MINOR >= 5)) ci.getSourceManager().setMainFileID(ci.getSourceManager().createFileID(fileEntry, clang::SourceLocation(), clang::SrcMgr::C_User)); #elif (LIBCLANG_MAJOR >= 18) ci.getSourceManager().setMainFileID(ci.getSourceManager().createFileID(fileEntryRef, clang::SourceLocation(), clang::SrcMgr::C_User));