George Karpenkov [Mon, 23 Oct 2017 23:59:52 +0000 (23:59 +0000)]
[Analyzer] Do not use static storage to for implementations created in BodyFarm.cpp
Differential Revision: https://reviews.llvm.org/D39208
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316400
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Shaposhnikov [Mon, 23 Oct 2017 23:46:06 +0000 (23:46 +0000)]
[analyzer] Fix handling of labels in getLValueElement
In getLValueElement Base may represent the address of a label
(as in the newly-added test case), in this case it's not a loc::MemRegionVal
and Base.castAs<loc::MemRegionVal>() triggers an assert, this diff makes
getLValueElement return UnknownVal instead.
Differential revision: https://reviews.llvm.org/D39174
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316399
91177308-0d34-0410-b5e6-
96231b3b80d8
Volodymyr Sapsai [Mon, 23 Oct 2017 22:01:41 +0000 (22:01 +0000)]
[Sema] Add support for flexible array members in Obj-C.
Allow Obj-C ivars with incomplete array type but only as the last ivar.
Also add a requirement for ivars that contain a flexible array member to
be at the end of class too. It is possible to add in a subclass another
ivar at the end but we'll emit a warning in this case. Also we'll emit a
warning if a variable sized ivar is declared in class extension or in
implementation because subclasses won't know they should avoid adding
new ivars.
In ARC incomplete array objects are treated as __unsafe_unretained so
require them to be marked as such.
Prohibit synthesizing ivars with flexible array members because order of
synthesized ivars is not obvious and tricky to control. Spelling out
ivar explicitly gives control to developers and helps to avoid surprises
with unexpected ivar ordering.
For C and C++ changed diagnostic to tell explicitly a field is not the
last one and point to the next field. It is not as useful as in Obj-C
but it is an improvement and it is consistent with Obj-C. For C for
unions emit more specific err_flexible_array_union instead of generic
err_field_incomplete.
rdar://problem/
21054495
Reviewers: rjmccall, theraven
Reviewed By: rjmccall
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D38773
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316381
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Mon, 23 Oct 2017 21:31:05 +0000 (21:31 +0000)]
[Driver] Use ld.lld directly for Fuchsia rather than passing flavor
Passing a flavor to LLD requires command line argument, but if these
are being passed through a response file, this will fail because LLD
needs to know which driver to use before processing the response file.
Use ld.lld directly instead to avoid this issue.
Differential Revision: https://reviews.llvm.org/D39176
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316379
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Hahnfeld [Mon, 23 Oct 2017 19:01:35 +0000 (19:01 +0000)]
[OpenMP] Avoid VLAs for some reductions on array sections
In some cases the compiler can deduce the length of an array section
as constants. With this information, VLAs can be avoided in place of
a constant sized array or even a scalar value if the length is 1.
Example:
int a[4], b[2];
pragma omp parallel reduction(+: a[1:2], b[1:1])
{ }
For chained array sections, this optimization is restricted to cases
where all array sections except the last have a constant length 1.
This trivially guarantees that there are no holes in the memory region
that needs to be privatized.
Example:
int c[3][4];
pragma omp parallel reduction(+: c[1:1][1:2])
{ }
This relands commit r316229 that I reverted in r316235 because it
failed on some bots. During investigation I found that this was because
Clang and GCC evaluate the two arguments to emplace_back() in
ReductionCodeGen::emitSharedLValue() in a different order, hence
leading to a different order of generated instructions in the final
LLVM IR. Fix this by passing in the arguments from temporary variables
that are evaluated in a defined order.
Differential Revision: https://reviews.llvm.org/D39136
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316362
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaxun Liu [Mon, 23 Oct 2017 17:49:26 +0000 (17:49 +0000)]
CodeGen: Fix invalid bitcast in partial initialization of automatic arrary variable
Differential Revision: https://reviews.llvm.org/D39184
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316353
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 23 Oct 2017 16:48:46 +0000 (16:48 +0000)]
[ASTMatchers] Expose forEachOverriden in dynamic AST matchers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316344
91177308-0d34-0410-b5e6-
96231b3b80d8
Erich Keane [Mon, 23 Oct 2017 16:20:15 +0000 (16:20 +0000)]
Pull X86 "CPUKind" checking into .cpp file. [NFC]
Preparing to do a refactor of CPU/feature checking, this
patch pulls the one CPU implementation from the .h file
to the .cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316338
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Mon, 23 Oct 2017 15:54:44 +0000 (15:54 +0000)]
clang-cl: Expose --version.
This is for consistency with lld-link, see https://reviews.llvm.org/D38972
Also give --version a help text so it shows up in --help / /? output (for
both clang-cl and regular clang).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316335
91177308-0d34-0410-b5e6-
96231b3b80d8
Haojian Wu [Mon, 23 Oct 2017 08:58:50 +0000 (08:58 +0000)]
[rename] Don't overwrite the template argument when renaming a template function.
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: cierpuchaw, cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D39120
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316314
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Mon, 23 Oct 2017 03:58:34 +0000 (03:58 +0000)]
For better compatibility with C++11 and C++14, emit a nondiscardable definition
of a static constexpr data member if it's defined 'constexpr' out of line, not
only if it's defined 'constexpr' in the class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316310
91177308-0d34-0410-b5e6-
96231b3b80d8
Faisal Vali [Sun, 22 Oct 2017 22:29:52 +0000 (22:29 +0000)]
[c++2a] Update cxx_status w __VA_OPT__ marked as completed in SVN.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316304
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 22 Oct 2017 20:16:28 +0000 (20:16 +0000)]
Create fewer copies of StringMaps. No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316301
91177308-0d34-0410-b5e6-
96231b3b80d8
Faisal Vali [Sun, 22 Oct 2017 14:45:08 +0000 (14:45 +0000)]
[C++17] Fix PR34970 - tweak overload resolution for class template deduction-guides in line with WG21's p0620r0.
In order to identify the copy deduction candidate, I considered two approaches:
- attempt to determine whether an implicit guide is a copy deduction candidate by checking certain properties of its subsituted parameter during overload-resolution.
- using one of the many bits (WillHaveBody) from FunctionDecl (that CXXDeductionGuideDecl inherits from) that are otherwise irrelevant for deduction guides
After some brittle gymnastics w the first strategy, I settled on the second, although to avoid confusion and to give that bit a better name, i turned it into a member of an anonymous union.
Given this identification 'bit', the tweak to overload resolution was a simple reordering of the deduction guide checks (in SemaOverload.cpp::isBetterOverloadCandidate), in-line with Jason Merrill's p0620r0 drafting which made it into the working paper. Concordant with that, I made sure the copy deduction candidate is always added.
References:
See https://bugs.llvm.org/show_bug.cgi?id=34970
See http://wg21.link/p0620r0
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316292
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sat, 21 Oct 2017 21:52:48 +0000 (21:52 +0000)]
Reverting r316278 due to failing build bots.
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/11896
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/12380
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316279
91177308-0d34-0410-b5e6-
96231b3b80d8
Masud Rahman [Sat, 21 Oct 2017 20:53:49 +0000 (20:53 +0000)]
[libclang, bindings]: add spelling location
o) Add a 'Location' class that represents the four properties of a
physical location
o) Enhance 'SourceLocation' to provide 'expansion' and 'spelling'
locations, maintaining backwards compatibility with existing code by
forwarding the four properties to 'expansion'.
o) Update the implementation to use 'clang_getExpansionLocation'
instead of the deprecated 'clang_getInstantiationLocation', which
has been present since 2011.
o) Update the implementation of 'clang_getSpellingLocation' to actually
obtain spelling location instead of file location.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316278
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sat, 21 Oct 2017 20:28:58 +0000 (20:28 +0000)]
Fix a typo with -fno-double-square-bracket-attributes and add a test to demonstrate that it works as expected in C++11 mode. Additionally corrected the handling of -fdouble-square-bracket-attributes to be properly passed down to the cc1 option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316275
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sat, 21 Oct 2017 16:45:08 +0000 (16:45 +0000)]
Add release notes for the recent -fdouble-square-bracket-attributes and -fno-double-square-bracket-attributes compiler flags.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316269
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Lebedev [Sat, 21 Oct 2017 16:44:03 +0000 (16:44 +0000)]
[Sema] Fixes for enum handling for tautological comparison diagnostics
Summary:
As Mattias Eriksson has reported in PR35009, in C, for enums, the underlying type should
be used when checking for the tautological comparison, unlike C++, where the enumerator
values define the value range. So if not in CPlusPlus mode, use the enum underlying type.
Also, i have discovered a problem (a crash) when evaluating tautological-ness of the following comparison:
```
enum A { A_a = 0 };
if (a < 0) // expected-warning {{comparison of unsigned enum expression < 0 is always false}}
return 0;
```
This affects both the C and C++, but after the first fix, only C++ code was affected.
That was also fixed, while preserving (i think?) the proper diagnostic output.
And while there, attempt to enhance the test coverage.
Yes, some tests got moved around, sorry about that :)
Fixes PR35009
Reviewers: aaron.ballman, rsmith, rjmccall
Reviewed By: aaron.ballman
Subscribers: Rakete1111, efriedma, materi, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D39122
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316268
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sat, 21 Oct 2017 16:43:01 +0000 (16:43 +0000)]
Fixing broken attribute documentation for __attribute__((noescape)); a code block was missing and the existing code block was missing a mandatory newline.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316267
91177308-0d34-0410-b5e6-
96231b3b80d8
Masud Rahman [Sat, 21 Oct 2017 16:13:41 +0000 (16:13 +0000)]
[bindings] allow null strings in Python 3
Some API calls accept 'NULL' instead of a char array (e.g. the second
argument to 'clang_ParseTranslationUnit'). For Python 3 compatibility,
all strings are passed through 'c_interop_string' which expects to
receive only 'bytes' or 'str' objects. This change extends this
behavior to additionally allow 'None' to be supplied.
A test case was added which breaks in Python 3, and is fixed by this
change. All the test cases pass in both, Python 2 and Python 3.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316264
91177308-0d34-0410-b5e6-
96231b3b80d8
Masud Rahman [Sat, 21 Oct 2017 16:03:17 +0000 (16:03 +0000)]
Test commit
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316263
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 20 Oct 2017 23:32:41 +0000 (23:32 +0000)]
[CodeGen] add tests for __builtin_sqrt*; NFC
I don't know if this is correct, but this is what we currently do.
More discussion in PR27108 and PR27435 and D27618.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316250
91177308-0d34-0410-b5e6-
96231b3b80d8
George Karpenkov [Fri, 20 Oct 2017 23:29:59 +0000 (23:29 +0000)]
[Analyzer] Correctly handle parameters passed by reference when bodyfarming std::call_once
Explicitly not supporting functor objects.
Differential Revision: https://reviews.llvm.org/D39031
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316249
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 20 Oct 2017 22:56:25 +0000 (22:56 +0000)]
Implement current CWG direction for support of arrays of unknown bounds in
constant expressions.
We permit array-to-pointer decay on such arrays, but disallow pointer
arithmetic (since we do not know whether it will have defined behavior).
This is based on r311970 and r301822 (the former by me and the latter by Robert
Haberlach). Between then and now, two things have changed: we have committee
feedback indicating that this is indeed the right direction, and the code
broken by this change has been fixed.
This is necessary in C++17 to continue accepting certain forms of non-type
template argument involving arrays of unknown bound.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316245
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Hahnfeld [Fri, 20 Oct 2017 20:16:17 +0000 (20:16 +0000)]
Revert "[OpenMP] Avoid VLAs for some reductions on array sections"
This breaks at least two buildbots:
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-avx2-linux/builds/1175
http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/10478
This reverts commit r316229 during local investigation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316235
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Hahnfeld [Fri, 20 Oct 2017 19:40:40 +0000 (19:40 +0000)]
[OpenMP] Avoid VLAs for some reductions on array sections
In some cases the compiler can deduce the length of an array section
as constants. With this information, VLAs can be avoided in place of
a constant sized array or even a scalar value if the length is 1.
Example:
int a[4], b[2];
pragma omp parallel reduction(+: a[1:2], b[1:1])
{ }
For chained array sections, this optimization is restricted to cases
where all array sections except the last have a constant length 1.
This trivially guarantees that there are no holes in the memory region
that needs to be privatized.
Example:
int c[3][4];
pragma omp parallel reduction(+: c[1:1][1:2])
{ }
Differential Revision: https://reviews.llvm.org/D39136
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316229
91177308-0d34-0410-b5e6-
96231b3b80d8
Erich Keane [Fri, 20 Oct 2017 19:18:30 +0000 (19:18 +0000)]
Allow /showIncludes with /P
r213589 was checked in as a solution to
https://bugs.llvm.org/show_bug.cgi?id=20336.
However, it is possible to use /EP with /P
to suppress #line directives AND output to
a file. There is no reason in that case to
suppress /showIncludes.
This was reported here:
https://bugs.llvm.org/show_bug.cgi?id=34997
Differential Revision: https://reviews.llvm.org/D39104
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316225
91177308-0d34-0410-b5e6-
96231b3b80d8
Haojian Wu [Fri, 20 Oct 2017 12:37:16 +0000 (12:37 +0000)]
[clang-refactor] Add "-Inplace" option to the commandline tool.
Summary:
Change clang-refactor default behavior to print the new code after refactoring
(instead of editing the source files), which would make it easier to use
and debug the refactoring action.
Reviewers: arphaman, ioeric
Reviewed By: arphaman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D39092
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316212
91177308-0d34-0410-b5e6-
96231b3b80d8
Ivan A. Kosarev [Fri, 20 Oct 2017 12:35:17 +0000 (12:35 +0000)]
[CodeGen] Fix generation of TBAA info for array-to-pointer conversions
Resolves:
Fatal error: Offset not zero at the point of scalar access.
http://llvm.org/PR34992
Differential Revision: https://reviews.llvm.org/D39083
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316211
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Fri, 20 Oct 2017 04:11:28 +0000 (04:11 +0000)]
Basic: restore {,u}intptr_t on NetBSD/ARM
NetBSD uses `long int` for `intptr_t` on ARM. This was changed in SVN
r316046, referenced against other compilers. However, NetBSD's
reference was incorrect as the current clang behaviour is more
up-to-date. Restore the original behaviour for that target.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316204
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 20 Oct 2017 00:25:07 +0000 (00:25 +0000)]
Revert r316193.
This patch breaks users using -fno-canonical-prefixes, for whom resolving
symlinks is not acceptable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316195
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Wu [Thu, 19 Oct 2017 23:53:27 +0000 (23:53 +0000)]
Try to shorten system header paths when using -MD depfiles
GCC tries to shorten system headers in depfiles using its real path
(resolving components like ".." and following symlinks). Mimic this
feature to ensure that the Ninja build tool detects the correct
dependencies when a symlink changes directory levels, see
https://github.com/ninja-build/ninja/issues/1330
An option to disable this feature is added in case "these changed header
paths may conflict with some compilation environments", see
https://gcc.gnu.org/ml/gcc-patches/2012-09/msg00287.html
Note that the original feature request for GCC
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52974) also included paths
preprocessed output (-E) and diagnostics. That is not implemented now
since I am not sure if it breaks something else.
Differential Revision: https://reviews.llvm.org/D37954
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316193
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Thu, 19 Oct 2017 21:20:28 +0000 (21:20 +0000)]
These attributes are not supported by GCC and should not be in the gnu namespace. Switching from the GCC spelling to the GNU spelling so that they are only supported with __attribute__(()).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316186
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Thu, 19 Oct 2017 21:09:39 +0000 (21:09 +0000)]
These attributes are supported by GCC with the gnu vendor namespace for C++11-style attributes. Enabling the gnu namespace by switching to the GCC spelling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316184
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Thu, 19 Oct 2017 20:40:13 +0000 (20:40 +0000)]
AMDGPU: Parse r600 CPU name early and expose FMAF capability
Improve amdgcn macro test
Differential Revision: https://reviews.llvm.org/D38667
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316181
91177308-0d34-0410-b5e6-
96231b3b80d8
Guozhi Wei [Thu, 19 Oct 2017 20:11:23 +0000 (20:11 +0000)]
[CGExprScalar] Add missing types in function GetIntrinsic
In function GetIntrinsic, not all types are covered. Types double and long long are missed, type long is wrongly treated same as int, it should be same as long long. These problems cause compiler crashes when compiling code in PR31161. This patch fixed the problem.
Differential Revision: https://reviews.llvm.org/D38820
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316179
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 19 Oct 2017 19:07:13 +0000 (19:07 +0000)]
[Sema] Fix assertion failure when checking for unused variables in a dependent context.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316177
91177308-0d34-0410-b5e6-
96231b3b80d8
Erich Keane [Thu, 19 Oct 2017 15:58:58 +0000 (15:58 +0000)]
Fix nodiscard for volatile references
As reported here https://bugs.llvm.org/show_bug.cgi?id=34988
[[nodiscard]] warnings were not being suppressed for
volatile-ref return values.
Differential Revision: https://reviews.llvm.org/D39075
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316166
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaxun Liu [Thu, 19 Oct 2017 15:56:13 +0000 (15:56 +0000)]
[AMDGPU] Fix bug in enqueued block codegen due to an extra line
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316165
91177308-0d34-0410-b5e6-
96231b3b80d8
Gabor Horvath [Thu, 19 Oct 2017 11:58:21 +0000 (11:58 +0000)]
[analyzer] Dump signed integers in SymIntExpr and IntSymExpr correctly
Patch by: Adam Balogh!
Differential Revision: https://reviews.llvm.org/D39048
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316157
91177308-0d34-0410-b5e6-
96231b3b80d8
Haojian Wu [Thu, 19 Oct 2017 08:20:55 +0000 (08:20 +0000)]
Fix a few nits in RenamingAction.
* Add missing override keyword.
* avoid unnecessary copy of std::string.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316152
91177308-0d34-0410-b5e6-
96231b3b80d8
Martin Storsjo [Thu, 19 Oct 2017 07:40:45 +0000 (07:40 +0000)]
[Headers] Fix typoed __ARM_DWARF_EH__ ifdefs
These typos appeared in SVN r309226 and r309327.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316149
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 18 Oct 2017 22:45:01 +0000 (22:45 +0000)]
Don't suppress instantiation of definitions for variables subject to explicit
instantiation declarations if they are usable from constant expressions.
We are permitted to instantiate in these cases, and required to do so in order
to have an initializer available for use within constant evaluation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316136
91177308-0d34-0410-b5e6-
96231b3b80d8
Erich Keane [Wed, 18 Oct 2017 22:17:16 +0000 (22:17 +0000)]
Fix capitalization of parameter
The .cpp file has this properly capitalized, but
the header does not. Simply fixed it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316132
91177308-0d34-0410-b5e6-
96231b3b80d8
Krasimir Georgiev [Wed, 18 Oct 2017 22:13:25 +0000 (22:13 +0000)]
[clang-format] Sort whole block of using declarations while partially formatting
Summary:
This patch enables sorting the full block of using declarations when
some line is affected.
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D39024
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316130
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 18 Oct 2017 21:43:42 +0000 (21:43 +0000)]
[Driver] Fix use after free in Hexagon toolchain code.
No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316127
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 18 Oct 2017 18:51:48 +0000 (18:51 +0000)]
[refactor] Add a doc comment to the test function in the selection
unittest.
As suggested by Haojian Wu!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316105
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 18 Oct 2017 18:48:58 +0000 (18:48 +0000)]
[refactor] selection: new CodeRangeASTSelection represents a set of selected
consecutive statements
This commit adds a CodeRangeASTSelection value to the refactoring library. This
value represents a set of selected statements in one body of code.
Differential Revision: https://reviews.llvm.org/D38835
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316104
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Morehouse [Wed, 18 Oct 2017 18:38:04 +0000 (18:38 +0000)]
[clang-proto-fuzzer] Use ToT protobuf-mutator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316103
91177308-0d34-0410-b5e6-
96231b3b80d8
Sumanth Gundapaneni [Wed, 18 Oct 2017 18:10:13 +0000 (18:10 +0000)]
[Hexagon] Handling of new HVX flags and target-features
This patch has the following changes
A new flag "-mhvx-length={64B|128B}" is introduced to specify the length of the vector.
Previously we have used "-mhvx-double" for 128 Bytes. This adds the target-feature "+hvx-length{64|128}b"
The "-mhvx" flag must be provided on command line to enable HVX for Hexagon. If no -mhvx-length flag
is specified, a default length is picked from the arch mentioned in this priority order from either -mhvx=vxx
or -mcpu. For v60 and v62 the default length is 64 Byte. For unknown versions, the length is 128 Byte. The
-mhvx flag adds the target-feature "+hvxv{hvx_version}"
The 64 Byte mode is soon going to be deprecated. A warning is emitted if 64 Byte is enabled. A warning is
still emitted for the default 64 Byte as well. This warning can be suppressed with a -Wno flag.
The "-mhvx-double" and "-mno-hvx-double" flags are deprecated. A warning is emitted if the driver sees
them on commandline. "-mhvx-double" is an alias to "-mhvx-length=128B"
The compilation will error out if -mhvx-length is specified with out an -mhvx/-mhvx= flag
The macro HVX_LENGTH is defined and is set to the length of the vector.
Eg: #define HVX_LENGTH 64
The macro HVX_ARCH is defined and is set to the version of the HVX.
Eg: #define HVX_ARCH 62
Differential Revision: https://reviews.llvm.org/D38852
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316102
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Wed, 18 Oct 2017 16:59:27 +0000 (16:59 +0000)]
Enable support for the [[maybe_unused]] attribute from WG14 N2053 when enabling double square bracket attributes in C code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316096
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Wed, 18 Oct 2017 14:48:33 +0000 (14:48 +0000)]
Silencing a redefinition warning that was not germane to the test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316086
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Wed, 18 Oct 2017 14:33:27 +0000 (14:33 +0000)]
Enable support for the [[fallthrough]] attribute from WG14 N2052 when enabling double square bracket attributes in C code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316083
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Wed, 18 Oct 2017 12:11:58 +0000 (12:11 +0000)]
Silence -Wimplicit-fallthrough warnings with the generated code; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316075
91177308-0d34-0410-b5e6-
96231b3b80d8
Haojian Wu [Wed, 18 Oct 2017 12:10:11 +0000 (12:10 +0000)]
[clang-rename] Rename alias.
Summary:
* Support rename alias.
* Add unittests for renaming alias.
* Don't generate fixes for the SourceLocations that are invalid or in temporary
buffer, otherwise crash would be happened when generating AtomicChanges.
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: klimek, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D39043
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316074
91177308-0d34-0410-b5e6-
96231b3b80d8
Gabor Horvath [Wed, 18 Oct 2017 09:25:18 +0000 (09:25 +0000)]
[ASTImporter] Import SubStmt of CaseStmt
Patch by: Rafael Stahl!
Differential Revision: https://reviews.llvm.org/D38943
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316069
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 18 Oct 2017 05:21:17 +0000 (05:21 +0000)]
[CMake] Use #cmakedefine01 for CLANG_ENABLE_(ARCMT|OBJC_REWRITER|STATIC_ANALYZER)
It'd be better that they are #cmakedefine01 rather than #cmakedefine.
(#if FOO rather than #if defined(FOO))
Then we can find missing #include "clang/Config/config.h" in the future.
Differential Revision: https://reviews.llvm.org/D35541
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316061
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 18 Oct 2017 02:19:24 +0000 (02:19 +0000)]
Provide a flag group to turn on/off all "binary literals" extension warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316056
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 18 Oct 2017 01:41:38 +0000 (01:41 +0000)]
[modules] When finding the owning module of an instantiated context in template
instantiation, follow lexical parents not semantic ones: we want to find the
module where the pattern was written.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316055
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Wed, 18 Oct 2017 01:27:54 +0000 (01:27 +0000)]
[CMake] Build Fuchsia toolchain as -O3
Differential Revision: https://reviews.llvm.org/D39017
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316053
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 18 Oct 2017 00:00:50 +0000 (00:00 +0000)]
Basic: fix __{,U}INTPTR_TYPE__ on ARM
Darwin and OpenBSD are the only platforms which use `long int` for
`__INTPTR_TYPE__`. The other platforms use `int` in 32-bit, and `long
int` on 64-bit (except for VMS and Windows which are LLP64). Adjust the
type definitions to match the platform definitions. We now generate the
same definition as GCC on all the targets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316046
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Tue, 17 Oct 2017 23:43:36 +0000 (23:43 +0000)]
Resubmit "[lit] Raise the logic for enabling clang & lld substitutions to llvm."
The substitution for %debuginfo_tests had been inadvertently removed.
This adds it back.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316043
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Tue, 17 Oct 2017 22:49:53 +0000 (22:49 +0000)]
Basic: fix `__INTPTR_TYPE__` for Windows ARM
The `IntPtrType` for Windows ARM should be `int` as per MSVC. Adjust
the type accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316042
91177308-0d34-0410-b5e6-
96231b3b80d8
George Karpenkov [Tue, 17 Oct 2017 22:28:18 +0000 (22:28 +0000)]
[Analyzer] Always use non-reference types when creating expressions in BodyFarm.
Remove an option to use a reference type (on by default!) since a
non-reference type is always needed for creating expressions, functions
with multiple boolean parameters are very hard to use, and in general it
was just a booby trap for further crashes.
Furthermore, generalize call_once test case to fix some of the crashes mentioned
https://bugs.llvm.org/show_bug.cgi?id=34869
Also removes std::call_once crash.
Differential Revision: https://reviews.llvm.org/D39015
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316041
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Tue, 17 Oct 2017 21:14:02 +0000 (21:14 +0000)]
Fix PR34981, a crash-on-invalid merging dllimport to an invalid redecl.
This is basically like r288207, just the other way round.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316032
91177308-0d34-0410-b5e6-
96231b3b80d8
Erich Keane [Tue, 17 Oct 2017 20:57:24 +0000 (20:57 +0000)]
[CFG] Relax Wexceptions warning on rethrow
As reported here: https://bugs.llvm.org/show_bug.cgi?id=34973
"catch(...)" should catch EVERYTHING, even a rethrow. This
patch changes the order in which things are checked to ensure
that a '...' catch will get a rethrow.
Differential Revision: https://reviews.llvm.org/D39013
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316030
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 17 Oct 2017 20:49:30 +0000 (20:49 +0000)]
This test case was missing -fsyntax-only, so I've added it. NFC to the actual test contents, just how the test is executed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316028
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 17 Oct 2017 20:33:35 +0000 (20:33 +0000)]
Enable support for the [[nodiscard]] attribute from WG14 N2050 when enabling double square bracket attributes in C code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316026
91177308-0d34-0410-b5e6-
96231b3b80d8
Vassil Vassilev [Tue, 17 Oct 2017 19:38:57 +0000 (19:38 +0000)]
Expose ConsumeAnyToken interface to external clients.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316022
91177308-0d34-0410-b5e6-
96231b3b80d8
Bruno Cardoso Lopes [Tue, 17 Oct 2017 17:54:57 +0000 (17:54 +0000)]
[OpenCL] Restrict swizzle length check to OpenCL mode
Changes behavior introduced in r298369 to only error out on
vector component invalid length access on OpenCL mode.
Differential Revision: https://reviews.llvm.org/D38868
rdar://problem/
33568748
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316016
91177308-0d34-0410-b5e6-
96231b3b80d8
Erich Keane [Tue, 17 Oct 2017 17:45:21 +0000 (17:45 +0000)]
Replace use of SmallVector::back + pop_back with pop_back_val
I ran across an instance where the value was being loaded
out via back, then immediately popped. Since pop_back_val
is more efficient at this (it moves out), replace this
instance.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316015
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Tue, 17 Oct 2017 17:39:32 +0000 (17:39 +0000)]
Sema: use new `getNS{,U}IntegerType` for NS{,U}Integer
Use the new helper methods to get the underlying type for NSUInteger,
NSInteger types. This avoids spreading the knowledge of the underlying
types in various sites. For non-LLP64 targets, this has no change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316013
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Tue, 17 Oct 2017 16:47:34 +0000 (16:47 +0000)]
[OPENMP] Fix capturing of boolean variables in debug mode.
If the variables is boolean and we generating inner function with real
types, the codegen may crash because of not loading boolean value from
memory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316011
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Hahnfeld [Tue, 17 Oct 2017 14:28:14 +0000 (14:28 +0000)]
[OpenMP] Implement omp_is_initial_device() as builtin
This allows to return the static value that we know at compile time.
Differential Revision: https://reviews.llvm.org/D38968
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316001
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaxun Liu [Tue, 17 Oct 2017 14:19:29 +0000 (14:19 +0000)]
CodeGen: Fix invalid bitcasts for atomic builtins
Currently clang assumes the temporary variables emitted during
codegen of atomic builtins have address space 0, which
is not true for target triple amdgcn---amdgiz and causes invalid
bitcasts.
This patch fixes that.
Differential Revision: https://reviews.llvm.org/D38966
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316000
91177308-0d34-0410-b5e6-
96231b3b80d8
Haojian Wu [Tue, 17 Oct 2017 14:14:41 +0000 (14:14 +0000)]
[clang-rename] Rename enum.
Summary:
* Add unit tests for renaming enum.
* Support unscoped enum constants in expressions.
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: klimek, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D38989
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315999
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Hahnfeld [Tue, 17 Oct 2017 13:37:36 +0000 (13:37 +0000)]
[CMake][OpenMP] Customize default offloading arch
For the shuffle instructions in reductions we need at least sm_30
but the user may want to customize the default architecture.
Differential Revision: https://reviews.llvm.org/D38883
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315996
91177308-0d34-0410-b5e6-
96231b3b80d8
Ivan A. Kosarev [Tue, 17 Oct 2017 11:20:19 +0000 (11:20 +0000)]
[CodeGen] Refine generation of TBAA info for bit-field lvalues
The main change is that now we generate TBAA info before
constructing the resulting lvalue instead of constructing lvalue
with some default TBAA info and fixing it as necessary
afterwards. We also keep the TBAA info close to lvalue base info,
which is supposed to simplify their future merging.
This patch should not bring in any functional changes.
This is part of D38126 reworked to be a separate patch to
simplify review.
Differential Revision: https://reviews.llvm.org/D38947
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315989
91177308-0d34-0410-b5e6-
96231b3b80d8
Ivan A. Kosarev [Tue, 17 Oct 2017 10:17:43 +0000 (10:17 +0000)]
[CodeGen] Pass TBAA info along with lvalue base info everywhere
This patch addresses the rest of the cases where we pass lvalue
base info, but do not provide corresponding TBAA info.
This patch should not bring in any functional changes.
This is part of D38126 reworked to be a separate patch to make
reviewing easier.
Differential Revision: https://reviews.llvm.org/D38945
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315986
91177308-0d34-0410-b5e6-
96231b3b80d8
Ivan A. Kosarev [Tue, 17 Oct 2017 09:12:13 +0000 (09:12 +0000)]
[CodeGen] EmitPointerWithAlignment() to generate TBAA info along with LValue base info
Differential Revision: https://reviews.llvm.org/D38796
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315984
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Tue, 17 Oct 2017 07:47:39 +0000 (07:47 +0000)]
[Coverage] Discard deferred region in closing if-else
A trailing deferred region isn't necessary in a function that ends with
this pattern:
...
else {
...
return;
}
Special-case this pattern so that the closing curly brace of the
function isn't marked as uncovered. This issue came up in PR34962.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315982
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Tue, 17 Oct 2017 06:51:54 +0000 (06:51 +0000)]
[Coverage] Explicitly mark the l.h.s of && and || (fixes PR33465)
This makes it possible to view sub-line region counts for the l.h.s of
&& and || expressions in coverage reports.
It also fixes PR33465, which shows an example of incorrect coverage
output for an assignment statement containing '||'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315979
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Tue, 17 Oct 2017 03:30:25 +0000 (03:30 +0000)]
Basic: make the nan family pure
The nan family of math routines do not rely on global state. They do
however depend on their parameter. This fits the description of pure:
Functions which have no effects except the return value and their
return value depends only on the parameters and/or global variables.
Mark the family as `readonly`.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315968
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonathan Coe [Mon, 16 Oct 2017 23:46:02 +0000 (23:46 +0000)]
[libclang] Add support for querying cursor availability
Summary:
This patch allows checking the availability of cursors through libclang and clang.cindex (Python).
This e.g. allows to check whether a C++ member function has been marked as deleted.
Reviewers: arphaman, jbcoe
Reviewed By: jbcoe
Subscribers: cfe-commits
Tags: #clang
Patch by jklaehn (Johann Klähn)
Differential Revision: https://reviews.llvm.org/D36973
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315959
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonathan Coe [Mon, 16 Oct 2017 23:43:02 +0000 (23:43 +0000)]
[libclang] Visit attributes for function and class templates
Summary: Previously, `VisitAttributes` was not called for function and class templates and thus their attributes were not accessible using libclang.
Reviewers: bkramer, arphaman, rsmith, jbcoe
Reviewed By: jbcoe
Subscribers: cfe-commits
Tags: #clang
Patch by jklaehn (Johann Klähn)
Differential Revision: https://reviews.llvm.org/D36955
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315958
91177308-0d34-0410-b5e6-
96231b3b80d8
Erich Keane [Mon, 16 Oct 2017 23:25:24 +0000 (23:25 +0000)]
Fix usage in TableGen of getValueAsString
Record::getValueAsString returns a stringref to an interned
string (apparently had been changed since most of tablegen was
written). In this patch, I audited the usage of getValueAsString
to find places where we can trivially stop storing 'std::string' and instead
keep the stringref.
There was one instance where an unnecessary 'stringstream' was being used,
so that has been removed as well to unblock the stringref replacing string fix.
Differential Revision: https://reviews.llvm.org/D38979
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315956
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 16 Oct 2017 23:07:15 +0000 (23:07 +0000)]
Don't print end-of-directive tokens in -E output
This comes up when pre-processing standalone .s files containing
hash-prefixed comments. The pre-processor should skip the unknown
directive and not emit an extra newline as we were doing.
Fixes PR34950
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315953
91177308-0d34-0410-b5e6-
96231b3b80d8
George Burgess IV [Mon, 16 Oct 2017 22:58:37 +0000 (22:58 +0000)]
Make __builtin_types_compatible_p more like GCC's
GCC ignore qualifiers on array types. Since we seem to have this
function primarily for GCC compatibility, we should try to match that
behavior.
This also adds a few more test-cases __builtin_types_compatible_p,
which were inspired by GCC's documentation on the builtin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315951
91177308-0d34-0410-b5e6-
96231b3b80d8
Erich Keane [Mon, 16 Oct 2017 22:47:26 +0000 (22:47 +0000)]
Replace usage of std::stringstream with raw_string_ostream
Typically we don't use the stringstream, so instead use
raw_string_stream. Additionally, the dependent function
changed to use raw_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315950
91177308-0d34-0410-b5e6-
96231b3b80d8
Erich Keane [Mon, 16 Oct 2017 20:44:14 +0000 (20:44 +0000)]
Remove AnyX86Interrupt documentation
This documentation was copied directly from the GCC
documentaiton in r257867. Reverting and alterting
the original author so that it can be rewritten in
copyright-safe language.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315934
91177308-0d34-0410-b5e6-
96231b3b80d8
Erich Keane [Mon, 16 Oct 2017 20:31:05 +0000 (20:31 +0000)]
Sort Attributes by "HeaderName"
Attributes in the docs were previously sorted (apparently)
by the attribute name, so AnyX86Interrupt ended up being the
first one, rather than in a meaningful place. This resulted in the
4 'interrupt' titled sections being all in different places.
This replaces it with a naive alphabetical sort (case sensitive, underscore
and special characters first, etc).
Differential Revision: https://reviews.llvm.org/D38969
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315931
91177308-0d34-0410-b5e6-
96231b3b80d8
Erich Keane [Mon, 16 Oct 2017 20:13:36 +0000 (20:13 +0000)]
Clarify the 'interrupt' names in Attribute Docs
All 4 of the 'interrupt' headers were automatically named
'interrupt'. This patch gives them unique names.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315929
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 16 Oct 2017 18:28:26 +0000 (18:28 +0000)]
[refactor] allow the use of refactoring diagnostics
This commit allows the refactoring library to use its own set of
refactoring-specific diagnostics to reports things like initiation errors.
Differential Revision: https://reviews.llvm.org/D38772
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315924
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 16 Oct 2017 18:07:16 +0000 (18:07 +0000)]
clang-refactor: Use llvm_unreachable in an unused override
As suggested by David Blaikie!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315923
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Mon, 16 Oct 2017 18:02:57 +0000 (18:02 +0000)]
Do not link clang_rt.cfi on Android.
Summary:
The OS provides cross-dso CFI support starting with Android O.
Trapping mode does not require any runtime at all, and diagnostic mode
requires just ubsan-standalone.
Reviewers: pcc
Subscribers: srhines, cfe-commits
Differential Revision: https://reviews.llvm.org/D38908
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315921
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 16 Oct 2017 17:31:16 +0000 (17:31 +0000)]
Recommit r315738 "[clang-refactor] Apply source replacements"
The fixed commit ensures that ParsedSourceRange works correctly
with Windows paths.
Original message:
This commit actually brings clang-refactor to a usable state as it can now
apply the refactoring changes to source files.
The -selection option is now also fully supported.
Differential Revision: https://reviews.llvm.org/D38402
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315918
91177308-0d34-0410-b5e6-
96231b3b80d8
Wei Mi [Mon, 16 Oct 2017 16:50:27 +0000 (16:50 +0000)]
[Bitfield] Add an option to access bitfield in a fine-grained manner.
Currently all the consecutive bitfields are wrapped as a large integer unless there is unamed zero sized bitfield in between. The patch provides an alternative manner which makes the bitfield to be accessed as separate memory location if it has legal integer width and is naturally aligned. Such separate bitfield may split the original consecutive bitfields into subgroups of consecutive bitfields, and each subgroup will be wrapped as an integer. Now This is all controlled by an option -ffine-grained-bitfield-accesses. The alternative of bitfield access manner can improve the access efficiency of those bitfields with legal width and being aligned, but may reduce the chance of load/store combining of other bitfields, so it depends on how the bitfields are defined and actually accessed to choose when to use the option. For now the option is off by default.
Differential revision: https://reviews.llvm.org/D36562
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315915
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Hahnfeld [Mon, 16 Oct 2017 13:31:30 +0000 (13:31 +0000)]
[CUDA] Require libdevice only if needed
If the user passes -nocudalib, we can live without it being present.
Simplify the code by just checking whether LibDeviceMap is empty.
Differential Revision: https://reviews.llvm.org/D38901
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315902
91177308-0d34-0410-b5e6-
96231b3b80d8
Haojian Wu [Mon, 16 Oct 2017 10:37:42 +0000 (10:37 +0000)]
[clang-rename] Add function unit tests.
Summary:
Also contain a fix:
* Fix a false positive of renaming a using shadow function declaration.
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: klimek, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D38882
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315898
91177308-0d34-0410-b5e6-
96231b3b80d8