Skip to content

Commit d4994cb

Browse files
committed
Renaming the tablegen option based on offline discussion; NFC
1 parent 7572651 commit d4994cb

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

clang/include/clang/Basic/Attr.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,13 @@ class SubjectList<list<AttrSubject> subjects, SubjectDiag diag = WarnDiag,
317317
string CustomDiag = customDiag;
318318
}
319319

320-
class LangOpt<string name, code customCode = [{}], bit warn = 1> {
320+
class LangOpt<string name, code customCode = [{}], bit silentlyIgnore = 0> {
321321
// The language option to test; ignored when custom code is supplied.
322322
string Name = name;
323323

324-
// If set to 0, the attribute is accepted but is silently ignored. This is
324+
// If set to 1, the attribute is accepted but is silently ignored. This is
325325
// useful in multi-compilation situations like SYCL.
326-
bit Warn = warn;
326+
bit SilentlyIgnore = silentlyIgnore;
327327

328328
// A custom predicate, written as an expression evaluated in a context with
329329
// "LangOpts" bound.
@@ -336,7 +336,7 @@ def HIP : LangOpt<"HIP">;
336336
def SYCL : LangOpt<"SYCL">;
337337
def SYCLIsDevice : LangOpt<"SYCLIsDevice">;
338338
def SYCLIsHost : LangOpt<"SYCLIsHost">;
339-
def SilentlyIgnoreSYCLIsHost : LangOpt<"SYCLIsHost", "", 0>;
339+
def SilentlyIgnoreSYCLIsHost : LangOpt<"SYCLIsHost", "", 1>;
340340
def SYCLExplicitSIMD : LangOpt<"SYCLExplicitSIMD">;
341341
def COnly : LangOpt<"", "!LangOpts.CPlusPlus">;
342342
def CPlusPlus : LangOpt<"CPlusPlus">;

clang/utils/TableGen/ClangAttrEmitter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1997,8 +1997,8 @@ static std::string GenerateTestExpression(ArrayRef<Record *> LangOpts,
19971997
std::string Test;
19981998

19991999
for (auto *E : LangOpts) {
2000-
bool LangOptWantsWarning = E->getValueAsBit("Warn");
2001-
if (LangOptWantsWarning != IsAttrAccepted)
2000+
bool SilentlyIgnore = E->getValueAsBit("SilentlyIgnore");
2001+
if (SilentlyIgnore == IsAttrAccepted)
20022002
continue;
20032003

20042004
if (!Test.empty())
@@ -2015,7 +2015,7 @@ static std::string GenerateTestExpression(ArrayRef<Record *> LangOpts,
20152015
"non-empty 'Name' field ignored because 'CustomCode' was supplied");
20162016
}
20172017
} else {
2018-
if (!IsAttrAccepted && !LangOptWantsWarning)
2018+
if (!IsAttrAccepted && SilentlyIgnore)
20192019
Test += "!";
20202020
Test += "LangOpts.";
20212021
Test += E->getValueAsString("Name");

0 commit comments

Comments
 (0)