#
e44acadf |
| 26-Jun-2018 |
Peter Collingbourne <peter@pcc.me.uk> |
Implement CFI for indirect calls via a member function pointer.
Similarly to CFI on virtual and indirect calls, this implementation tries to use program type information to make the checks as precis
Implement CFI for indirect calls via a member function pointer.
Similarly to CFI on virtual and indirect calls, this implementation tries to use program type information to make the checks as precise as possible. The basic way that it works is as follows, where `C` is the name of the class being defined or the target of a call and the function type is assumed to be `void()`.
For virtual calls: - Attach type metadata to the addresses of function pointers in vtables (not the functions themselves) of type `void (B::*)()` for each `B` that is a recursive dynamic base class of `C`, including `C` itself. This type metadata has an annotation that the type is for virtual calls (to distinguish it from the non-virtual case). - At the call site, check that the computed address of the function pointer in the vtable has type `void (C::*)()`.
For non-virtual calls: - Attach type metadata to each non-virtual member function whose address can be taken with a member function pointer. The type of a function in class `C` of type `void()` is each of the types `void (B::*)()` where `B` is a most-base class of `C`. A most-base class of `C` is defined as a recursive base class of `C`, including `C` itself, that does not have any bases. - At the call site, check that the function pointer has one of the types `void (B::*)()` where `B` is a most-base class of `C`.
Differential Revision: https://reviews.llvm.org/D47567
llvm-svn: 335569
show more ...
|
#
96edb2e3 |
| 25-Jun-2018 |
Alexey Bataev <a.bataev@hotmail.com> |
[OPENMP] Do not consider address constant vars as possibly threadprivate.
Do not delay emission of the address constant variables in OpenMP mode as they cannot be defined as threadprivate.
llvm-svn
[OPENMP] Do not consider address constant vars as possibly threadprivate.
Do not delay emission of the address constant variables in OpenMP mode as they cannot be defined as threadprivate.
llvm-svn: 335483
show more ...
|
Revision tags: llvmorg-6.0.1, llvmorg-6.0.1-rc3 |
|
#
6c10a66e |
| 12-Jun-2018 |
Yaxun Liu <Yaxun.Liu@amd.com> |
[CUDA][HIP] Set kernel calling convention before arrange function
Currently clang set kernel calling convention for CUDA/HIP after arranging function, which causes incorrect kernel function type sin
[CUDA][HIP] Set kernel calling convention before arrange function
Currently clang set kernel calling convention for CUDA/HIP after arranging function, which causes incorrect kernel function type since it depends on calling convention.
This patch moves setting kernel convention before arranging function.
Differential Revision: https://reviews.llvm.org/D47733
llvm-svn: 334457
show more ...
|
#
3513fdcc |
| 11-Jun-2018 |
Reid Kleckner <rnk@google.com> |
[MS] Use mangled names and comdats for string merging with ASan
This should reduce the binary size penalty of ASan on Windows. After r334313, ASan will add red zones to globals in comdats, so we wil
[MS] Use mangled names and comdats for string merging with ASan
This should reduce the binary size penalty of ASan on Windows. After r334313, ASan will add red zones to globals in comdats, so we will still find OOB accesses to string literals.
llvm-svn: 334417
show more ...
|
#
1a83d067 |
| 07-Jun-2018 |
Gabor Buella <gabor.buella@intel.com> |
[CodeGen] Improve diagnostics related to target attributes
Summary: When requirement imposed by __target__ attributes on functions are not satisfied, prefer printing those requirements, which are ex
[CodeGen] Improve diagnostics related to target attributes
Summary: When requirement imposed by __target__ attributes on functions are not satisfied, prefer printing those requirements, which are explicitly mentioned in the attributes.
This makes such messages more useful, e.g. printing avx512f instead of avx2 in the following scenario:
``` $ cat foo.c static inline void __attribute__((__always_inline__, __target__("avx512f"))) x(void) { }
int main(void) { x(); } $ clang foo.c foo.c:7:2: error: always_inline function 'x' requires target feature 'avx2', but would be inlined into function 'main' that is compiled without support for 'avx2' x(); ^ 1 error generated. ```
bugzilla: https://bugs.llvm.org/show_bug.cgi?id=37338
Reviewers: craig.topper, echristo, dblaikie
Reviewed By: craig.topper, echristo
Differential Revision: https://reviews.llvm.org/D46541
llvm-svn: 334174
show more ...
|
#
6328f9a9 |
| 05-Jun-2018 |
Yaxun Liu <Yaxun.Liu@amd.com> |
[CUDA][HIP] Do not emit type info when compiling for device
CUDA/HIP does not support RTTI on device side, therefore there is no point of emitting type info when compiling for device.
Emitting type
[CUDA][HIP] Do not emit type info when compiling for device
CUDA/HIP does not support RTTI on device side, therefore there is no point of emitting type info when compiling for device.
Emitting type info for device not only clutters the IR with useless global variables, but also causes undefined symbol at linking since vtable for cxxabiv1::class_type_info has external linkage.
Differential Revision: https://reviews.llvm.org/D47694
llvm-svn: 334021
show more ...
|
Revision tags: llvmorg-6.0.1-rc2 |
|
#
b534510c |
| 30-May-2018 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Make the mangled name collision diagnostic a bit more useful by listing the mangling.
This helps especially when the collision is for a template specialization, where the template arguments are not
Make the mangled name collision diagnostic a bit more useful by listing the mangling.
This helps especially when the collision is for a template specialization, where the template arguments are not available from anywhere else in the diagnostic, and are likely relevant to the problem.
llvm-svn: 333489
show more ...
|
#
daceb1ea |
| 14-May-2018 |
Yaxun Liu <Yaxun.Liu@amd.com> |
CodeGen: Emit string literal in constant address space
Some targets have constant address space (e.g. amdgcn). For them string literal should be emitted in constant address space then casted to defa
CodeGen: Emit string literal in constant address space
Some targets have constant address space (e.g. amdgcn). For them string literal should be emitted in constant address space then casted to default address space.
Differential Revision: https://reviews.llvm.org/D46643
llvm-svn: 332279
show more ...
|
#
4fbf84c1 |
| 09-May-2018 |
Manoj Gupta <manojgupta@google.com> |
[Clang] Implement function attribute no_stack_protector.
Summary: This attribute tells clang to skip this function from stack protector when -stack-protector option is passed. GCC option for this is
[Clang] Implement function attribute no_stack_protector.
Summary: This attribute tells clang to skip this function from stack protector when -stack-protector option is passed. GCC option for this is: __attribute__((__optimize__("no-stack-protector"))) and the equivalent clang syntax would be: __attribute__((no_stack_protector))
This is used in Linux kernel to selectively disable stack protector in certain functions.
Reviewers: aaron.ballman, rsmith, rnk, probinson
Reviewed By: aaron.ballman
Subscribers: probinson, srhines, cfe-commits
Differential Revision: https://reviews.llvm.org/D46300
llvm-svn: 331925
show more ...
|
#
9fc8faf9 |
| 09-May-2018 |
Adrian Prantl <aprantl@apple.com> |
Remove \brief commands from doxygen comments.
This is similar to the LLVM change https://reviews.llvm.org/D46290.
We've been running doxygen with the autobrief option for a couple of years now. Thi
Remove \brief commands from doxygen comments.
This is similar to the LLVM change https://reviews.llvm.org/D46290.
We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all.
Patch produced by
for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
Differential Revision: https://reviews.llvm.org/D46320
llvm-svn: 331834
show more ...
|
#
d7ff6d64 |
| 07-May-2018 |
Alexey Bataev <a.bataev@hotmail.com> |
[OPENMP, NVPTX] Added support for L2 parallelism.
Added initial codegen for level 2, 3 etc. parallelism. Currently, all the second, the third etc. parallel regions will run sequentially.
llvm-svn:
[OPENMP, NVPTX] Added support for L2 parallelism.
Added initial codegen for level 2, 3 etc. parallelism. Currently, all the second, the third etc. parallel regions will run sequentially.
llvm-svn: 331642
show more ...
|
#
6d944109 |
| 02-May-2018 |
Alexey Bataev <a.bataev@hotmail.com> |
[OPENMP] Support C++ member functions in the device constructs.
Added correct emission of the C++ member functions for the device function when they are used in the device constructs.
llvm-svn: 331
[OPENMP] Support C++ member functions in the device constructs.
Added correct emission of the C++ member functions for the device function when they are used in the device constructs.
llvm-svn: 331365
show more ...
|
#
a534f07f |
| 26-Apr-2018 |
Faisal Vali <faisalv@yahoo.com> |
Revert rC330794 and some dependent tiny bug fixes
See Richard's humbling feedback here: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180423/226482.html http://lists.llvm.org/pipermail
Revert rC330794 and some dependent tiny bug fixes
See Richard's humbling feedback here: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180423/226482.html http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180423/226486.html
Wish I'd had the patience to solicit the feedback prior to committing :)
Sorry for the noise guys.
Thank you Richard for being the steward that clang deserves!
llvm-svn: 330888
show more ...
|
#
936de9d6 |
| 25-Apr-2018 |
Faisal Vali <faisalv@yahoo.com> |
[c++2a] [concepts] Add rudimentary parsing support for template concept declarations
This patch is a tweak of changyu's patch: https://reviews.llvm.org/D40381. It differs in that the recognition of
[c++2a] [concepts] Add rudimentary parsing support for template concept declarations
This patch is a tweak of changyu's patch: https://reviews.llvm.org/D40381. It differs in that the recognition of the 'concept' token is moved into the machinery that recognizes declaration-specifiers - this allows us to leverage the attribute handling machinery more seamlessly.
See the test file to get a sense of the basic parsing that this patch supports.
There is much more work to be done before concepts are usable...
Thanks Changyu!
llvm-svn: 330794
show more ...
|
#
4a4e7a31 |
| 23-Apr-2018 |
Mikhail Maltsev <mikhail.maltsev@arm.com> |
[CodeGen] Reland r330442: Add an option to suppress output of llvm.ident
The test case in the original patch was overly contrained and failed on PPC targets.
llvm-svn: 330575
|
#
42b2a0e1 |
| 20-Apr-2018 |
Mikhail Maltsev <mikhail.maltsev@arm.com> |
Revert r330442, CodeGen/no-ident-version.c is failing on PPC
llvm-svn: 330451
|
#
4306f208 |
| 20-Apr-2018 |
Yaxun Liu <Yaxun.Liu@amd.com> |
[CUDA] Set LLVM calling convention for CUDA kernel
Some targets need special LLVM calling convention for CUDA kernel. This patch does that through a TargetCodeGenInfo hook.
It only affects amdgcn t
[CUDA] Set LLVM calling convention for CUDA kernel
Some targets need special LLVM calling convention for CUDA kernel. This patch does that through a TargetCodeGenInfo hook.
It only affects amdgcn target.
Patch by Greg Rodgers. Revised and lit tests added by Yaxun Liu.
Differential Revision: https://reviews.llvm.org/D45223
llvm-svn: 330447
show more ...
|
#
6550c139 |
| 20-Apr-2018 |
Mikhail Maltsev <mikhail.maltsev@arm.com> |
[CodeGen] Add an option to suppress output of llvm.ident
Summary: By default Clang outputs its version (including git commit hash, in case of trunk builds) into object and assembly files. It might b
[CodeGen] Add an option to suppress output of llvm.ident
Summary: By default Clang outputs its version (including git commit hash, in case of trunk builds) into object and assembly files. It might be useful to have an option to disable this, especially for debugging purposes. This patch implements new command line flags -Qn and -Qy (the names are chosen for compatibility with GCC). -Qn disables output of the 'llvm.ident' metadata string and the 'producer' debug info. -Qy (enabled by default) does the opposite.
Reviewers: faisalv, echristo, aprantl
Reviewed By: aprantl
Subscribers: aprantl, cfe-commits, JDevlieghere, rogfer01
Differential Revision: https://reviews.llvm.org/D45255
llvm-svn: 330442
show more ...
|
#
3fe5b7a4 |
| 19-Apr-2018 |
Saleem Abdulrasool <compnerd@compnerd.org> |
Implement proper support for `-falign-functions`
This implements support for the previously ignored flag `-falign-functions`. This allows the frontend to request alignment on function definitions i
Implement proper support for `-falign-functions`
This implements support for the previously ignored flag `-falign-functions`. This allows the frontend to request alignment on function definitions in the translation unit where they are not explicitly requested in code. This is compatible with the GCC behaviour and the ICC behaviour.
The scalar value passed to `-falign-functions` aligns functions to a power-of-two boundary. If flag is used, the functions are aligned to 16-byte boundaries. If the scalar is specified, it must be an integer less than or equal to 4096. If the value is not a power-of-two, the driver will round it up to the nearest power of two.
llvm-svn: 330378
show more ...
|
Revision tags: llvmorg-6.0.1-rc1 |
|
#
617e2615 |
| 17-Apr-2018 |
Akira Hatanaka <ahatanaka@apple.com> |
Add a command line option 'fregister_global_dtors_with_atexit' to register destructor functions annotated with __attribute__((destructor)) using __cxa_atexit or atexit.
Register destructor functions
Add a command line option 'fregister_global_dtors_with_atexit' to register destructor functions annotated with __attribute__((destructor)) using __cxa_atexit or atexit.
Register destructor functions annotated with __attribute__((destructor)) calling __cxa_atexit in a synthesized constructor function instead of emitting references to the functions in a special section.
The primary reason for adding this option is that we are planning to deprecate the __mod_term_funcs section on Darwin in the future. This feature is enabled by default only on Darwin. Users who do not want this can use command line option 'fno_register_global_dtors_with_atexit' to disable it.
rdar://problem/33887655
Differential Revision: https://reviews.llvm.org/D45578
llvm-svn: 330199
show more ...
|
#
a3b5f71e |
| 16-Apr-2018 |
Bruno Cardoso Lopes <bruno.cardoso@gmail.com> |
Use export_as for autolinking frameworks
framework module SomeKitCore { ... export_as SomeKit }
Given the module above, while generting autolink information during codegen, clang should to emit
Use export_as for autolinking frameworks
framework module SomeKitCore { ... export_as SomeKit }
Given the module above, while generting autolink information during codegen, clang should to emit '-framework SomeKitCore' only if SomeKit was not imported in the relevant TU, otherwise it should use '-framework SomeKit' instead.
rdar://problem/38269782
llvm-svn: 330152
show more ...
|
#
1ba9d9c6 |
| 13-Apr-2018 |
Andrey Konovalov <andreyknvl@google.com> |
hwasan: add -fsanitize=kernel-hwaddress flag
This patch adds -fsanitize=kernel-hwaddress flag, that essentially enables -hwasan-kernel=1 -hwasan-recover=1 -hwasan-match-all-tag=0xff.
Differential R
hwasan: add -fsanitize=kernel-hwaddress flag
This patch adds -fsanitize=kernel-hwaddress flag, that essentially enables -hwasan-kernel=1 -hwasan-recover=1 -hwasan-match-all-tag=0xff.
Differential Revision: https://reviews.llvm.org/D45046
llvm-svn: 330044
show more ...
|
#
488f7c2b |
| 13-Apr-2018 |
Dean Michael Berris <dberris@google.com> |
[XRay][clang] Add flag to choose instrumentation bundles
Summary: This change addresses http://llvm.org/PR36926 by allowing users to pick which instrumentation bundles to use, when instrumenting wit
[XRay][clang] Add flag to choose instrumentation bundles
Summary: This change addresses http://llvm.org/PR36926 by allowing users to pick which instrumentation bundles to use, when instrumenting with XRay. In particular, the flag `-fxray-instrumentation-bundle=` has four valid values:
- `all`: the default, emits all instrumentation kinds - `none`: equivalent to -fnoxray-instrument - `function`: emits the entry/exit instrumentation - `custom`: emits the custom event instrumentation
These can be combined either as comma-separated values, or as repeated flag values.
Reviewers: echristo, kpw, eizan, pelikan
Reviewed By: pelikan
Subscribers: mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D44970
llvm-svn: 329985
show more ...
|
#
2a8c18d9 |
| 06-Apr-2018 |
Alexander Kornienko <alexfh@google.com> |
Fix typos in clang
Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of:
archtype cas classs checkk compres definit frome iff inteval ith lod metho
Fix typos in clang
Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of:
archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru
Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.)
Differential revision: https://reviews.llvm.org/D44188
llvm-svn: 329399
show more ...
|
#
03f270c9 |
| 30-Mar-2018 |
Alexey Bataev <a.bataev@hotmail.com> |
[OPENMP] Added emission of offloading data sections for declare target variables.
Added emission of the offloading data sections for the variables within declare target regions + fixes emission of t
[OPENMP] Added emission of offloading data sections for declare target variables.
Added emission of the offloading data sections for the variables within declare target regions + fixes emission of the declare target variables marked as declare target not within the declare target region.
llvm-svn: 328888
show more ...
|