| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This pass replaces each indirect call/jump with a direct call to a thunk that looks like:
lfence
jmpq *%r11
This ensures that if the value in register %r11 was loaded from memory, then
the value in %r11 is (architecturally) correct prior to the jump.
Also adds a new target feature to X86: +lvi-cfi
("cfi" meaning control-flow integrity)
The feature can be added via clang CLI using -mlvi-cfi.
This is an alternate implementation to https://reviews.llvm.org/D75934 That merges the thunk insertion functionality with the existing X86 retpoline code.
Differential Revision: https://reviews.llvm.org/D76812
|
|
|
|
| |
(cherry picked from commit c8dadac228b7dd3a71d5fc25489d1b884a2b0f5e)
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
AlwaysBreakAfterReturnType option
See https://reviews.llvm.org/D69573
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: As per rsmith (https://reviews.llvm.org/D75383).
Reviewers: hans
Reviewed By: hans
Subscribers: cfe-commits, rsmith
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75469
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bin/clang-tblgen -gen-diag-docs -I../clang/include \
-I../clang/include/clang/Basic/ \
../clang/include/clang/Basic/Diagnostic.td -o \
../clang/docs/DiagnosticsReference.rst && \
bin/clang-tblgen -gen-attr-docs -I../clang/include \
../clang/include/clang/Basic/Attr.td -o \
../clang/docs/AttributeReference.rst && \
bin/clang-tblgen -gen-opt-docs -I../clang/include \
-I../clang/include/clang/Driver -I../llvm/include \
../clang/include/clang/Driver/ClangOptionDocs.td -o \
../clang/docs/ClangCommandLineReference.rst
|
| |
|
| |
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D75125
|
| |
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D75012
|
| |
|
| |
|
|
|
|
|
|
| |
By Andrew Paverd!
Differential revision: https://reviews.llvm.org/D75047
|
| |
|
|
|
|
| |
By Kristof Beyls!
|
|
|
|
| |
By Alexey Bataev!
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
user interface and documentation, and update __cplusplus for C++20.
WG21 considers the C++20 standard to be finished (even though it still
has some more steps to pass through in the ISO process).
The old flag names are accepted for compatibility, as usual, and we
still have lots of references to C++2a in comments and identifiers;
those can be cleaned up separately.
(cherry picked from commit 24ad121582454e625bdad125c90d9ac0dae948c8)
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D73966
By Kristóf Umann!
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D74028
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Since `D66404` adds some significat modifications to the `CFG` we should include it in the release notes.
Reviewers: hans
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74031
|
|
|
|
|
|
| |
This reflects the recent changes done.
Differential Revision: https://reviews.llvm.org/D73834
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bin/clang-tblgen -gen-diag-docs -I../clang/include \
-I../clang/include/clang/Basic/ \
../clang/include/clang/Basic/Diagnostic.td -o \
../clang/docs/DiagnosticsReference.rst && \
bin/clang-tblgen -gen-attr-docs -I../clang/include \
../clang/include/clang/Basic/Attr.td -o \
../clang/docs/AttributeReference.rst && \
bin/clang-tblgen -gen-opt-docs -I../clang/include \
-I../clang/include/clang/Driver -I../llvm/include \
../clang/include/clang/Driver/ClangOptionDocs.td -o \
../clang/docs/ClangCommandLineReference.rst
|
|
|
|
|
|
| |
MIPS specific part of LLVM 10.0 Release notes for LLVM, Clang and LLD.
Differential Revision: https://reviews.llvm.org/D73108
|
|
|
|
|
|
| |
Concepts support has been ported to the 10.x release.
Add information about the feature to the release notes.
|
|
|
|
| |
-flax-vector-conversions on the Clang 10 release branch.
|
|
|
|
|
|
|
|
|
|
|
|
| |
-flax-vector-conversions=all to -flax-vector-conversions=integer."
This patch broke the Sanitizer buildbots. Please see the commit's
differential revision for more information
(https://reviews.llvm.org/D67678).
This reverts commit b72a8c65e4e34779b6bc9e466203f553f5294486.
(cherry picked from commit edd4398f4cd33a305afbca76ac4e6590e9337f4d)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to -flax-vector-conversions=integer.
Summary:
See proposal on cfe-dev:
http://lists.llvm.org/pipermail/cfe-dev/2019-April/062030.html
Reviewers: SjoerdMeijer, eli.friedman
Subscribers: kristof.beyls, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67678
(cherry picked from commit b72a8c65e4e34779b6bc9e466203f553f5294486)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Flags are clang's default UI is flags.
We can have an env var in addition to that, but in D69825 nobody has yet
mentioned why this needs an env var, so omit it for now. If someone
needs to set the flag via env var, the existing CCC_OVERRIDE_OPTIONS
mechanism works for it (set CCC_OVERRIDE_OPTIONS=+-fno-integrated-cc1
for example).
Also mention the cc1-in-process change in the release notes.
Also spruce up the test a bit so it actually tests something :)
Differential Revision: https://reviews.llvm.org/D72769
(cherry picked from commit 8e5018e990b701391e6c33ba85b012343df67272)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GCC supports the conditional operator on VectorTypes that acts as a
'select' in C++ mode. This patch implements the support. Types are
converted as closely to GCC's behavior as possible, though in a few
places consistency with our existing vector type support was preferred.
Note that this implementation is different from the OpenCL version in a
number of ways, so it unfortunately required a different implementation.
First, the SEMA rules and promotion rules are significantly different.
Secondly, GCC implements COND[i] != 0 ? LHS[i] : RHS[i] (where i is in
the range 0- VectorSize, for each element). In OpenCL, the condition is
COND[i] < 0 ? LHS[i]: RHS[i].
In the process of implementing this, it was also required to make the
expression COND ? LHS : RHS type dependent if COND is type dependent,
since the type is now dependent on the condition. For example:
T ? 1 : 2;
Is not typically type dependent, since the result can be deduced from
the operands. HOWEVER, if T is a VectorType now, it could change this
to a 'select' (basically a swizzle with a non-constant mask) with the 1
and 2 being promoted to vectors themselves.
While this is a change, it is NOT a standards incompatible change. Based
on my (and D. Gregor's, at the time of writing the code) reading of the
standard, the expression is supposed to be type dependent if ANY
sub-expression is type dependent.
Differential Revision: https://reviews.llvm.org/D71463
|
|
|
|
| |
This reflects the recent changes done.
|
|
|
|
|
|
|
|
| |
patch"
This reverts commit 4c48ea68e491cb42f1b5d43ffba89f6a7f0dadc4.
The powerpc buildbots had an internal compiler error after this patch.
This requires some inspection.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The analysis for const-ness of local variables required a view generally useful
matchers that are extracted into its own patch.
They are `decompositionDecl` and `forEachArgumentWithParamType`, that works
for calls through function pointers as well.
Reviewers: aaron.ballman
Reviewed By: aaron.ballman
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72505
|
|
|
|
| |
Accepts child matchers cxxThisExpr to match on capture of this and also on varDecl.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This checker verifies if default placement new is provided with pointers
to sufficient storage capacity.
Noncompliant Code Example:
#include <new>
void f() {
short s;
long *lp = ::new (&s) long;
}
Based on SEI CERT rule MEM54-CPP
https://wiki.sei.cmu.edu/confluence/display/cplusplus/MEM54-CPP.+Provide+placement+new+with+properly+aligned+pointe
This patch does not implement checking of the alignment.
Reviewers: NoQ, xazax.hun
Subscribers: mgorny, whisperity, xazax.hun, baloghadamsoftware, szepet,
rnkovacs, a.sidorin, mikhail.ramalho, donat
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71612
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change introduces three new builtins (which work on both pointers
and integers) that can be used instead of common bitwise arithmetic:
__builtin_align_up(x, alignment), __builtin_align_down(x, alignment) and
__builtin_is_aligned(x, alignment).
I originally added these builtins to the CHERI fork of LLVM a few years ago
to handle the slightly different C semantics that we use for CHERI [1].
Until recently these builtins (or sequences of other builtins) were
required to generate correct code. I have since made changes to the default
C semantics so that they are no longer strictly necessary (but using them
does generate slightly more efficient code). However, based on our experience
using them in various projects over the past few years, I believe that adding
these builtins to clang would be useful.
These builtins have the following benefit over bit-manipulation and casts
via uintptr_t:
- The named builtins clearly convey the semantics of the operation. While
checking alignment using __builtin_is_aligned(x, 16) versus
((x & 15) == 0) is probably not a huge win in readably, I personally find
__builtin_align_up(x, N) a lot easier to read than (x+(N-1))&~(N-1).
- They preserve the type of the argument (including const qualifiers). When
using casts via uintptr_t, it is easy to cast to the wrong type or strip
qualifiers such as const.
- If the alignment argument is a constant value, clang can check that it is
a power-of-two and within the range of the type. Since the semantics of
these builtins is well defined compared to arbitrary bit-manipulation,
it is possible to add a UBSAN checker that the run-time value is a valid
power-of-two. I intend to add this as a follow-up to this change.
- The builtins avoids int-to-pointer casts both in C and LLVM IR.
In the future (i.e. once most optimizations handle it), we could use the new
llvm.ptrmask intrinsic to avoid the ptrtoint instruction that would normally
be generated.
- They can be used to round up/down to the next aligned value for both
integers and pointers without requiring two separate macros.
- In many projects the alignment operations are already wrapped in macros (e.g.
roundup2 and rounddown2 in FreeBSD), so by replacing the macro implementation
with a builtin call, we get improved diagnostics for many call-sites while
only having to change a few lines.
- Finally, the builtins also emit assume_aligned metadata when used on pointers.
This can improve code generation compared to the uintptr_t casts.
[1] In our CHERI compiler we have compilation mode where all pointers are
implemented as capabilities (essentially unforgeable 128-bit fat pointers).
In our original model, casts from uintptr_t (which is a 128-bit capability)
to an integer value returned the "offset" of the capability (i.e. the
difference between the virtual address and the base of the allocation).
This causes problems for cases such as checking the alignment: for example, the
expression `if ((uintptr_t)ptr & 63) == 0` is generally used to check if the
pointer is aligned to a multiple of 64 bytes. The problem with offsets is that
any pointer to the beginning of an allocation will have an offset of zero, so
this check always succeeds in that case (even if the address is not correctly
aligned). The same issues also exist when aligning up or down. Using the
alignment builtins ensures that the address is used instead of the offset. While
I have since changed the default C semantics to return the address instead of
the offset when casting, this offset compilation mode can still be used by
passing a command-line flag.
Reviewers: rsmith, aaron.ballman, theraven, fhahn, lebedev.ri, nlopes, aqjune
Reviewed By: aaron.ballman, lebedev.ri
Differential Revision: https://reviews.llvm.org/D71499
|
|
|
|
| |
To avoid potential confusion with OpenCL C++.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Pretty self-evident. This example was missing an lparen. Added it, and fixed up the ASCII art.
Patch by Nick Black <dankamongmen@gmail.com>
Reviewers: pcc
Reviewed By: pcc
Subscribers: tejohnson, mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, cfe-commits
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D70765
|
|
|
|
|
|
|
|
| |
This matcher matches any node and at the same time executes all its
inner matchers to produce any possbile result bindings.
This is useful when a user wants certain supplementary information
that's not always present along with the main match result.
|
|
|
|
|
|
|
|
|
| |
Remove description of language mode from the language
extensions and add a link to pdf document.
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72076
|
|
|
|
|
|
|
|
|
|
| |
Adds a new ASTMatcher condition called 'hasInitStatement()' that matches if,
switch and range-for statements with an initializer. Reworked clang-tidy
readability-else-after-return to handle variables in the if condition or init
statements in c++17 ifs. Also checks if removing the else would affect object
lifetimes in the else branch.
Fixes PR44364.
|
| |
|
| |
|
|
|
|
|
|
|
| |
The checker can diagnose handle use after releases, double releases, and
handle leaks.
Differential Revision: https://reviews.llvm.org/D70470
|