Skip to content

Commit c38f905

Browse files
committed
Add compatibility with LLVM 20.1
1 parent fe52953 commit c38f905

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/cmake/externalpackages.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ checked_find_package (pugixml REQUIRED
5858
# LLVM library setup
5959
checked_find_package (LLVM REQUIRED
6060
VERSION_MIN 11.0
61-
VERSION_MAX 19.9
61+
VERSION_MAX 20.9
6262
PRINT LLVM_SYSTEM_LIBRARIES CLANG_LIBRARIES
6363
LLVM_SHARED_MODE)
6464
# ensure include directory is added (in case of non-standard locations

src/include/OSL/platform.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include <cstring>
2222
#include <memory>
23+
#include <cstdint>
2324

2425
#include <OSL/oslversion.h>
2526

src/liboslexec/llvm_util.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3212,7 +3212,11 @@ LLVM_Util::loop_after_block() const
32123212
llvm::Type*
32133213
LLVM_Util::type_union(cspan<llvm::Type*> types)
32143214
{
3215+
#if OSL_LLVM_VERSION >= 200
3216+
llvm::DataLayout target(module()->getDataLayout());
3217+
#else
32153218
llvm::DataLayout target(module());
3219+
#endif
32163220
size_t max_size = 0;
32173221
size_t max_align = 1;
32183222
for (auto t : types) {

0 commit comments

Comments
 (0)