-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[clang-format] Add 'cl' to enable OpenCL kernel file formatting #134529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-clang-format Author: Wenju He (wenju-he) ChangesFull diff: https://github.com/llvm/llvm-project/pull/134529.diff 1 Files Affected:
diff --git a/clang/tools/clang-format/git-clang-format b/clang/tools/clang-format/git-clang-format
index 85eff4761e289..ba324b14ab80d 100755
--- a/clang/tools/clang-format/git-clang-format
+++ b/clang/tools/clang-format/git-clang-format
@@ -126,6 +126,7 @@ def main():
"pb.txt",
"textproto",
"asciipb", # TextProto
+ "cl", # OpenCL
]
)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like there are more places where this needs to be addressed if we are going to add it.
i.e. clang-format-diff.py |
should we consider .ocl? |
Thanks. I just find out that OpenCL support was already added in clang-format-diff.py by c49406d |
I added support in language detection for OpenCL in 88c1174. It returns C language since OpenCL is based on C99 and C11 with restrictions, see https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_C.html |
.ocl isn't used as file extension for OpenCL. See
|
OpenCL is formatted as C++ now. Do we really need to change that? See #132832 for potential problems. |
This reverts commit 88c1174.
reverted. Thanks. Default should be better if it works better. |
1c75586
to
c365f72
Compare
@owenca could you please help me to merge? Thanks. I don't have commit permission. |
…#134529) There are many .cl files in llvm repo. It would be great that clang-format can support it.
There are many .cl files in llvm repo. It would be great that clang-format can support it.