#
bf736037 |
| 04-Aug-2017 |
Vlad Tsyrklevich <vlad@tsyrklevich.net> |
Reland "CFI: blacklist STL allocate() from unrelated-casts"
Reland r310097 with a unit test fix for MS ABI build bots.
Differential Revision: https://reviews.llvm.org/D36294
llvm-svn: 310105
|
#
3fed079f |
| 04-Aug-2017 |
Vlad Tsyrklevich <vlad@tsyrklevich.net> |
Revert "CFI: blacklist STL allocate() from unrelated-casts"
This reverts commit r310097.
llvm-svn: 310099
|
#
44200125 |
| 04-Aug-2017 |
Vlad Tsyrklevich <vlad@tsyrklevich.net> |
CFI: blacklist STL allocate() from unrelated-casts
Summary: Previously, STL allocators were blacklisted in compiler_rt's cfi_blacklist.txt because they mandated a cast from void* to T* before object
CFI: blacklist STL allocate() from unrelated-casts
Summary: Previously, STL allocators were blacklisted in compiler_rt's cfi_blacklist.txt because they mandated a cast from void* to T* before object initialization completed. This change moves that logic into the front end because C++ name mangling supports a substitution compression mechanism for symbols that makes it difficult to blacklist the mangled symbol for allocate() using a regular expression.
Motivated by crbug.com/751385.
Reviewers: pcc, kcc
Reviewed By: pcc
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D36294
llvm-svn: 310097
show more ...
|
Revision tags: llvmorg-5.0.0-rc1 |
|
#
7d7f0dc0 |
| 26-Jul-2017 |
Alexey Sotkin <alexey.sotkin@intel.com> |
[OpenCL] Fix access qualifiers metadata for kernel arguments with typedef
Subscribers: cfe-commits, yaxunl, Anastasia
Differential Revision: https://reviews.llvm.org/D35420
llvm-svn: 309155
|
#
c34d343f |
| 23-Jun-2017 |
Vedant Kumar <vsk@apple.com> |
[ubsan] Improve diagnostics for return value checks (clang)
This patch makes ubsan's nonnull return value diagnostics more precise, which makes the diagnostics more useful when there are multiple re
[ubsan] Improve diagnostics for return value checks (clang)
This patch makes ubsan's nonnull return value diagnostics more precise, which makes the diagnostics more useful when there are multiple return statements in a function. Example:
1 |__attribute__((returns_nonnull)) char *foo() { 2 | if (...) { 3 | return expr_which_might_evaluate_to_null(); 4 | } else { 5 | return another_expr_which_might_evaluate_to_null(); 6 | } 7 |} // <- The current diagnostic always points here!
runtime error: Null returned from Line 7, Column 2! With this patch, the diagnostic would point to either Line 3, Column 5 or Line 5, Column 5.
This is done by emitting source location metadata for each return statement in a sanitized function. The runtime is passed a pointer to the appropriate metadata so that it can prepare and deduplicate reports.
Compiler-rt patch (with more tests): https://reviews.llvm.org/D34298
Differential Revision: https://reviews.llvm.org/D34299
llvm-svn: 306163
show more ...
|
#
162b40a8 |
| 19-Jun-2017 |
Manoj Gupta <manojgupta@google.com> |
[Clang] Handle interaction of -pg and no_instrument_function attribute.
Summary: Disable generation of counting-function attribute if no_instrument_function attribute is present in function. Interac
[Clang] Handle interaction of -pg and no_instrument_function attribute.
Summary: Disable generation of counting-function attribute if no_instrument_function attribute is present in function. Interaction between -pg and no_instrument_function is the desired behavior and matches gcc as well. This is required for fixing a crash in Linux kernel when function tracing is enabled.
Fixes PR33515.
Reviewers: hfinkel, rengolin, srhines, hans
Reviewed By: hfinkel
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D34357
llvm-svn: 305728
show more ...
|
Revision tags: llvmorg-4.0.1, llvmorg-4.0.1-rc3 |
|
#
56223237 |
| 09-Jun-2017 |
Alexey Bataev <a.bataev@hotmail.com> |
[DebugInfo] Add kind of ImplicitParamDecl for emission of FlagObjectPointer.
Summary: If the first parameter of the function is the ImplicitParamDecl, codegen automatically marks it as an implicit a
[DebugInfo] Add kind of ImplicitParamDecl for emission of FlagObjectPointer.
Summary: If the first parameter of the function is the ImplicitParamDecl, codegen automatically marks it as an implicit argument with `this` or `self` pointer. Added internal kind of the ImplicitParamDecl to separate 'this', 'self', 'vtt' and other implicit parameters from other kind of parameters.
Reviewers: rjmccall, aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D33735
llvm-svn: 305075
show more ...
|
#
41d4b4e5 |
| 01-Jun-2017 |
Keno Fischer <keno@alumni.harvard.edu> |
[CGDebugInfo] Finalize SubPrograms when we're done with them
`GenerateVarArgsThunk` in `CGVTables` clones a function before the frontend is done emitting the compilation unit. Because of the way tha
[CGDebugInfo] Finalize SubPrograms when we're done with them
`GenerateVarArgsThunk` in `CGVTables` clones a function before the frontend is done emitting the compilation unit. Because of the way that DIBuilder works, this means that the attached subprogram had incomplete (temporary) metadata. Cloning such metadata is semantically disallowed, but happened to work anyway due to bugs in the cloning logic. rL304226 attempted to fix up that logic, but in the process exposed the incorrect API use here and had to be reverted. To be able to fix this, I added a new method to DIBuilder in rL304467, to allow finalizing a subprogram independently of the entire compilation unit. Use that here, in preparation of re-applying rL304226.
Reviewers: aprantl, dblaikie Differential Revision: https://reviews.llvm.org/D33705
llvm-svn: 304470
show more ...
|
Revision tags: llvmorg-4.0.1-rc2 |
|
#
8f248234 |
| 18-May-2017 |
Krzysztof Parzyszek <kparzysz@codeaurora.org> |
[CodeGen] Propagate LValueBaseInfo instead of AlignmentSource
The functions creating LValues propagated information about alignment source. Extend the propagated data to also include information abo
[CodeGen] Propagate LValueBaseInfo instead of AlignmentSource
The functions creating LValues propagated information about alignment source. Extend the propagated data to also include information about possible unrestricted aliasing. A new class LValueBaseInfo will contain both AlignmentSource and MayAlias info.
This patch should not introduce any functional changes.
Differential Revision: https://reviews.llvm.org/D33284
llvm-svn: 303358
show more ...
|
#
be6da4bb |
| 04-May-2017 |
Xiuli Pan <xiulipan@outlook.com> |
[OpenCL] Add intel_reqd_sub_group_size attribute support
Summary: Add intel_reqd_sub_group_size attribute support as intel extension cl_intel_required_subgroup_size from https://www.khronos.org/reg
[OpenCL] Add intel_reqd_sub_group_size attribute support
Summary: Add intel_reqd_sub_group_size attribute support as intel extension cl_intel_required_subgroup_size from https://www.khronos.org/registry/OpenCL/extensions/intel/cl_intel_required_subgroup_size.txt
Reviewers: Anastasia, bader, hfinkel, pxli168
Reviewed By: Anastasia, bader, pxli168
Subscribers: cfe-commits, yaxunl
Differential Revision: https://reviews.llvm.org/D30805
llvm-svn: 302125
show more ...
|
Revision tags: llvmorg-4.0.1-rc1 |
|
#
ffd7c887 |
| 14-Apr-2017 |
Vedant Kumar <vsk@apple.com> |
[ubsan] Reduce alignment checking of C++ object pointers
This patch teaches ubsan to insert an alignment check for the 'this' pointer at the start of each method/lambda. This allows clang to emit si
[ubsan] Reduce alignment checking of C++ object pointers
This patch teaches ubsan to insert an alignment check for the 'this' pointer at the start of each method/lambda. This allows clang to emit significantly fewer alignment checks overall, because if 'this' is aligned, so are its fields.
This is essentially the same thing r295515 does, but for the alignment check instead of the null check. One difference is that we keep the alignment checks on member expressions where the base is a DeclRefExpr. There's an opportunity to diagnose unaligned accesses in this situation (as pointed out by Eli, see PR32630).
Testing: check-clang, check-ubsan, and a stage2 ubsan build.
Along with the patch from D30285, this roughly halves the amount of alignment checks we emit when compiling X86FastISel.cpp. Here are the numbers from patched/unpatched clangs based on r298160.
------------------------------------------ | Setup | # of alignment checks | ------------------------------------------ | unpatched, -O0 | 24326 | | patched, -O0 | 12717 | (-47.7%) ------------------------------------------
Differential Revision: https://reviews.llvm.org/D30283
llvm-svn: 300370
show more ...
|
#
ba8b84d7 |
| 31-Mar-2017 |
Egor Churaev <egor.churaev@gmail.com> |
[OpenCL] Do not generate "kernel_arg_type_qual" metadata for non-pointer args
Summary: "kernel_arg_type_qual" metadata should contain const/volatile/restrict tags only for pointer types to match the
[OpenCL] Do not generate "kernel_arg_type_qual" metadata for non-pointer args
Summary: "kernel_arg_type_qual" metadata should contain const/volatile/restrict tags only for pointer types to match the corresponding requirement of the OpenCL specification.
OpenCL 2.0 spec 5.9.3 Kernel Object Queries:
CL_KERNEL_ARG_TYPE_VOLATILE is returned if the argument is a pointer and the referenced type is declared with the volatile qualifier. [...] Similarly, CL_KERNEL_ARG_TYPE_CONST is returned if the argument is a pointer and the referenced type is declared with the restrict or const qualifier. [...] CL_KERNEL_ARG_TYPE_RESTRICT will be returned if the pointer type is marked restrict.
Reviewers: Anastasia, cfe-commits
Reviewed By: Anastasia
Subscribers: bader, yaxunl
Differential Revision: https://reviews.llvm.org/D31321
llvm-svn: 299192
show more ...
|
#
2a7d39df |
| 31-Mar-2017 |
Benjamin Kramer <benny.kra@googlemail.com> |
[msan] Turn off lifetime markers even when use after scope checking is on.
Since r299174 use after scope checking is on by default. Even though msan doesn't check for use after scope it gets confuse
[msan] Turn off lifetime markers even when use after scope checking is on.
Since r299174 use after scope checking is on by default. Even though msan doesn't check for use after scope it gets confused by the lifetime markers emitted for it, making unit tests fail. This is covered by ninja check-msan.
llvm-svn: 299191
show more ...
|
#
835832d3 |
| 30-Mar-2017 |
Dean Michael Berris <dberris@google.com> |
[XRay] Add -fxray-{always,never}-instrument= flags to clang
Summary: The -fxray-always-instrument= and -fxray-never-instrument= flags take filenames that are used to imbue the XRay instrumentation a
[XRay] Add -fxray-{always,never}-instrument= flags to clang
Summary: The -fxray-always-instrument= and -fxray-never-instrument= flags take filenames that are used to imbue the XRay instrumentation attributes using a whitelist mechanism (similar to the sanitizer special cases list). We use the same syntax and semantics as the sanitizer blacklists files in the implementation.
As implemented, we respect the attributes that are already defined in the source file (i.e. those that have the [[clang::xray_{always,never}_instrument]] attributes) before applying the always/never instrument lists.
Reviewers: rsmith, chandlerc
Subscribers: jfb, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D30388
llvm-svn: 299041
show more ...
|
#
42c17ec5 |
| 14-Mar-2017 |
Vedant Kumar <vsk@apple.com> |
[ubsan] Add a nullability sanitizer
Teach UBSan to detect when a value with the _Nonnull type annotation assumes a null value. Call expressions, initializers, assignments, and return statements are
[ubsan] Add a nullability sanitizer
Teach UBSan to detect when a value with the _Nonnull type annotation assumes a null value. Call expressions, initializers, assignments, and return statements are all checked.
Because _Nonnull does not affect IRGen, the new checks are disabled by default. The new driver flags are:
-fsanitize=nullability-arg (_Nonnull violation in call) -fsanitize=nullability-assign (_Nonnull violation in assignment) -fsanitize=nullability-return (_Nonnull violation in return stmt) -fsanitize=nullability (all of the above)
This patch builds on top of UBSan's existing support for detecting violations of the nonnull attributes ('nonnull' and 'returns_nonnull'), and relies on the compiler-rt support for those checks. Eventually we will need to update the diagnostic messages in compiler-rt (there are FIXME's for this, which will be addressed in a follow-up).
One point of note is that the nullability-return check is only allowed to kick in if all arguments to the function satisfy their nullability preconditions. This makes it necessary to emit some null checks in the function body itself.
Testing: check-clang and check-ubsan. I also built some Apple ObjC frameworks with an asserts-enabled compiler, and verified that we get valid reports.
Differential Revision: https://reviews.llvm.org/D30762
llvm-svn: 297700
show more ...
|
#
3fa38a14 |
| 08-Mar-2017 |
Roger Ferrer Ibanez <roger.ferreribanez@arm.com> |
Honor __unaligned in codegen for declarations and expressions
This patch honors the unaligned type qualifier (currently available through he keyword __unaligned and -fms-extensions) in CodeGen. In t
Honor __unaligned in codegen for declarations and expressions
This patch honors the unaligned type qualifier (currently available through he keyword __unaligned and -fms-extensions) in CodeGen. In the current form the patch affects declarations and expressions. It does not affect fields of classes.
Differential Revision: https://reviews.llvm.org/D30166
llvm-svn: 297276
show more ...
|
Revision tags: llvmorg-4.0.0, llvmorg-4.0.0-rc4 |
|
#
418da3fe |
| 06-Mar-2017 |
Dean Michael Berris <dberris@google.com> |
[XRay] [clang] Allow logging the first argument of a function call.
Summary: Functions with the "xray_log_args" attribute will tell LLVM to emit a special XRay sled for compiler-rt to copy any call
[XRay] [clang] Allow logging the first argument of a function call.
Summary: Functions with the "xray_log_args" attribute will tell LLVM to emit a special XRay sled for compiler-rt to copy any call arguments to your logging handler.
Reviewers: dberris
Reviewed By: dberris
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D29704
llvm-svn: 296999
show more ...
|
Revision tags: llvmorg-4.0.0-rc3 |
|
#
34b1fd6a |
| 17-Feb-2017 |
Vedant Kumar <vsk@apple.com> |
Retry^2: [ubsan] Reduce null checking of C++ object pointers (PR27581)
This patch teaches ubsan to insert exactly one null check for the 'this' pointer per method/lambda.
Previously, given a load o
Retry^2: [ubsan] Reduce null checking of C++ object pointers (PR27581)
This patch teaches ubsan to insert exactly one null check for the 'this' pointer per method/lambda.
Previously, given a load of a member variable from an instance method ('this->x'), ubsan would insert a null check for 'this', and another null check for '&this->x', before allowing the load to occur.
Similarly, given a call to a method from another method bound to the same instance ('this->foo()'), ubsan would a redundant null check for 'this'. There is also a redundant null check in the case where the object pointer is a reference ('Ref.foo()').
This patch teaches ubsan to remove the redundant null checks identified above.
Testing: check-clang, check-ubsan, and a stage2 ubsan build.
I also compiled X86FastISel.cpp with -fsanitize=null using patched/unpatched clangs based on r293572. Here are the number of null checks emitted:
------------------------------------- | Setup | # of null checks | ------------------------------------- | unpatched, -O0 | 21767 | | patched, -O0 | 10758 | -------------------------------------
Changes since the initial commit: - Don't introduce any unintentional object-size or alignment checks. - Don't rely on IRGen of C labels in the test.
Differential Revision: https://reviews.llvm.org/D29530
llvm-svn: 295515
show more ...
|
#
29ba8d9b |
| 17-Feb-2017 |
Vedant Kumar <vsk@apple.com> |
Revert "Retry: [ubsan] Reduce null checking of C++ object pointers (PR27581)"
This reverts commit r295401. It breaks the ubsan self-host. It inserts object size checks once per C++ method which fire
Revert "Retry: [ubsan] Reduce null checking of C++ object pointers (PR27581)"
This reverts commit r295401. It breaks the ubsan self-host. It inserts object size checks once per C++ method which fire when the structure is empty.
llvm-svn: 295494
show more ...
|
#
55875b99 |
| 17-Feb-2017 |
Vedant Kumar <vsk@apple.com> |
Retry: [ubsan] Reduce null checking of C++ object pointers (PR27581)
This patch teaches ubsan to insert exactly one null check for the 'this' pointer per method/lambda.
Previously, given a load of
Retry: [ubsan] Reduce null checking of C++ object pointers (PR27581)
This patch teaches ubsan to insert exactly one null check for the 'this' pointer per method/lambda.
Previously, given a load of a member variable from an instance method ('this->x'), ubsan would insert a null check for 'this', and another null check for '&this->x', before allowing the load to occur.
Similarly, given a call to a method from another method bound to the same instance ('this->foo()'), ubsan would a redundant null check for 'this'. There is also a redundant null check in the case where the object pointer is a reference ('Ref.foo()').
This patch teaches ubsan to remove the redundant null checks identified above.
Testing: check-clang and check-ubsan. I also compiled X86FastISel.cpp with -fsanitize=null using patched/unpatched clangs based on r293572. Here are the number of null checks emitted:
------------------------------------- | Setup | # of null checks | ------------------------------------- | unpatched, -O0 | 21767 | | patched, -O0 | 10758 | -------------------------------------
Changes since the initial commit: don't rely on IRGen of C labels in the test.
Differential Revision: https://reviews.llvm.org/D29530
llvm-svn: 295401
show more ...
|
#
4f94a94b |
| 17-Feb-2017 |
Vedant Kumar <vsk@apple.com> |
Revert "[ubsan] Reduce null checking of C++ object pointers (PR27581)"
This reverts commit r295391. It breaks this bot:
http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/1898
I n
Revert "[ubsan] Reduce null checking of C++ object pointers (PR27581)"
This reverts commit r295391. It breaks this bot:
http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/1898
I need to not rely on labels in the IR test.
llvm-svn: 295396
show more ...
|
#
3e5a9a6b |
| 17-Feb-2017 |
Vedant Kumar <vsk@apple.com> |
[ubsan] Reduce null checking of C++ object pointers (PR27581)
This patch teaches ubsan to insert exactly one null check for the 'this' pointer per method/lambda.
Previously, given a load of a membe
[ubsan] Reduce null checking of C++ object pointers (PR27581)
This patch teaches ubsan to insert exactly one null check for the 'this' pointer per method/lambda.
Previously, given a load of a member variable from an instance method ('this->x'), ubsan would insert a null check for 'this', and another null check for '&this->x', before allowing the load to occur.
Similarly, given a call to a method from another method bound to the same instance ('this->foo()'), ubsan would a redundant null check for 'this'. There is also a redundant null check in the case where the object pointer is a reference ('Ref.foo()').
This patch teaches ubsan to remove the redundant null checks identified above.
Testing: check-clang and check-ubsan. I also compiled X86FastISel.cpp with -fsanitize=null using patched/unpatched clangs based on r293572. Here are the number of null checks emitted:
------------------------------------- | Setup | # of null checks | ------------------------------------- | unpatched, -O0 | 21767 | | patched, -O0 | 10758 | -------------------------------------
Differential Revision: https://reviews.llvm.org/D29530
llvm-svn: 295391
show more ...
|
Revision tags: llvmorg-4.0.0-rc2 |
|
#
a858981c |
| 08-Feb-2017 |
Reid Kleckner <rnk@google.com> |
[MS] Fix C++ destructor thunk line info for a declaration
Sometimes the MS ABI needs to emit thunks for declarations that don't have bodies. Destructor thunks make calls to inlinable functions, so t
[MS] Fix C++ destructor thunk line info for a declaration
Sometimes the MS ABI needs to emit thunks for declarations that don't have bodies. Destructor thunks make calls to inlinable functions, so they need line info or LLVM will complain.
Fixes PR31893
llvm-svn: 294465
show more ...
|
#
0c86ccf4 |
| 31-Jan-2017 |
Nirav Dave <niravd@google.com> |
[X86] Teach Clang about -mfentry flag
Replace mcount calls with calls to fentry.
Reviewers: hfinkel, craig.topper
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D28001
[X86] Teach Clang about -mfentry flag
Replace mcount calls with calls to fentry.
Reviewers: hfinkel, craig.topper
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D28001
llvm-svn: 293649
show more ...
|
#
600b5261 |
| 26-Jan-2017 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR0091R3: Implement parsing support for using templates as types.
This change adds a new type node, DeducedTemplateSpecializationType, to represent a type template name that has been used as a type.
PR0091R3: Implement parsing support for using templates as types.
This change adds a new type node, DeducedTemplateSpecializationType, to represent a type template name that has been used as a type. This is modeled around AutoType, and shares a common base class for representing a deduced placeholder type.
We allow deduced class template types in a few more places than the standard does: in conditions and for-range-declarators, and in new-type-ids. This is consistent with GCC and with discussion on the core reflector. This patch does not yet support deduced class template types being named in typename specifiers.
llvm-svn: 293207
show more ...
|