Skip to content

Commit 69825a4

Browse files
committed
Revert "return C language format style for OpenCL"
This reverts commit 88c1174.
1 parent 88c1174 commit 69825a4

File tree

4 files changed

+1
-17
lines changed

4 files changed

+1
-17
lines changed

clang/lib/Format/Format.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4094,9 +4094,6 @@ static FormatStyle::LanguageKind getLanguageByFileName(StringRef FileName) {
40944094
FileName.ends_with_insensitive(".vh")) {
40954095
return FormatStyle::LK_Verilog;
40964096
}
4097-
// OpenCL is based on C99 and C11.
4098-
if (FileName.ends_with(".cl"))
4099-
return FormatStyle::LK_C;
41004097
return FormatStyle::LK_Cpp;
41014098
}
41024099

@@ -4124,8 +4121,6 @@ static FormatStyle::LanguageKind getLanguageByComment(const Environment &Env) {
41244121
return FormatStyle::LK_Cpp;
41254122
if (Text == "ObjC")
41264123
return FormatStyle::LK_ObjC;
4127-
if (Text == "OpenCL")
4128-
return FormatStyle::LK_C;
41294124
}
41304125

41314126
return FormatStyle::LK_None;

clang/test/Format/dump-config-opencl-stdin.cl

Lines changed: 0 additions & 7 deletions
This file was deleted.

clang/test/Format/lit.local.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ config.suffixes = [
2020
".textpb",
2121
".asciipb",
2222
".td",
23-
".test",
24-
".cl"
23+
".test"
2524
]
2625

2726
# AIX 'diff' command doesn't support --strip-trailing-cr, but the internal

clang/unittests/Format/FormatTest.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25187,9 +25187,6 @@ TEST_F(FormatTest, GetLanguageByComment) {
2518725187
EXPECT_EQ(FormatStyle::LK_ObjC,
2518825188
guessLanguage("foo.h", "// clang-format Language: ObjC\n"
2518925189
"int i;"));
25190-
EXPECT_EQ(FormatStyle::LK_C,
25191-
guessLanguage("foo.h", "// clang-format Language: OpenCL\n"
25192-
"int i;"));
2519325190
}
2519425191

2519525192
TEST_F(FormatTest, TypenameMacros) {

0 commit comments

Comments
 (0)