From 662740fe3bab0d4066bedc4a3825be42c27443e7 Mon Sep 17 00:00:00 2001 From: Romain Moyard Date: Sat, 21 Sep 2024 23:45:19 -0400 Subject: [PATCH] Fix clang compilation (failing since 0.0.150) (#2082) * Update * Update --- enzyme/Enzyme/AdjointGenerator.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/enzyme/Enzyme/AdjointGenerator.h b/enzyme/Enzyme/AdjointGenerator.h index 0405de12c32..1f8017537d5 100644 --- a/enzyme/Enzyme/AdjointGenerator.h +++ b/enzyme/Enzyme/AdjointGenerator.h @@ -3108,7 +3108,11 @@ class AdjointGenerator : public llvm::InstVisitor { op3 = gutils->getNewFromOriginal(MS.getOperand(3)); } - for (auto &&[secretty, seg_start, seg_size] : toIterate) { + for (auto &&[secretty_ref, seg_start_ref, seg_size_ref] : toIterate) { + auto secretty = secretty_ref; + auto seg_start = seg_start_ref; + auto seg_size = seg_size_ref; + Value *length = new_size; if (seg_start != std::get<1>(toIterate.back())) { length = ConstantInt::get(new_size->getType(), seg_start + seg_size); @@ -3484,7 +3488,11 @@ class AdjointGenerator : public llvm::InstVisitor { } } - for (auto &&[floatTy, seg_start, seg_size] : toIterate) { + for (auto &&[floatTy_ref, seg_start_ref, seg_size_ref] : toIterate) { + auto floatTy = floatTy_ref; + auto seg_start = seg_start_ref; + auto seg_size = seg_size_ref; + Value *length = new_size; if (seg_start != std::get<1>(toIterate.back())) { length = ConstantInt::get(new_size->getType(), seg_start + seg_size);