Skip to content
This repository was archived by the owner on Feb 21, 2026. It is now read-only.

[CIR] Make optnone explicit function attribute - #2036

Merged
bcardosolopes merged 1 commit into
mainfrom
users/xlauko/make-optnone-explicit-attr
Dec 2, 2025
Merged

[CIR] Make optnone explicit function attribute#2036
bcardosolopes merged 1 commit into
mainfrom
users/xlauko/make-optnone-explicit-attr

Conversation

@xlauko

@xlauko xlauko commented Nov 28, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

@xlauko

xlauko commented Nov 28, 2025

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@xlauko
xlauko marked this pull request as ready for review November 28, 2025 08:06
@xlauko
xlauko marked this pull request as draft November 28, 2025 08:06
@github-actions

Copy link
Copy Markdown

鈿狅笍 C/C++ code formatter, clang-format found issues in your code. 鈿狅笍

You can test this locally with the following command:
git-clang-format --diff origin/main HEAD --extensions cpp -- clang/lib/CIR/CodeGen/CIRGenModule.cpp clang/lib/CIR/Dialect/IR/CIRDialect.cpp clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVMIR.cpp clang/test/CIR/CodeGen/call-extra-attrs.cpp clang/test/CIR/CodeGen/conditional-cleanup.cpp clang/test/CIR/CodeGen/optnone.cpp --diff_from_common_commit

鈿狅笍
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.
鈿狅笍

View the diff from clang-format here.
diff --git a/clang/lib/CIR/Dialect/IR/CIRDialect.cpp b/clang/lib/CIR/Dialect/IR/CIRDialect.cpp
index 0798c5c74..e9e18e56a 100644
--- a/clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+++ b/clang/lib/CIR/Dialect/IR/CIRDialect.cpp
@@ -2947,14 +2947,26 @@ void cir::FuncOp::print(OpAsmPrinter &p) {
   function_interface_impl::printFunctionAttributes(
       p, *this,
       // These are all omitted since they are custom printed already.
-      {getAliaseeAttrName(), getBuiltinAttrName(), getCoroutineAttrName(),
-       getDsoLocalAttrName(), getExtraAttrsAttrName(),
-       getFunctionTypeAttrName(), getGlobalCtorPriorityAttrName(),
-       getGlobalDtorPriorityAttrName(), getLambdaAttrName(),
-       getLinkageAttrName(), getCallingConvAttrName(), getNoProtoAttrName(),
-       getOptNoneAttrName(), getSymVisibilityAttrName(), getArgAttrsAttrName(),
-       getResAttrsAttrName(), getComdatAttrName(), getGlobalVisibilityAttrName(),
-       getAnnotationsAttrName(), getCxxSpecialMemberAttrName()});
+      {getAliaseeAttrName(),
+       getBuiltinAttrName(),
+       getCoroutineAttrName(),
+       getDsoLocalAttrName(),
+       getExtraAttrsAttrName(),
+       getFunctionTypeAttrName(),
+       getGlobalCtorPriorityAttrName(),
+       getGlobalDtorPriorityAttrName(),
+       getLambdaAttrName(),
+       getLinkageAttrName(),
+       getCallingConvAttrName(),
+       getNoProtoAttrName(),
+       getOptNoneAttrName(),
+       getSymVisibilityAttrName(),
+       getArgAttrsAttrName(),
+       getResAttrsAttrName(),
+       getComdatAttrName(),
+       getGlobalVisibilityAttrName(),
+       getAnnotationsAttrName(),
+       getCxxSpecialMemberAttrName()});
 
   if (auto aliaseeName = getAliasee()) {
     p << " alias(";

@xlauko
xlauko changed the base branch from users/xlauko/simplify-function-attribute-checks to graphite-base/2036 November 28, 2025 08:14
@xlauko
xlauko force-pushed the users/xlauko/make-optnone-explicit-attr branch from 540c423 to 8477f64 Compare December 2, 2025 20:58
@xlauko
xlauko force-pushed the graphite-base/2036 branch from 9d0a784 to c3e93cd Compare December 2, 2025 20:58
@xlauko
xlauko changed the base branch from graphite-base/2036 to main December 2, 2025 20:58
@xlauko
xlauko marked this pull request as ready for review December 2, 2025 21:05
@bcardosolopes
bcardosolopes merged commit 4088ded into main Dec 2, 2025
12 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants