https://github.com/mylai-mtk created https://github.com/llvm/llvm-project/pull/107050
Hi, this is my first time sending a PR to the LLVM repo. I ran into this bug when implementing a feature in my private repo, and I think maybe I can take this small patch as a chance to practice contributing to LLVM, so here I publish the fix to this small but certain bug :) >From c62066b1cca052b6258ce1e44788cf1f9a35bb01 Mon Sep 17 00:00:00 2001 From: Ming-Yi Lai <ming-yi....@mediatek.com> Date: Wed, 19 Jun 2024 11:28:52 +0800 Subject: [PATCH] [clang] Fix bug of FnInfoOpts::operator&= and FnInfoOpts::operator|= not updating assigned operands --- clang/lib/CodeGen/CGCall.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/lib/CodeGen/CGCall.h b/clang/lib/CodeGen/CGCall.h index 6fa65e1916183a..21cc8504bf25cc 100644 --- a/clang/lib/CodeGen/CGCall.h +++ b/clang/lib/CodeGen/CGCall.h @@ -450,12 +450,12 @@ inline FnInfoOpts operator&(FnInfoOpts A, FnInfoOpts B) { llvm::to_underlying(B)); } -inline FnInfoOpts operator|=(FnInfoOpts A, FnInfoOpts B) { +inline FnInfoOpts& operator|=(FnInfoOpts &A, FnInfoOpts B) { A = A | B; return A; } -inline FnInfoOpts operator&=(FnInfoOpts A, FnInfoOpts B) { +inline FnInfoOpts& operator&=(FnInfoOpts &A, FnInfoOpts B) { A = A & B; return A; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits