Skip to content

Commit

Permalink
Fixed to set input file properly for clang3.4 or ealier.
Browse files Browse the repository at this point in the history
  • Loading branch information
hchen99 committed Apr 1, 2024
1 parent fc5370a commit 9fb2f1d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions trick_source/codegen/Interface_Code_Gen/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,12 @@ int main(int argc, char * argv[]) {
const clang::FileEntry* fileEntry = ci.getFileManager().getFile(inputFilePath);
#endif
free(inputFilePath);
#if (LIBCLANG_MAJOR < 3)
ci.getSourceManager().createMainFileID(fileEntry);
#elif (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));
#else
#elif (LIBCLANG_MAJOR >= 18)
ci.getSourceManager().setMainFileID(ci.getSourceManager().createFileID(fileEntryRef, clang::SourceLocation(), clang::SrcMgr::C_User));
#else
ci.getSourceManager().createMainFileID(fileEntry);
#endif
ci.getDiagnosticClient().BeginSourceFile(ci.getLangOpts(), &ci.getPreprocessor());
clang::ParseAST(ci.getSema());
Expand Down

0 comments on commit 9fb2f1d

Please sign in to comment.