Skip to content

Commit ad6db56

Browse files
committed
Merge from 'master' to 'sycl-web' (intel#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"

clang/include/clang/Basic/DiagnosticIDs.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ namespace clang {
6464

6565
// Get typedefs for common diagnostics.
6666
enum {
67-
#define DIAG(ENUM, FLAGS, DEFAULT_MAPPING, DESC, GROUP, SFINAE, CATEGORY, \
68-
NOWERROR, SHOWINSYSHEADER, DEFFERABLE) \
69-
ENUM,
67+
#define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,\
68+
SFINAE,CATEGORY,NOWERROR,SHOWINSYSHEADER) ENUM,
7069
#define COMMONSTART
7170
#include "clang/Basic/DiagnosticCommonKinds.inc"
7271
NUM_BUILTIN_COMMON_DIAGNOSTICS
@@ -281,13 +280,6 @@ class DiagnosticIDs : public RefCountedBase<DiagnosticIDs> {
281280
/// are not SFINAE errors.
282281
static SFINAEResponse getDiagnosticSFINAEResponse(unsigned DiagID);
283282

284-
/// Whether the diagnostic message can be deferred.
285-
///
286-
/// For single source offloading languages, a diagnostic message occurred
287-
/// in a device host function may be deferred until the function is sure
288-
/// to be emitted.
289-
static bool isDeferrable(unsigned DiagID);
290-
291283
/// Get the string of all diagnostic flags.
292284
///
293285
/// \returns A list of all diagnostics flags as they would be written in a

clang/include/clang/Basic/DiagnosticLex.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 LEXSTART
2121
#include "clang/Basic/DiagnosticLexKinds.inc"

clang/include/clang/Basic/DiagnosticParse.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 PARSESTART
2121
#include "clang/Basic/DiagnosticParseKinds.inc"

clang/include/clang/Basic/DiagnosticRefactoring.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 REFACTORINGSTART
2121
#include "clang/Basic/DiagnosticRefactoringKinds.inc"

clang/include/clang/Basic/DiagnosticSema.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 SEMASTART
2121
#include "clang/Basic/DiagnosticSemaKinds.inc"

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4141,8 +4141,6 @@ def err_ovl_static_nonstatic_member : Error<
41414141
"static and non-static member functions with the same parameter types "
41424142
"cannot be overloaded">;
41434143

4144-
let Deferrable = 1 in {
4145-
41464144
def err_ovl_no_viable_function_in_call : Error<
41474145
"no matching function for call to %0">;
41484146
def err_ovl_no_viable_member_function_in_call : Error<
@@ -4456,8 +4454,6 @@ def err_addr_ovl_not_func_ptrref : Error<
44564454
def err_addr_ovl_no_qualifier : Error<
44574455
"cannot form member pointer of type %0 without '&' and class name">;
44584456

4459-
} // let Deferrable
4460-
44614457
// C++11 Literal Operators
44624458
def err_ovl_no_viable_literal_operator : Error<
44634459
"no matching literal operator for call to %0"

clang/include/clang/Basic/DiagnosticSerialization.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 SERIALIZATIONSTART
2121
#include "clang/Basic/DiagnosticSerializationKinds.inc"

clang/include/clang/Basic/LangOptions.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ LANGOPT(CUDADeviceApproxTranscendentals, 1, 0, "using approximate transcendental
241241
LANGOPT(GPURelocatableDeviceCode, 1, 0, "generate relocatable device code")
242242
LANGOPT(GPUAllowDeviceInit, 1, 0, "allowing device side global init functions for HIP")
243243
LANGOPT(GPUMaxThreadsPerBlock, 32, 256, "default max threads per block for kernel launch bounds for HIP")
244-
LANGOPT(GPUDeferDiag, 1, 0, "defer host/device related diagnostic messages for CUDA/HIP")
245244

246245
LANGOPT(SYCL , 1, 0, "SYCL")
247246
LANGOPT(SYCLIsDevice , 1, 0, "Generate code for SYCL device")

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,9 +688,6 @@ defm hip_new_launch_api : OptInFFlag<"hip-new-launch-api",
688688
"Use", "Don't use", " new kernel launching API for HIP">;
689689
defm gpu_allow_device_init : OptInFFlag<"gpu-allow-device-init",
690690
"Allow", "Don't allow", " device side init function in HIP">;
691-
defm gpu_defer_diag : OptInFFlag<"gpu-defer-diag",
692-
"Defer", "Don't defer", " host/device related diagnostic messages"
693-
" for CUDA/HIP">;
694691
def gpu_max_threads_per_block_EQ : Joined<["--"], "gpu-max-threads-per-block=">,
695692
Flags<[CC1Option]>,
696693
HelpText<"Default max threads per block for kernel launch bounds for HIP">;

clang/include/clang/Parse/Parser.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,6 +2812,14 @@ class Parser : public CodeCompletionHandler {
28122812
SourceLocation ScopeLoc,
28132813
ParsedAttr::Syntax Syntax);
28142814

2815+
void ParseSwiftNewTypeAttribute(IdentifierInfo &AttrName,
2816+
SourceLocation AttrNameLoc,
2817+
ParsedAttributes &Attrs,
2818+
SourceLocation *EndLoc,
2819+
IdentifierInfo *ScopeName,
2820+
SourceLocation ScopeLoc,
2821+
ParsedAttr::Syntax Syntax);
2822+
28152823
void ParseTypeTagForDatatypeAttribute(IdentifierInfo &AttrName,
28162824
SourceLocation AttrNameLoc,
28172825
ParsedAttributes &Attrs,

0 commit comments

Comments
 (0)