Skip to content

Commit

Permalink
Change startswith -> starts_with (halide#8013)
Browse files Browse the repository at this point in the history
startswith was deprecated in llvm/lvm-project#75491, which means that
Halide fails to compile using LLVM 18 (deprecation warning).
  • Loading branch information
tylerhou authored and ardier committed Mar 3, 2024
1 parent 3bac900 commit 2e8fee5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/CodeGen_LLVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1231,13 +1231,13 @@ void CodeGen_LLVM::optimize_module() {
// Do not annotate any of Halide's low-level synchronization code as it has
// tsan interface calls to mark its behavior and is much faster if
// it is not analyzed instruction by instruction.
if (!(function.getName().startswith("_ZN6Halide7Runtime8Internal15Synchronization") ||
if (!(function.getName().starts_with("_ZN6Halide7Runtime8Internal15Synchronization") ||
// TODO: this is a benign data race that re-initializes the detected features;
// we should really fix it properly inside the implementation, rather than disabling
// it here as a band-aid.
function.getName().startswith("halide_default_can_use_target_features") ||
function.getName().startswith("halide_mutex_") ||
function.getName().startswith("halide_cond_"))) {
function.getName().starts_with("halide_default_can_use_target_features") ||
function.getName().starts_with("halide_mutex_") ||
function.getName().starts_with("halide_cond_"))) {
function.addFnAttr(Attribute::SanitizeThread);
}
}
Expand Down

0 comments on commit 2e8fee5

Please sign in to comment.