Skip to content

Conversation

@dakaidan
Copy link

@dakaidan dakaidan commented Oct 9, 2025

This pull request introduces compatibility for LLVM 17 , and also updates the CMake version and build setup.

Refactors the codebase to use a compatibility layer for handling differences in Optional types and string comparison APIs. The changes ensure that the code can be built and run against both LLVM 12 and LLVM 17.

LLVM Version Compatibility and Build System Updates:

  • Updated minimum required CMake version to 3.13.4 in both grayc/CMakeLists.txt and clang-diff/CMakeLists.txt.
  • GRAYC_OLD_LLVM_API defined for legacy API handling.
  • Updated installation instructions in README.md to default to LLVM/Clang 17 instead of 12, including all related package and build commands.

Compatibility Layer for LLVM API Differences:

  • Added a new grayc/Compatability.h header that abstracts differences between LLVM 12 and 17 for Optional types and case-insensitive string comparison, providing macros like OPTIONAL, HAS_VALUE, OPTIONAL_NONE, GET_VALUE, GET_VALUE_OR, and EQUALS_INSENSITIVE.
  • Refactored codebase to use these macros instead of directly referencing llvm::Optional or std::optional, and to use the appropriate string comparison function depending on LLVM version – this affects multiple files.

Add Compatability.h file handling llvm12 and 17 differences
Fix File API
Update README
@arindam-8
Copy link
Collaborator

Hi @dakaidan,

Thanks a lot for this! This looks like a comprehensive and relevant PR. Given the size of the changes, I will try and get through things and run some tests before merging.

I shall keep you updated.

Thanks again,
Arindam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants