Skip to content

Commit ad6db56

Browse files
committed
Merge from 'master' to 'sycl-web' (#34)
CONFLICT (content): Merge conflict in clang/lib/Sema/SemaSYCL.cpp CONFLICT (content): Merge conflict in clang/include/clang/Sema/Sema.h
2 parents 489bab4 + 3453b69 commit ad6db56

File tree

118 files changed

+2662
-1142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+2662
-1142
lines changed

clang-tools-extra/clangd/Diagnostics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace {
4343
const char *getDiagnosticCode(unsigned ID) {
4444
switch (ID) {
4545
#define DIAG(ENUM, CLASS, DEFAULT_MAPPING, DESC, GROPU, SFINAE, NOWERROR, \
46-
SHOWINSYSHEADER, DEFERRABLE, CATEGORY) \
46+
SHOWINSYSHEADER, CATEGORY) \
4747
case clang::diag::ENUM: \
4848
return #ENUM;
4949
#include "clang/Basic/DiagnosticASTKinds.inc"

clang/include/clang/Basic/Attr.td

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2665,6 +2665,15 @@ def SwiftName : InheritableAttr {
26652665
let Documentation = [SwiftNameDocs];
26662666
}
26672667

2668+
def SwiftNewType : InheritableAttr {
2669+
let Spellings = [GNU<"swift_newtype">, GNU<"swift_wrapper">];
2670+
let Args = [EnumArgument<"NewtypeKind", "NewtypeKind",
2671+
["struct", "enum"], ["NK_Struct", "NK_Enum"]>];
2672+
let Subjects = SubjectList<[TypedefName], ErrorDiag>;
2673+
let Documentation = [SwiftNewTypeDocs];
2674+
let HasCustomParsing = 1;
2675+
}
2676+
26682677
def NoDeref : TypeAttr {
26692678
let Spellings = [Clang<"noderef">];
26702679
let Documentation = [NoDerefDocs];

clang/include/clang/Basic/AttrDocs.td

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4085,6 +4085,36 @@ must be a simple or qualified identifier.
40854085
}];
40864086
}
40874087

4088+
def SwiftNewTypeDocs : Documentation {
4089+
let Category = SwiftDocs;
4090+
let Heading = "swift_newtype";
4091+
let Content = [{
4092+
The ``swift_newtype`` attribute indicates that the typedef to which the
4093+
attribute appertains is imported as a new Swift type of the typedef's name.
4094+
Previously, the attribute was spelt ``swift_wrapper``. While the behaviour of
4095+
the attribute is identical with either spelling, ``swift_wrapper`` is
4096+
deprecated, only exists for compatibility purposes, and should not be used in
4097+
new code.
4098+
4099+
* ``swift_newtype(struct)`` means that a Swift struct will be created for this
4100+
typedef.
4101+
4102+
* ``swift_newtype(enum)`` means that a Swift enum will be created for this
4103+
ypedef.
4104+
4105+
.. code-block:: c
4106+
4107+
// Import UIFontTextStyle as an enum type, with enumerated values being
4108+
// constants.
4109+
typedef NSString * UIFontTextStyle __attribute__((__swift_newtype__(enum)));
4110+
4111+
// Import UIFontDescriptorFeatureKey as a structure type, with enumerated
4112+
// values being members of the type structure.
4113+
typedef NSString * UIFontDescriptorFeatureKey __attribute__((__swift_newtype__(struct)));
4114+
4115+
}];
4116+
}
4117+
40884118
def OMPDeclareSimdDocs : Documentation {
40894119
let Category = DocCatFunction;
40904120
let Heading = "#pragma omp declare simd";

clang/include/clang/Basic/Diagnostic.td

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class TextSubstitution<string Text> {
4545
// diagnostics
4646
string Component = "";
4747
string CategoryName = "";
48-
bit Deferrable = 0;
4948
}
5049

5150
// Diagnostic Categories. These can be applied to groups or individual
@@ -84,7 +83,6 @@ class Diagnostic<string text, DiagClass DC, Severity defaultmapping> {
8483
bit AccessControl = 0;
8584
bit WarningNoWerror = 0;
8685
bit ShowInSystemHeader = 0;
87-
bit Deferrable = 0;
8886
Severity DefaultSeverity = defaultmapping;
8987
DiagGroup Group;
9088
string CategoryName = "";
@@ -108,14 +106,6 @@ class SuppressInSystemHeader {
108106
bit ShowInSystemHeader = 0;
109107
}
110108

111-
class Deferrable {
112-
bit Deferrable = 1;
113-
}
114-
115-
class NonDeferrable {
116-
bit Deferrable = 0;
117-
}
118-
119109
// FIXME: ExtWarn and Extension should also be SFINAEFailure by default.
120110
class Error<string str> : Diagnostic<str, CLASS_ERROR, SEV_Error>, SFINAEFailure {
121111
bit ShowInSystemHeader = 1;

clang/include/clang/Basic/DiagnosticAST.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace clang {
1515
namespace diag {
1616
enum {
1717
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, DEFERRABLE, CATEGORY) \
18+
SHOWINSYSHEADER, CATEGORY) \
1919
ENUM,
2020
#define ASTSTART
2121
#include "clang/Basic/DiagnosticASTKinds.inc"

clang/include/clang/Basic/DiagnosticAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace clang {
1515
namespace diag {
1616
enum {
1717
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, DEFERRABLE, CATEGORY) \
18+
SHOWINSYSHEADER, CATEGORY) \
1919
ENUM,
2020
#define ANALYSISSTART
2121
#include "clang/Basic/DiagnosticAnalysisKinds.inc"

clang/include/clang/Basic/DiagnosticComment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace clang {
1515
namespace diag {
1616
enum {
1717
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, DEFERRABLE, CATEGORY) \
18+
SHOWINSYSHEADER, CATEGORY) \
1919
ENUM,
2020
#define COMMENTSTART
2121
#include "clang/Basic/DiagnosticCommentKinds.inc"

clang/include/clang/Basic/DiagnosticCrossTU.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace clang {
1515
namespace diag {
1616
enum {
1717
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, DEFERRABLE, CATEGORY) \
18+
SHOWINSYSHEADER, CATEGORY) \
1919
ENUM,
2020
#define CROSSTUSTART
2121
#include "clang/Basic/DiagnosticCrossTUKinds.inc"

clang/include/clang/Basic/DiagnosticDriver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace clang {
1515
namespace diag {
1616
enum {
1717
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, DEFERRABLE, CATEGORY) \
18+
SHOWINSYSHEADER, CATEGORY) \
1919
ENUM,
2020
#define DRIVERSTART
2121
#include "clang/Basic/DiagnosticDriverKinds.inc"

clang/include/clang/Basic/DiagnosticFrontend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace clang {
1515
namespace diag {
1616
enum {
1717
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, NOWERROR, \
18-
SHOWINSYSHEADER, DEFERRABLE, CATEGORY) \
18+
SHOWINSYSHEADER, CATEGORY) \
1919
ENUM,
2020
#define FRONTENDSTART
2121
#include "clang/Basic/DiagnosticFrontendKinds.inc"

0 commit comments

Comments
 (0)