Skip to content

Commit 4b7691e

Browse files
authored
Make test_translator.py tests pass on LLVM 19 (#1230)
The LLVM builtins file changed name going from 18 to 19. * Fixes #1228.
2 parents a265c95 + eba1fb4 commit 4b7691e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

c2rust-ast-exporter/src/AstExporter.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1772,7 +1772,11 @@ class TranslateASTVisitor final
17721772
case AtomicExpr::AO ## ID: \
17731773
cbor_encode_string(array, #ID); \
17741774
break;
1775+
#if CLANG_VERSION_MAJOR >= 19
1776+
#include "clang/Basic/Builtins.inc"
1777+
#else
17751778
#include "clang/Basic/Builtins.def"
1779+
#endif
17761780
default: printError("Unknown atomic builtin: " +
17771781
std::to_string(E->getOp()), E);
17781782
};

c2rust-build-paths/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ pub fn find_llvm_config() -> Option<PathBuf> {
9191
.or_else(|| {
9292
// In PATH
9393
[
94+
"llvm-config-19",
9495
"llvm-config-18",
9596
"llvm-config-17",
9697
"llvm-config-16",
@@ -106,6 +107,7 @@ pub fn find_llvm_config() -> Option<PathBuf> {
106107
"llvm-config-7.0",
107108
"llvm-config",
108109
// Homebrew install locations on Intel macOS
110+
"/usr/local/opt/llvm@19/bin/llvm-config",
109111
"/usr/local/opt/llvm@18/bin/llvm-config",
110112
"/usr/local/opt/llvm@17/bin/llvm-config",
111113
"/usr/local/opt/llvm@16/bin/llvm-config",
@@ -119,6 +121,7 @@ pub fn find_llvm_config() -> Option<PathBuf> {
119121
"/usr/local/opt/llvm@8/bin/llvm-config",
120122
"/usr/local/opt/llvm/bin/llvm-config",
121123
// Homebrew install locations on Apple Silicon macOS
124+
"/opt/homebrew/opt/llvm@19/bin/llvm-config",
122125
"/opt/homebrew/opt/llvm@18/bin/llvm-config",
123126
"/opt/homebrew/opt/llvm@17/bin/llvm-config",
124127
"/opt/homebrew/opt/llvm@16/bin/llvm-config",

0 commit comments

Comments
 (0)