[clang] [CIR] Lower calls to trivial copy constructor to cir::CopyOp (PR #168281)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 16 10:37:17 PST 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- clang/test/CIR/CodeGen/cxx-special-member-attr.cpp clang/lib/CIR/CodeGen/CIRGenClass.cpp clang/lib/CIR/CodeGen/CIRGenFunction.cpp clang/lib/CIR/CodeGen/CIRGenModule.cpp clang/lib/CIR/CodeGen/CIRGenModule.h clang/lib/CIR/Dialect/IR/CIRDialect.cpp clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp clang/test/CIR/CodeGen/struct.cpp clang/test/CIR/CodeGenOpenACC/combined-firstprivate-clause.cpp clang/test/CIR/CodeGenOpenACC/compute-firstprivate-clause-templates.cpp clang/test/CIR/CodeGenOpenACC/compute-firstprivate-clause.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp b/clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp
index 5aa482a66..86db27d4a 100644
--- a/clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp
+++ b/clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp
@@ -995,8 +995,8 @@ void LoweringPreparePass::lowerTrivialCopyCall(cir::CallOp op) {
llvm::errs() << "Lower trivial copy call: " << funcOp.getName() << "\n";
std::optional<cir::CtorKind> ctorKind = funcOp.getCxxConstructorKind();
- if (ctorKind && *ctorKind == cir::CtorKind::Copy
- && funcOp.isCxxTrivialMemberFunction()) {
+ if (ctorKind && *ctorKind == cir::CtorKind::Copy &&
+ funcOp.isCxxTrivialMemberFunction()) {
llvm::outs() << "success \n";
// Replace the trivial copy constructor call with a `CopyOp`
CIRBaseBuilderTy builder(getContext());
``````````
</details>
https://github.com/llvm/llvm-project/pull/168281
More information about the cfe-commits
mailing list