Skip to content

Commit d76d83c

Browse files
committed
Merge remote-tracking branch 'origin/sycl-web' into private/vlazarev/llvmspirv_pulldown
2 parents 4e6cf6f + 7685c6b commit d76d83c

File tree

272 files changed

+5046
-2184
lines changed

Some content is hidden

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

272 files changed

+5046
-2184
lines changed

clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ void TransformerClangTidyCheck::check(
112112
}
113113
}
114114

115+
void TransformerClangTidyCheck::storeOptions(
116+
ClangTidyOptions::OptionMap &Opts) {
117+
Options.store(Opts, "IncludeStyle", IncludeStyle,
118+
IncludeSorter::getMapping());
119+
}
120+
115121
} // namespace utils
116122
} // namespace tidy
117123
} // namespace clang

clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ class TransformerClangTidyCheck : public ClangTidyCheck {
6767
void registerMatchers(ast_matchers::MatchFinder *Finder) final;
6868
void check(const ast_matchers::MatchFinder::MatchResult &Result) final;
6969

70+
/// Derived classes that override this function should call this method from
71+
/// the overridden method.
72+
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
73+
7074
private:
7175
Optional<transformer::RewriteRule> Rule;
7276
const IncludeSorter::IncludeStyle IncludeStyle;

clang/docs/ReleaseNotes.rst

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ Non-comprehensive list of changes in this release
6767
- clang adds support for a set of extended integer types (``_ExtInt(N)``) that
6868
permit non-power of 2 integers, exposing the LLVM integer types. Since a major
6969
motivating use case for these types is to limit 'bit' usage, these types don't
70-
automatically promote to 'int' when operations are done between two ``ExtInt(N)``
71-
types, instead math occurs at the size of the largest ``ExtInt(N)`` type.
70+
automatically promote to 'int' when operations are done between two
71+
``ExtInt(N)`` types, instead math occurs at the size of the largest
72+
``ExtInt(N)`` type.
7273

7374
- Users of UBSan, PGO, and coverage on Windows will now need to add clang's
7475
library resource directory to their library search path. These features all
@@ -81,17 +82,15 @@ Non-comprehensive list of changes in this release
8182
linker. If the user links the program with the ``clang`` or ``clang-cl``
8283
drivers, the driver will pass this flag for them.
8384

84-
8585
New Compiler Flags
8686
------------------
8787

88-
8988
- -fstack-clash-protection will provide a protection against the stack clash
9089
attack for x86 architecture through automatic probing of each page of
9190
allocated stack.
9291

9392
- -ffp-exception-behavior={ignore,maytrap,strict} allows the user to specify
94-
the floating-point exception behavior. The default setting is ``ignore``.
93+
the floating-point exception behavior. The default setting is ``ignore``.
9594

9695
- -ffp-model={precise,strict,fast} provides the user an umbrella option to
9796
simplify access to the many single purpose floating point options. The default
@@ -110,11 +109,11 @@ Modified Compiler Flags
110109

111110
- -fno-common has been enabled as the default for all targets. Therefore, C
112111
code that uses tentative definitions as definitions of a variable in multiple
113-
translation units will trigger multiple-definition linker errors. Generally,
114-
this occurs when the use of the ``extern`` keyword is neglected in the declaration
115-
of a variable in a header file. In some cases, no specific translation unit
116-
provides a definition of the variable. The previous behavior can be restored by
117-
specifying ``-fcommon``.
112+
translation units will trigger multiple-definition linker errors. Generally,
113+
this occurs when the use of the ``extern`` keyword is neglected in the
114+
declaration of a variable in a header file. In some cases, no specific
115+
translation unit provides a definition of the variable. The previous
116+
behavior can be restored by specifying ``-fcommon``.
118117
- -Wasm-ignored-qualifier (ex. `asm const ("")`) has been removed and replaced
119118
with an error (this matches a recent change in GCC-9).
120119
- -Wasm-file-asm-volatile (ex. `asm volatile ("")` at global scope) has been
@@ -176,7 +175,7 @@ C++ Language Changes in Clang
176175
Previous versions of Clang rejected some constructs of this form
177176
(specifically, where the linkage of the type happened to be computed
178177
before the parser reached the typedef name); those cases are still rejected
179-
in Clang 11. In addition, cases that previous versions of Clang did not
178+
in Clang 11. In addition, cases that previous versions of Clang did not
180179
reject now produce an extension warning. This warning can be disabled with
181180
the warning flag ``-Wno-non-c-typedef-for-linkage``.
182181

@@ -207,7 +206,6 @@ C++1z Feature Support
207206
Objective-C Language Changes in Clang
208207
-------------------------------------
209208

210-
211209
OpenCL C Language Changes in Clang
212210
----------------------------------
213211

@@ -216,7 +214,6 @@ OpenCL C Language Changes in Clang
216214
ABI Changes in Clang
217215
--------------------
218216

219-
220217
OpenMP Support in Clang
221218
-----------------------
222219

@@ -234,7 +231,6 @@ These are major API changes that have happened since the 10.0.0 release of
234231
Clang. If upgrading an external codebase that uses Clang as a library,
235232
this section should help get you past the largest hurdles of upgrading.
236233

237-
238234
Build System Changes
239235
--------------------
240236

@@ -255,15 +251,11 @@ AST Matchers
255251
clang-format
256252
------------
257253

258-
259254
- Option ``IndentCaseBlocks`` has been added to support treating the block
260255
following a switch case label as a scope block which gets indented itself.
261256
It helps avoid having the closing bracket align with the switch statement's
262257
closing bracket (when ``IndentCaseLabels`` is ``false``).
263258

264-
- Option ``ObjCBreakBeforeNestedBlockParam`` has been added to optionally apply
265-
linebreaks for function arguments declarations before nested blocks.
266-
267259
.. code-block:: c++
268260

269261
switch (fool) { vs. switch (fool) {
@@ -278,6 +270,9 @@ clang-format
278270
}
279271
}
280272

273+
- Option ``ObjCBreakBeforeNestedBlockParam`` has been added to optionally apply
274+
linebreaks for function arguments declarations before nested blocks.
275+
281276
- Option ``InsertTrailingCommas`` can be set to ``TCS_Wrapped`` to insert
282277
trailing commas in container literals (arrays and objects) that wrap across
283278
multiple lines. It is currently only available for JavaScript and disabled by
@@ -317,7 +312,6 @@ Static Analyzer
317312
Undefined Behavior Sanitizer (UBSan)
318313
------------------------------------
319314

320-
321315
Core Analysis Improvements
322316
==========================
323317

clang/include/clang/CodeGen/CodeGenABITypes.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "clang/CodeGen/CGFunctionInfo.h"
2929

3030
namespace llvm {
31+
class AttrBuilder;
3132
class Constant;
3233
class DataLayout;
3334
class Module;
@@ -86,6 +87,25 @@ llvm::Type *convertTypeForMemory(CodeGenModule &CGM, QualType T);
8687
unsigned getLLVMFieldNumber(CodeGenModule &CGM,
8788
const RecordDecl *RD, const FieldDecl *FD);
8889

90+
/// Given the language and code-generation options that Clang was configured
91+
/// with, set the default LLVM IR attributes for a function definition.
92+
/// The attributes set here are mostly global target-configuration and
93+
/// pipeline-configuration options like the target CPU, variant stack
94+
/// rules, whether to optimize for size, and so on. This is useful for
95+
/// frontends (such as Swift) that generally intend to interoperate with
96+
/// C code and rely on Clang's target configuration logic.
97+
///
98+
/// As a general rule, this function assumes that meaningful attributes
99+
/// haven't already been added to the builder. It won't intentionally
100+
/// displace any existing attributes, but it also won't check to avoid
101+
/// overwriting them. Callers should generally apply customizations after
102+
/// making this call.
103+
///
104+
/// This function assumes that the caller is not defining a function that
105+
/// requires special no-builtin treatment.
106+
void addDefaultFunctionDefinitionAttributes(CodeGenModule &CGM,
107+
llvm::AttrBuilder &attrs);
108+
89109
/// Returns the default constructor for a C struct with non-trivially copyable
90110
/// fields, generating it if necessary. The returned function uses the `cdecl`
91111
/// calling convention, returns void, and takes a single argument that is a

0 commit comments

Comments
 (0)