Richard Smith [Tue, 15 May 2018 21:27:30 +0000 (21:27 +0000)]
Don't produce a redundant "auto type is incompatible with C++98" on every lambda with no explicit return type.
We already warned about the lambda, and we don't have a source location for the imagined "auto" anyway.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332401
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 15 May 2018 21:26:47 +0000 (21:26 +0000)]
Move helper classes into anonymous namespaces. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332400
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 15 May 2018 21:00:30 +0000 (21:00 +0000)]
Address post-commit review comments after r328731. NFC.
- Define a function (canPassInRegisters) that determines whether a
record can be passed in registers based on language rules and
target-specific ABI rules.
- Set flag RecordDecl::ParamDestroyedInCallee to true in MSVC mode and
remove ASTContext::isParamDestroyedInCallee, which is no longer needed.
- Use the same type (unsigned) for RecordDecl's bit-field members.
For more background, see the following discussions that took place on
cfe-commits.
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-
20180326/223498.html
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-
20180402/223688.html
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-
20180409/224754.html
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-
20180423/226494.html
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-
20180507/227647.html
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332397
91177308-0d34-0410-b5e6-
96231b3b80d8
Sunil Srivastava [Tue, 15 May 2018 18:28:42 +0000 (18:28 +0000)]
Fixed some rtti-options tests.
Certain tests in rtti-options.cpp are not really testing anything because they are testing for the absence of -frtti option to the cc1 process. Since the cc1 process does not take -frtti option, these tests are passing tautologically.
The RTTI mode is enabled by default in cc1, and -fno-rtti disables it. Therefore the correct way to check for enabling of RTTI is to check for the absence of -fno-rtti to cc1, and the correct way to check for disabling of RTTI is to check for the presence of -fno-rtti to cc1.
This patch fixes those tests.
Differential Revision: https://reviews.llvm.org/D46836
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332384
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Tue, 15 May 2018 18:15:59 +0000 (18:15 +0000)]
[Hexagon] Add driver options for subtarget features
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332383
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Tue, 15 May 2018 18:01:01 +0000 (18:01 +0000)]
[OPENMP, NVPTX] Do not globalize variables with reference/pointer types.
In generic data-sharing mode we do not need to globalize
variables/parameters of reference/pointer types. They already are placed
in the global memory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332380
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Tue, 15 May 2018 16:37:00 +0000 (16:37 +0000)]
update two comments as suggested on https://reviews.llvm.org/D46843
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332370
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicola Zaghen [Tue, 15 May 2018 13:30:56 +0000 (13:30 +0000)]
[clang] Update uses of DEBUG macro to LLVM_DEBUG.
The DEBUG() macro is very generic so it might clash with other projects.
The renaming was done as follows:
- git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g'
- git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM
Explicitly avoided changing the strings in the clang-format tests.
Differential Revision: https://reviews.llvm.org/D44975
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332350
91177308-0d34-0410-b5e6-
96231b3b80d8
Rainer Orth [Tue, 15 May 2018 11:36:00 +0000 (11:36 +0000)]
[Solaris] Only define _REENTRANT if -pthread
When looking at lib/Basic/Targets/OSTargets.h, I noticed that _REENTRANT is defined
unconditionally on Solaris, unlike all other targets and what either Studio cc (only define
it with -mt) or gcc (only define it with -pthread) do.
This patch follows that lead.
Differential Revision: https://reviews.llvm.org/D41241
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332343
91177308-0d34-0410-b5e6-
96231b3b80d8
Aleksei Sidorin [Tue, 15 May 2018 11:09:07 +0000 (11:09 +0000)]
[ASTImporter] Extend lookup logic in class templates
During import of a class template, lookup may find a forward
declaration and structural match falsely reports equivalency
between a forward decl and a definition. The result is that
some definitions are not imported if we had imported a forward
decl previously. This patch gives a fix.
Patch by Gabor Marton!
Differential Revision: https://reviews.llvm.org/D46353
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332338
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Tue, 15 May 2018 10:19:24 +0000 (10:19 +0000)]
Make ast-print-record-decl.c pass on Windows after r332314
It was failing because on Windows, -ast-print prints
__single_inheritance(1) before T1.
Adding a triple is a stop-gap fix until it can be fixed properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332335
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 15 May 2018 03:17:52 +0000 (03:17 +0000)]
[X86] Revert part of r332266: Use __builtin_convertvector to replace some of the avx512 truncate builtins.
The masking doesn't work right in the backend for the ones that produce byte or word elements without avx512bw.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332322
91177308-0d34-0410-b5e6-
96231b3b80d8
Joel E. Denny [Tue, 15 May 2018 00:44:14 +0000 (00:44 +0000)]
[AST] Fix printing tag decl groups in decl contexts
For example, given:
struct T1 {
struct T2 *p0;
};
-ast-print produced:
struct T1 {
struct T2;
struct T2 *p0;
};
Compiling that produces a warning that the first struct T2 declaration
does not declare anything.
Details:
A tag decl group is one or more decls that share a type specifier that
is a tag decl (that is, a struct/union/class/enum decl). Within
functions, the parser builds such a tag decl group as part of a
DeclStmt. However, in decl contexts, such as file scope or a member
list, the parser does not group together the members of a tag decl
group. Previously, detection of tag decl groups during printing was
implemented but only if the tag decl was unnamed. Otherwise, as in
the above example, the members of the group did not print together and
so sometimes introduced warnings.
This patch extends detection of tag decl groups in decl contexts to
any tag decl that is recorded in the AST as not free-standing.
Reviewed by: rsmith
Differential Revision: https://reviews.llvm.org/D45465
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332314
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Mon, 14 May 2018 23:21:48 +0000 (23:21 +0000)]
Enable control flow pruning of float overflow warnings.
Like other conversion warnings, allow float overflow warnings to be disabled
in known dead paths of template instantiation. This often occurs when a
template template type is a numeric type and the template will check the
range of the numeric type before performing the conversion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332310
91177308-0d34-0410-b5e6-
96231b3b80d8
Volodymyr Sapsai [Mon, 14 May 2018 22:49:44 +0000 (22:49 +0000)]
[c++17] Fix assertion on synthesizing deduction guides after a fatal error.
After a fatal error Sema::InstantiatingTemplate doesn't allow further
instantiation and doesn't push a CodeSynthesisContext. When we tried to
synthesize implicit deduction guides from constructors we hit the
assertion
> Assertion failed: (!CodeSynthesisContexts.empty() && "Cannot perform an instantiation without some context on the " "instantiation stack"), function SubstType, file clang/lib/Sema/SemaTemplateInstantiate.cpp, line 1580.
Fix by avoiding deduction guide synthesis if InstantiatingTemplate is invalid.
rdar://problem/
39051732
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D46446
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332307
91177308-0d34-0410-b5e6-
96231b3b80d8
Artem Dergachev [Mon, 14 May 2018 22:32:24 +0000 (22:32 +0000)]
[analyzer] Re-apply r331096 "CStringChecker: Add support for BSD strlcpy()...".
Fixed after revert in r331401.
Patch by David Carlier!
Differential Revision: https://reviews.llvm.org/D45177
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332303
91177308-0d34-0410-b5e6-
96231b3b80d8
George Karpenkov [Mon, 14 May 2018 21:39:54 +0000 (21:39 +0000)]
[analyzer] Extend the ObjCAutoreleaseWriteChecker to warn on captures as well
A common pattern is that the code in the block does not write into the
variable explicitly, but instead passes it to a helper function which
performs the write.
Differential Revision: https://reviews.llvm.org/D46772
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332300
91177308-0d34-0410-b5e6-
96231b3b80d8
Brock Wyma [Mon, 14 May 2018 21:21:22 +0000 (21:21 +0000)]
[CodeView] Improve debugging of virtual base class member variables
Initial support for passing the virtual base pointer offset to CodeViewDebug.
https://reviews.llvm.org/D46271
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332296
91177308-0d34-0410-b5e6-
96231b3b80d8
Joel E. Denny [Mon, 14 May 2018 21:06:04 +0000 (21:06 +0000)]
Fix test fail on some buildbots, caused by r332281.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332294
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Mon, 14 May 2018 20:52:48 +0000 (20:52 +0000)]
Fix regression in r332076.
If the name after 'template' is an unresolved using declaration (not containing
'typename'), then we don't yet know if it's a valid template-name, so don't
reject it prior to instantiation. Instead, treat it as naming a dependent
member of the current instantiation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332291
91177308-0d34-0410-b5e6-
96231b3b80d8
George Karpenkov [Mon, 14 May 2018 20:29:16 +0000 (20:29 +0000)]
Remove the fixit for the diagnostics regarding capturing autoreleasing variables in a block
The fixit is actively harmful, as it encourages developers to ignore the
warning and to write unsafe code.
It is almost impossible to write safe code while capturing autoreleasing
variables in the block, as in order to check that the block is never
called in the autoreleasing pool the developer has to check the
transitive closure of all potential callers of the block.
Differential Revision: https://reviews.llvm.org/D46778
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332288
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Liu [Mon, 14 May 2018 20:17:53 +0000 (20:17 +0000)]
[Tooling] Pull #include manipulation code from clangFormat into libToolingCore.
Summary: Also pull #include related style out of FormatStyle as tooling::IncludeStyle.
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: klimek, mgorny, cfe-commits, djasper
Differential Revision: https://reviews.llvm.org/D46496
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332287
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Mon, 14 May 2018 20:15:04 +0000 (20:15 +0000)]
PR37450: Fix bug that disabled some type checks for variables with deduced types.
Also improve diagnostic for the case where a type is non-literal because it's a lambda.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332286
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Liu [Mon, 14 May 2018 19:51:33 +0000 (19:51 +0000)]
[clang-format] Move #include related style to libToolingCore
Summary: This will be shared by include insertion/deletion library.
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: mgorny, klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D46758
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332284
91177308-0d34-0410-b5e6-
96231b3b80d8
Joel E. Denny [Mon, 14 May 2018 19:36:45 +0000 (19:36 +0000)]
[AST] Print correct tag decl for tag specifier
For example, given:
void fn() {
struct T *p0;
struct T { int i; } *p1;
}
-ast-print produced:
void fn() {
struct T { int i; } *p0;
struct T { int i; } *p1;
}
Compiling that fails with a redefinition error.
Given:
void fn() {
struct T *p0;
struct __attribute__((deprecated)) T *p1;
}
-ast-print dropped the attribute.
Details:
For a tag specifier (that is, struct/union/class/enum used as a type
specifier in a declaration) that was also a tag declaration (that is,
first occurrence of the tag) or tag redeclaration (that is, later
occurrence that specifies attributes or a member list), clang printed
the tag specifier as either (1) the full tag definition if one
existed, or (2) the first tag declaration otherwise. Redefinition
errors were sometimes introduced, as in the first example above. Even
when that was impossible because no member list was ever specified,
attributes were sometimes lost, thus changing semantics and
diagnostics, as in the second example above.
This patch fixes a major culprit for these problems. It does so by
creating an ElaboratedType with a new OwnedDecl member wherever an
occurrence of a tag type is a (re)declaration of that tag type.
PrintingPolicy's IncludeTagDefinition used to trigger printing of the
member list, attributes, etc. for a tag specifier by using a tag
(re)declaration selected as described above. Now, it triggers the
same thing except it uses the tag (re)declaration stored in the
OwnedDecl. Of course, other tooling can now make use of the new
OwnedDecl as well.
Also, to be more faithful to the original source, this patch
suppresses printing of attributes inherited from previous
declarations.
Reviewed by: rsmith, aaron.ballman
Differential Revision: https://reviews.llvm.org/D45463
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332281
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaxun Liu [Mon, 14 May 2018 19:20:12 +0000 (19:20 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332279
91177308-0d34-0410-b5e6-
96231b3b80d8
Joel E. Denny [Mon, 14 May 2018 18:41:44 +0000 (18:41 +0000)]
[AST] Fix -ast-print for _Bool when have diagnostics
For example, given:
#define bool _Bool
_Bool i;
void fn() { 1; }
-ast-print produced:
tmp.c:3:13: warning: expression result unused
void fn() { 1; }
^
bool i;
void fn() {
1;
}
That fails to compile because bool is undefined.
Details:
Diagnostics print _Bool as bool when the latter is defined as the
former. However, diagnostics were altering the printing policy for
-ast-print as well. The printed source was then invalid because the
preprocessor eats the bool definition.
Problematic diagnostics included suppressed warnings (e.g., add
-Wno-unused-value to the above example), including those that are
suppressed by default.
This patch fixes this bug and cleans up some related comments.
Reviewed by: aaron.ballman, rsmith
Differential Revision: https://reviews.llvm.org/D45093
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332275
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 14 May 2018 17:50:40 +0000 (17:50 +0000)]
[X86] Use __builtin_convertvector to replace some of the avx512 truncate builtins.
As long as the destination type is a 256 or 128 bit vector with the same number of elements we can use __builtin_convertvector to directly generate trunc IR instruction which will be handled natively by the backend.
Differential Revision: https://reviews.llvm.org/D46742
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332266
91177308-0d34-0410-b5e6-
96231b3b80d8
Aleksei Sidorin [Mon, 14 May 2018 16:12:31 +0000 (16:12 +0000)]
[ASTImporter] Turn StringRefs back to std::strings to avoid use-after-free
This is a workaround for the issue in buildASTFromCodeWithArgs()
where a local buffer can be used to store the program text
referred by SourceManager.
FIXME: Fix the root issue in buildASTFromCodeWithArgs().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332256
91177308-0d34-0410-b5e6-
96231b3b80d8
Ilya Biryukov [Mon, 14 May 2018 13:50:36 +0000 (13:50 +0000)]
[CodeComplete] Provide completion in decls even for incomplete types
Summary:
This change fixes lack of completions in the following case
('^'designates completion points) :
void f(^);
struct Incomplete;
Incomplete g(^);
Reviewers: bkramer, aaron.ballman, sammccall
Reviewed By: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D46639
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332244
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Liu [Mon, 14 May 2018 12:07:56 +0000 (12:07 +0000)]
Redirect output to /dev/null in the tests added in r332160.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332236
91177308-0d34-0410-b5e6-
96231b3b80d8
Pavel Labath [Mon, 14 May 2018 11:35:44 +0000 (11:35 +0000)]
Revert "[CodeGen] Disable aggressive structor optimizations at -O0"
It breaks the sanitizer build
<http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/23739>
This reverts commit r332228.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332232
91177308-0d34-0410-b5e6-
96231b3b80d8
Pavel Labath [Mon, 14 May 2018 11:02:23 +0000 (11:02 +0000)]
[CodeGen] Disable aggressive structor optimizations at -O0
Summary:
Removing the full structor and replacing all usages with the base one
can degrade debug quality as it will leave the debugger unable to locate
the full object structor. This is apparent when evaluating an expression
in the debugger which requires constructing an object of class which has
had this optimization applied to it. When compiling the expression, we
pretend that the class and its methods have been defined in another
compilation unit, so the expression compiler assumes the structor
definition must be available. This didn't use to be the case for
structors with internal linkage. Less aggressive optimizations like
emitting the full structor as an alias remain in place, as they do not
cause the structor symbol to disappear completely.
This improves debug quality on non-darwin platforms (darwin does not
have -mconstructor-aliases on by default, so it is spared these
problems) and enable us to remove some workarounds from LLDB which attempt to
mitigate this issue.
Reviewers: rjmccall, aprantl
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D46685
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332228
91177308-0d34-0410-b5e6-
96231b3b80d8
Krasimir Georgiev [Mon, 14 May 2018 10:33:40 +0000 (10:33 +0000)]
[clang-format] Continue after non-scope-closers in getLengthToMatchingParen
Summary:
This fixes a regression introduced by `r331857` where we stop the search for
the End token as soon as we hit a non-scope-closer, which prematurely stops before
semicolons for example, which should otherwise be considered as part of the unbreakable tail.
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D46824
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332225
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Bradbury [Mon, 14 May 2018 09:14:43 +0000 (09:14 +0000)]
[RISCV][NFC] Use more appropriate label for CHECK lines
'CC1' was a misleading prefix. Committing so as to simplify the diff for a
patch I'm about to put up for review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332222
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 14 May 2018 04:57:46 +0000 (04:57 +0000)]
[X86] Use select instrution and fpextend in the implementation of _mm512_mask_cvtps_pd and _mm512_maskz_cvtps_pd.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332213
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 14 May 2018 04:05:06 +0000 (04:05 +0000)]
[X86] Use __builtin_convertvector to implement _mm512_cvtps_pd.
If we're using default rounding mode we can let __builtin_convertvector to generate an fpextend. This matches 128 and 256 bit.
If we're using the version that takes an explicit rounding mode argument we would need to look at the immediate to see if its CUR_DIRECTION.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332210
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 13 May 2018 23:03:30 +0000 (23:03 +0000)]
[X86] Emit better code for _mm_cvtu32_sd, _mm_cvtu64_sd, _mm_cvtu32_ss, and _mm_cvtu64_ss.
We can use direct C code for these that will use uitofp and insertelement instructions.
For the versions that take an explicit rounding mode we can't do this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332203
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Sun, 13 May 2018 07:45:58 +0000 (07:45 +0000)]
Added atomic_fetch_min, max, umin, umax intrinsics to clang.
These intrinsics work exactly as all other atomic_fetch_* intrinsics and allow to create *atomicrmw* with ordering.
Updated the clang-extensions document.
Differential Revision: https://reviews.llvm.org/D46386
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332193
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Yung [Sat, 12 May 2018 00:39:17 +0000 (00:39 +0000)]
Add requirement of x86 target for test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332164
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Yung [Sat, 12 May 2018 00:06:59 +0000 (00:06 +0000)]
Force the PS4 clang ABI version to 6.
The PS4 requires clang ABI version 6 for compatibility reasons. This change forces this and if the user specifies a different version when the PS4 target is specified, the compiler emits a warning that the specified version is being ignored.
Reviewers: probinson
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D46767
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332160
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Fri, 11 May 2018 20:42:31 +0000 (20:42 +0000)]
[Driver] Only use -lc++ on Fuchsia
The fact that libc++ depends on libc++abi and libunwind is an internal
detail that's captured by the libc++.so linker script.
Differential Revision: https://reviews.llvm.org/D46768
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332138
91177308-0d34-0410-b5e6-
96231b3b80d8
George Karpenkov [Fri, 11 May 2018 20:39:19 +0000 (20:39 +0000)]
[analyzer] Ignore the nullability quantifiers for autoreleasewritechecker
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332136
91177308-0d34-0410-b5e6-
96231b3b80d8
George Karpenkov [Fri, 11 May 2018 20:38:39 +0000 (20:38 +0000)]
[analyzer] Fix the filename for the exploration_order test.
Ensures that the test is being run.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332135
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 11 May 2018 19:46:31 +0000 (19:46 +0000)]
[libclang] Stop assuming that the internal C++ ABI ExceptionSpecificationType enumeration is the same as CXCursor_ExceptionSpecificationKind.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332130
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Fri, 11 May 2018 19:45:14 +0000 (19:45 +0000)]
[OPENMP, NVPTX] Do not use SPMD mode for target simd and target teams
distribute simd directives.
Directives `target simd` and `target teams distribute simd` must be
executed in non-SPMD mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332129
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaxun Liu [Fri, 11 May 2018 19:21:39 +0000 (19:21 +0000)]
[HIP] Set proper triple and offload kind for the toolchain
Also introduce --hip-link option to indicate HIP for linking.
Differential Revision: https://reviews.llvm.org/D46475
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332123
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaxun Liu [Fri, 11 May 2018 19:14:34 +0000 (19:14 +0000)]
[HIP] Diagnose unsupported host triple
Differential Revision: https://reviews.llvm.org/D46487
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332122
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaxun Liu [Fri, 11 May 2018 19:02:18 +0000 (19:02 +0000)]
[HIP] Let clang-offload-bundler support HIP
When bundle/unbundle intermediate files for HIP, there may be multiple
sub archs, therefore BoundArch needs to be included in the target
and output file names for clang-offload-bundler.
Differential Revision: https://reviews.llvm.org/D46473
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332121
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 11 May 2018 17:37:40 +0000 (17:37 +0000)]
[X86] Fix the file header name on fmaintrin.h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332108
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 11 May 2018 16:41:51 +0000 (16:41 +0000)]
[Hexagon] Implement checking arguments of builtin calls
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332105
91177308-0d34-0410-b5e6-
96231b3b80d8
Gabor Buella [Fri, 11 May 2018 14:22:04 +0000 (14:22 +0000)]
[X86] Assume alignment of movdir64b dst argument
Reviewers: craig.topper
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D46683
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332091
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 11 May 2018 02:43:08 +0000 (02:43 +0000)]
Improve diagnostics and error recovery for template name lookup.
For 'x::template y', consistently give a "no member named 'y' in 'x'"
diagnostic if there is no such member, and give a 'template keyword not
followed by a template' name error if there is such a member but it's not a
template. In the latter case, add a note pointing at the non-template.
Don't suggest inserting a 'template' keyword in 'X::Y<' if X is dependent
if the lookup of X::Y was actually not a dependent lookup and found only
non-templates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332076
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 11 May 2018 01:26:11 +0000 (01:26 +0000)]
Don't propagate dllimport to base class template static data members
MSVC doesn't, so we shouldn't. Fixes PR37232.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332074
91177308-0d34-0410-b5e6-
96231b3b80d8
Kamil Rytarowski [Fri, 11 May 2018 01:00:38 +0000 (01:00 +0000)]
Support XRay in the NetBSD driver
Summary:
While there, perform a small cleanup, reducing delta
with drivers for other OSes.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, vitalybuka, dberris
Reviewed By: dberris
Subscribers: llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D46721
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332071
91177308-0d34-0410-b5e6-
96231b3b80d8
Kamil Rytarowski [Fri, 11 May 2018 00:58:55 +0000 (00:58 +0000)]
Permit -fxray-instrument for NetBSD/amd64
Summary:
Use the same branch as FreeBSD and OpenBSD.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, dberris, vitalybuka
Reviewed By: vitalybuka
Subscribers: emaste, llvm-commits
Differential Revision: https://reviews.llvm.org/D46737
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332070
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 10 May 2018 22:24:00 +0000 (22:24 +0000)]
[clang-cl] Make -f[no-]coverage-mapping available
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332053
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonathan Coe [Thu, 10 May 2018 21:39:29 +0000 (21:39 +0000)]
implementing Cursor.get_included_file in python bindings
Summary:
adding function: `Cursor.get_included_file` , so the C API's `clang_getIncludedFile` function is available on the python binding interface
also adding test to unittests
related ticket: https://bugs.llvm.org/show_bug.cgi?id=15223
Reviewers: mgorny, arphaman, jbcoe
Reviewed By: jbcoe
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D46383
Patch by jlaz (József Láz)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332045
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Fiselier [Thu, 10 May 2018 19:51:56 +0000 (19:51 +0000)]
[Itanium] Emit type info names with external linkage.
Summary:
The Itanium ABI requires that the type info for pointer-to-incomplete types to have internal linkage, so that it doesn't interfere with the type info once completed. Currently it also marks the type info name as internal as well. However, this causes a bug with the STL implementations, which use the type info name pointer to perform ordering and hashing of type infos.
For example:
```
// header.h
struct T;
extern std::type_info const& Info;
// tu_one.cpp
#include "header.h"
std::type_info const& Info = typeid(T*);
// tu_two.cpp
#include "header.h"
struct T {};
int main() {
auto &TI1 = Info;
auto &TI2 = typeid(T*);
assert(TI1 == TI2); // Fails
assert(TI1.hash_code() == TI2.hash_code()); // Fails
}
```
This patch fixes the STL bug by emitting the type info name as linkonce_odr when the type-info is for a pointer-to-incomplete type.
Note that libc++ could fix this without a compiler change, but the quality of fix would be poor. The library would either have to:
(A) Always perform strcmp/string hashes.
(B) Determine if we have a pointer-to-incomplete type, and only do strcmp then. This would require an ABI break for libc++.
Reviewers: rsmith, rjmccall, majnemer, vsapsai
Reviewed By: rjmccall
Subscribers: smeenai, cfe-commits
Differential Revision: https://reviews.llvm.org/D46665
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332028
91177308-0d34-0410-b5e6-
96231b3b80d8
Julie Hockett [Thu, 10 May 2018 19:05:36 +0000 (19:05 +0000)]
Reland '[clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective'
This commit relands r331904.
Adding a SrcMgr::CharacteristicKind parameter to the InclusionDirective
in PPCallbacks, and updating calls to that function. This will be useful
in https://reviews.llvm.org/D43778 to determine which includes are
system
headers.
Differential Revision: https://reviews.llvm.org/D46614
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332021
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 10 May 2018 18:57:35 +0000 (18:57 +0000)]
Allow dllimport non-type template arguments in C++17
Summary:
Fixes PR35772.
Reviewers: rsmith
Differential Revision: https://reviews.llvm.org/D43320
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332018
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Thu, 10 May 2018 18:32:08 +0000 (18:32 +0000)]
[OPENMP, NVPTX] Initial support for L2 parallelism in SPMD mode.
Added initial support for L2 parallelism in SPMD mode. Note, though,
that the orphaned parallel directives are not currently supported in
SPMD mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332016
91177308-0d34-0410-b5e6-
96231b3b80d8
Strahinja Petrovic [Thu, 10 May 2018 12:31:12 +0000 (12:31 +0000)]
This patch provides that bitfields are splitted even in case
when current field is not legal integer type.
Differential Revision: https://reviews.llvm.org/D39053
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331979
91177308-0d34-0410-b5e6-
96231b3b80d8
Sylvestre Ledru [Thu, 10 May 2018 08:45:43 +0000 (08:45 +0000)]
Add support of the next Ubuntu (Ubuntu 18.10 - Cosmic Canimal)
Patch by Adam Conrad
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331965
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Fiselier [Thu, 10 May 2018 08:10:57 +0000 (08:10 +0000)]
Revert "[Itanium] Emit type info names with external linkage."
This reverts commit r331957. It seems to be causing failures
on ppc64le-linux.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331963
91177308-0d34-0410-b5e6-
96231b3b80d8
Gabor Buella [Thu, 10 May 2018 07:28:54 +0000 (07:28 +0000)]
[X86] ptwrite intrinsic
Reviewers: craig.topper, RKSimon
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D46540
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331962
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 10 May 2018 05:43:43 +0000 (05:43 +0000)]
[X86] Change the implementation of scalar masked load/store intrinsics to not use a 512-bit intermediate vector.
This is unnecessary for AVX512VL supporting CPUs like SKX. We can just emit a 128-bit masked load/store here no matter what. The backend will widen it to 512-bits on KNL CPUs.
Fixes the frontend portion of PR37386. Need to fix the backend to optimize the new sequences well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331958
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Fiselier [Thu, 10 May 2018 05:25:15 +0000 (05:25 +0000)]
[Itanium] Emit type info names with external linkage.
Summary:
The Itanium ABI requires that the type info for pointer-to-incomplete types to have internal linkage, so that it doesn't interfere with the type info once completed. Currently it also marks the type info name as internal as well. However, this causes a bug with the STL implementations, which use the type info name pointer to perform ordering and hashing of type infos.
For example:
```
// header.h
struct T;
extern std::type_info const& Info;
// tu_one.cpp
#include "header.h"
std::type_info const& Info = typeid(T*);
// tu_two.cpp
#include "header.h"
struct T {};
int main() {
auto &TI1 = Info;
auto &TI2 = typeid(T*);
assert(TI1 == TI2); // Fails
assert(TI1.hash_code() == TI2.hash_code()); // Fails
}
```
This patch fixes the STL bug by emitting the type info name as linkonce_odr when the type-info is for a pointer-to-incomplete type.
Note that libc++ could fix this without a compiler change, but the quality of fix would be poor. The library would either have to:
(A) Always perform strcmp/string hashes.
(B) Determine if we have a pointer-to-incomplete type, and only do strcmp then. This would require an ABI break for libc++.
Reviewers: rsmith, rjmccall, majnemer, vsapsai
Reviewed By: rjmccall
Subscribers: smeenai, cfe-commits
Differential Revision: https://reviews.llvm.org/D46665
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331957
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 10 May 2018 00:05:13 +0000 (00:05 +0000)]
[Builtins] Improve the IR emitted for MSVC compatible rotr/rotl builtins to match what the middle and backends understand
Previously we emitted something like
rotl(x, n) {
n &= bitwidth-1;
return n != 0 ? ((x << n) | (x >> (bitwidth - n)) : x;
}
We use a select to avoid the undefined behavior on the (bitwidth - n) shift.
The middle and backend don't really recognize this as a rotate and end up emitting a cmov or control flow because of the select.
A better pattern is (x << (n & mask)) | (x << (-n & mask)) where mask is bitwidth - 1.
Fixes the main complaint in PR37387. There's still some work to be done if the user writes that sequence directly on a short or char where type promotion rules can prevent it from being recognized. The builtin is emitting direct IR with unpromoted types so that isn't a problem for it.
Differential Revision: https://reviews.llvm.org/D46656
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331943
91177308-0d34-0410-b5e6-
96231b3b80d8
Artem Belevich [Wed, 9 May 2018 23:10:09 +0000 (23:10 +0000)]
[CUDA] Added -f[no-]cuda-short-ptr option
The option enables use of 32-bit pointers for accessing
const/local/shared memory. The feature is disabled by default.
Differential Revision: https://reviews.llvm.org/D46148
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331938
91177308-0d34-0410-b5e6-
96231b3b80d8
Julie Hockett [Wed, 9 May 2018 22:25:47 +0000 (22:25 +0000)]
Revert "[clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective"
This reverts commit r331904 because of a memory leak.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331932
91177308-0d34-0410-b5e6-
96231b3b80d8
Manoj Gupta [Wed, 9 May 2018 22:05:53 +0000 (22:05 +0000)]
Update pragma-attribute-supported-attributes-list.test.
Update the test to include the new attribute NoStackProtector
to fix the build fails.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331928
91177308-0d34-0410-b5e6-
96231b3b80d8
Manoj Gupta [Wed, 9 May 2018 21:41:18 +0000 (21:41 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331925
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Liu [Wed, 9 May 2018 21:35:52 +0000 (21:35 +0000)]
Add SourceManagerForFile helper which sets up SourceManager and dependencies for a single file with code snippet
Summary: This can be used to create a virtual environment (incl. VFS, source manager) for code snippets.
Reviewers: sammccall, klimek
Reviewed By: sammccall
Subscribers: klimek, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D46176
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331923
91177308-0d34-0410-b5e6-
96231b3b80d8
Julie Hockett [Wed, 9 May 2018 18:27:33 +0000 (18:27 +0000)]
[clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective
Adding a SrcMgr::CharacteristicKind parameter to the InclusionDirective
in PPCallbacks, and updating calls to that function. This will be useful
in https://reviews.llvm.org/D43778 to determine which includes are system
headers.
Differential Revision: https://reviews.llvm.org/D46614
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331904
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Wed, 9 May 2018 18:02:37 +0000 (18:02 +0000)]
[OPENMP] Generate unique names for offloading regions id.
It is required to emit unique names for offloading regions ids. Required
to support compilation and linking of several compilation units.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331899
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaxun Liu [Wed, 9 May 2018 17:07:06 +0000 (17:07 +0000)]
[OpenCL] Fix typos in emitted enqueue kernel function names
Two typos:
vaarg => vararg
get_kernel_preferred_work_group_multiple => get_kernel_preferred_work_group_size_multiple
Differential Revision: https://reviews.llvm.org/D46601
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331895
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 9 May 2018 16:57:48 +0000 (16:57 +0000)]
[X86] Only enable the __ud2 and __int2c builtins if intrin.h has been included.
Differential Revision: https://reviews.llvm.org/D46332
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331893
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Wed, 9 May 2018 14:15:18 +0000 (14:15 +0000)]
[OPENMP] Mark global tors/dtors as used.
If the global variables are marked as declare target and they need
ctors/dtors, these ctors/dtors are emitted and then invoked by the
offloading runtime library. They are not explicitly used in the emitted
code and thus can be optimized out. Patch marks these functions as used,
so the optimizer cannot remove these function during the optimization
phase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331879
91177308-0d34-0410-b5e6-
96231b3b80d8
Anastasia Stulova [Wed, 9 May 2018 13:23:26 +0000 (13:23 +0000)]
[OpenCL] Add constant address space to __func__ in AST.
Added string literal helper function to obtain the type
attributed by a constant address space.
Also fixed predefind __func__ expr to use the helper
to constract the string literal correctly.
Differential Revision: https://reviews.llvm.org/D46049
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331877
91177308-0d34-0410-b5e6-
96231b3b80d8
Sven van Haastregt [Wed, 9 May 2018 13:16:17 +0000 (13:16 +0000)]
[OpenCL] Restrict various keywords in OpenCL C++ mode
Restrict the following keywords in the OpenCL C++ language mode,
according to Sections 2.2 & 2.9 of the OpenCL C++ 1.0 Specification.
- dynamic_cast
- typeid
- register (already restricted in OpenCL C, update the diagnostic)
- thread_local
- exceptions (try/catch/throw)
- access qualifiers read_only, write_only, read_write
Support the `__global`, `__local`, `__constant`, `__private`, and
`__generic` keywords in OpenCL C++. Leave the unprefixed address
space qualifiers such as global available, i.e., do not mark them as
reserved keywords in OpenCL C++. libclcxx provides explicit address
space pointer classes such as `global_ptr` and `global<T>` that are
implemented using the `__`-prefixed qualifiers.
Differential Revision: https://reviews.llvm.org/D46022
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331874
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Wed, 9 May 2018 12:38:51 +0000 (12:38 +0000)]
Remove unused lit setting, see https://reviews.llvm.org/D46619
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331871
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Wed, 9 May 2018 12:27:21 +0000 (12:27 +0000)]
Fixes issue introduced by r331556.
Closes bug: https://bugs.llvm.org/show_bug.cgi?id=37357
Patch by Rafael Stahl!
Differential revision: https://reviews.llvm.org/D46633
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331870
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 9 May 2018 09:29:58 +0000 (09:29 +0000)]
Revert r331843 "[DebugInfo] Generate debug information for labels."
It broke the Chromium build (see reply on the review).
> Generate DILabel metadata and call llvm.dbg.label after label
> statement to associate the metadata with the label.
>
> Differential Revision: https://reviews.llvm.org/D45045
>
> Patch by Hsiangkai Wang.
This doesn't revert the change to backend-unsupported-error.ll
that seems to correspond to an llvm-side change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331861
91177308-0d34-0410-b5e6-
96231b3b80d8
Martin Storsjo [Wed, 9 May 2018 09:11:01 +0000 (09:11 +0000)]
Revert "[Driver] Use -fuse-line-directives by default in MSVC mode"
This reverts commit SVN r331666.
It was afterwards pointed out in https://reviews.llvm.org/D46520
that #line directives lose information about what parts come from a
system header. That means the result of -E usually won't compile,
since Windows headers are typically full of warnings and
default-error warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331858
91177308-0d34-0410-b5e6-
96231b3b80d8
Krasimir Georgiev [Wed, 9 May 2018 09:02:11 +0000 (09:02 +0000)]
[clang-format] Respect BreakBeforeClosingBrace while calculating length
Summary:
This patch makes `getLengthToMatchingParen` respect the `BreakBeforeClosingBrace`
ParenState for matching scope closers. In order to distinguish between paren states
introduced by real vs. fake parens, I've added the token opening the ParensState
to that struct.
Reviewers: djasper
Reviewed By: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D46519
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331857
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Wed, 9 May 2018 08:42:30 +0000 (08:42 +0000)]
[driver] Add mips_Features_Group to Options to improve documentation sorting
Move all of the MIPS-only options into a new m_mips_Features_Group.
Nearly all other targets have most target-specific options grouped,
but MIPS does not.
The primary benefits are that the options will be listed together (and
thus identifiable as MIPS-specific even if they have no help string) in
the ClangCommandLineReference, and that Options.td is a bit more organized.
A secondary benefit is that a custom version of clang can more easily
hide/disable groups of options for unsupported targets.
Patch by Vince Del Vecchio
Differential Revision: https://reviews.llvm.org/D46450
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331856
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Wed, 9 May 2018 03:51:12 +0000 (03:51 +0000)]
_Atomic of empty struct shouldn't assert
Summary:
An _Atomic of an empty struct is pretty silly. In general we just widen empty
structs to hold a byte's worth of storage, and we represent size and alignment
as 0 internally and let LLVM figure out what to do. For _Atomic it's a bit
different: the memory model mandates concrete effects occur when atomic
operations occur, so in most cases actual instructions need to get emitted. It's
really not worth trying to optimize empty struct atomics by figuring out e.g.
that a fence would do, even though sane compilers should do optimize atomics.
Further, wg21.link/p0528 will fix C++20 atomics with padding bits so that
cmpxchg on them works, which means that we'll likely need to do the zero-init
song and dance for empty atomic structs anyways (and I think we shouldn't
special-case this behavior to C++20 because prior standards are just broken).
This patch therefore makes a minor change to r176658 "Promote atomic type sizes
up to a power of two": if the width of the atomic's value type is 0, just use 1
byte for width and leave alignment as-is (since it should never be zero, and
over-aligned zero-width structs are weird but fine).
This fixes an assertion:
(NumBits >= MIN_INT_BITS && "bitwidth too small"), function get, file ../lib/IR/Type.cpp, line 241.
It seems like this has run into other assertions before (namely the unreachable
Kind check in ImpCastExprToType), but I haven't reproduced that issue with
tip-of-tree.
<rdar://problem/
39678063>
Reviewers: arphaman, rjmccall
Subscribers: aheejin, cfe-commits
Differential Revision: https://reviews.llvm.org/D46613
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331845
91177308-0d34-0410-b5e6-
96231b3b80d8
Shiva Chen [Wed, 9 May 2018 02:41:56 +0000 (02:41 +0000)]
[DebugInfo] Generate debug information for labels.
Generate DILabel metadata and call llvm.dbg.label after label
statement to associate the metadata with the label.
Differential Revision: https://reviews.llvm.org/D45045
Patch by Hsiangkai Wang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331843
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 9 May 2018 01:00:01 +0000 (01:00 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331834
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Wed, 9 May 2018 00:58:12 +0000 (00:58 +0000)]
Set CMAKE_BUILD_WITH_INSTALL_RPATH for Fuchsia runtimes
This doesn't make any difference since we don't use RPATH/RUNPATH
on Fuchsia but it avoids the CMake error when re-linking libraries
while building with Ninja.
Differntial Revision: https://reviews.llvm.org/D46610
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331833
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Wed, 9 May 2018 00:05:28 +0000 (00:05 +0000)]
[CMake] Include llvm-strip in Fuchsia toolchain distribution
Now that llvm-strip is available, include it in the Fuchsia toolchain.
Differential Revision: https://reviews.llvm.org/D46612
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331826
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 8 May 2018 22:01:43 +0000 (22:01 +0000)]
[X86] Mark builtins 'const' where possible
I attempted to go through all the builtins and marked them const if they didn't touch memory or other hidden state.
I don't know how to test this or if it really matters.
Differential Revision: https://reviews.llvm.org/D46349
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331814
91177308-0d34-0410-b5e6-
96231b3b80d8
Erich Keane [Tue, 8 May 2018 21:26:21 +0000 (21:26 +0000)]
Fix float->int conversion warnings when near barriers.
As Eli brought up here: https://reviews.llvm.org/D46535
I'd previously messed up this fix by missing conversions
that are just slightly outside the range. This patch fixes
this by no longer ignoring the return value of
convertToInteger. Additionally, one of the error messages
wasn't very sensical (mentioning out of range value, when it
really was not), so it was cleaned up as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331812
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaxun Liu [Tue, 8 May 2018 21:02:12 +0000 (21:02 +0000)]
[HIP] Add hip offload kind
There are quite differences in HIP action builder and action job creation,
which justifies to define a separate offload kind.
Differential Revision: https://reviews.llvm.org/D46471
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331811
91177308-0d34-0410-b5e6-
96231b3b80d8
Jessica Paquette [Tue, 8 May 2018 20:58:32 +0000 (20:58 +0000)]
Add a mno-outline flag to disable the MachineOutliner
Since we're working on turning the MachineOutliner by default under -Oz for
AArch64, it makes sense to have an -mno-outline flag available. This currently
doesn't do much (it basically just undoes -moutline).
When the MachineOutliner is on by default under AArch64, this flag should
set -mllvm -enable-machine-outliner=never.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331810
91177308-0d34-0410-b5e6-
96231b3b80d8
Martin Storsjo [Tue, 8 May 2018 20:55:23 +0000 (20:55 +0000)]
[Driver] Don't add -dwarf-column-info when using -gcodeview on non-msvc targets
-dwarf-column-info is omitted if -gcodeview is specified for msvc
targets at the moment, but since -gcodeview is an option that can be
specified for any target, there's little reason to restrict this
handling to msvc targets.
This allows getting proper codeview debug info by passing -gcodeview
for e.g. MinGW targets as well.
Differential Revision: https://reviews.llvm.org/D46287
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331807
91177308-0d34-0410-b5e6-
96231b3b80d8
Jessica Paquette [Tue, 8 May 2018 20:53:19 +0000 (20:53 +0000)]
Change -foutline to -moutline
Nitpicky, but the MachineOutliner is a machine-level pass, and so we should
reflect that by using "m" instead of "n".
Figured we should get this in before people get used to the letter f. :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331806
91177308-0d34-0410-b5e6-
96231b3b80d8
Stephane Sezer [Tue, 8 May 2018 19:46:29 +0000 (19:46 +0000)]
Add missing newlines to cl::extrahelp uses
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331802
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Tue, 8 May 2018 18:20:10 +0000 (18:20 +0000)]
[lit] Fix running tests that require 'examples'.
Differential Revision: https://reviews.llvm.org/D46514
Patch by Nikolai Kosjar.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331786
91177308-0d34-0410-b5e6-
96231b3b80d8