]> granicus.if.org Git - clang/log
clang
4 years ago[clang-rename] Fix a crash when renaming a class without definition.
Haojian Wu [Fri, 4 Oct 2019 14:09:31 +0000 (14:09 +0000)]
[clang-rename] Fix a crash when renaming a class without definition.

Reviewers: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68459

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373748 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[clang-format] [PR42417] clang-format inserts a space after '->' for operator->(...
Paul Hoad [Fri, 4 Oct 2019 13:24:15 +0000 (13:24 +0000)]
[clang-format] [PR42417] clang-format inserts a space after '->' for operator->() overloading

Summary:
https://bugs.llvm.org/show_bug.cgi?id=42417

This revision removes the extra space between the opertor-> and the parens ()

```
class Bug {
    auto operator-> () -> int*;
    auto operator++(int) -> int;
};
```

Reviewers: klimek, owenpan, byoungyoung, mitchell-stellar

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D68242

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373746 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[clang] Prevent false positives in arm-mfpu-none codegen test.
Simon Tatham [Fri, 4 Oct 2019 13:01:41 +0000 (13:01 +0000)]
[clang] Prevent false positives in arm-mfpu-none codegen test.

A user pointed out to me in private email that this test will fail if
it sees the letter 's' followed by a digit in any part of clang's
assembly output after the function label. That includes the .ident at
the end, which can include a full pathname or hostname or both from
the system clang was built on. So if that path or hostname includes
any text like 's5' then it will cause the test to fail.

Fixed by adding a check for `.fnend`, to limit the scope of the
`CHECK-NOT` to only the actual generated code for the test function.

(Committed without prior review on the basis that it's a simple and
obvious pure test-suite fix and also in a test I contributed myself.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373744 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[NFCI] Improve the -Wbool-operation's warning message
David Bolvansky [Fri, 4 Oct 2019 12:55:13 +0000 (12:55 +0000)]
[NFCI] Improve the -Wbool-operation's warning message

Based on the request from the post commit review. Also added one new test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373743 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[Format] Fix docs after r373439
Sam McCall [Fri, 4 Oct 2019 09:52:54 +0000 (09:52 +0000)]
[Format] Fix docs after r373439

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373724 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[Driver] NFC: Remove duplicate call to getLibGccType
Cullen Rhodes [Fri, 4 Oct 2019 08:26:37 +0000 (08:26 +0000)]
[Driver] NFC: Remove duplicate call to getLibGccType

Reviewed By: saugustine

Differential Revision: https://reviews.llvm.org/D68380

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373712 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[lldb][modern-type-lookup] No longer import temporary declarations into the persisten...
Raphael Isemann [Fri, 4 Oct 2019 08:26:17 +0000 (08:26 +0000)]
[lldb][modern-type-lookup] No longer import temporary declarations into the persistent AST

Summary:
As we figured out in D67803, importing declarations from a temporary ASTContext that were originally from a persistent ASTContext
causes a bunch of duplicated declarations where we end up having declarations in the target AST that have no associated ASTImporter that
can complete them.

I haven't figured out how/if we can solve this in the current way we do things in LLDB, but in the modern-type-lookup this is solvable
as we have a saner architecture with the ExternalASTMerger. As we can (hopefully) make modern-type-lookup the default mode in the future,
I would say we try fixing this issue here. As we don't use the hack that was reinstated in D67803 during modern-type-lookup, the test case for this
is essentially just printing any kind of container in `std::` as we would otherwise run into the issue that required a hack like D67803.

What this patch is doing in essence is that instead of importing a declaration from a temporary ASTContext, we instead check if the
declaration originally came from a persistent ASTContext (e.g. the debug information) and we directly import from there. The ExternalASTMerger
is already connected with ASTImporters to these different sources, so this patch is essentially just two parts:
1. Mark our temporary ASTContext/ImporterSource as temporary when we import from the expression AST.
2. If the ExternalASTMerger sees we import from the expression AST, instead of trying to import these temporary declarations, check if we
can instead import from the persistent ASTContext that is already connected. This ensures that all records from the persistent source actually
come from the persistent source and are minimally imported in a way that allows them to be completed later on in the target AST.

The next step is to run the ASTImporter for these temporary expressions with the MinimalImport mode disabled, but that's a follow up patch.

This patch fixes most test failures with modern-type-lookup enabled by default (down to 73 failing tests, which includes the 22 import-std-module tests
which need special treatment).

Reviewers: shafik, martong

Reviewed By: martong

Subscribers: aprantl, rnkovacs, christof, abidh, JDevlieghere, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D68326

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373711 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[CodeComplete] Ensure object is the same in compareOverloads()
Ilya Biryukov [Fri, 4 Oct 2019 08:10:27 +0000 (08:10 +0000)]
[CodeComplete] Ensure object is the same in compareOverloads()

Summary:
This fixes a regression that led to size() not being available in clangd
when completing 'deque().^' and using libc++.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68335

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373710 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[clang-format] [PR43338] C# clang format has space issues betweern C# only keywords
Paul Hoad [Fri, 4 Oct 2019 08:10:22 +0000 (08:10 +0000)]
[clang-format] [PR43338] C# clang format has space issues betweern C# only keywords

Summary:
When formatting C# there can be issues with a lack of spaces between `using (` , `foreach (` and generic types

The C# code

```
public class Foo
{
    Dictionary<string,string> foo;
}

```
will be formatted as

```
public class Foo
{
    Dictionary<string, string>foo;
                           ^^^^^   missing a space
}
```

This revision also reverts some of {D66662} in order to make this cleaner and resolve an issues seen by @owenpan that the formatting didn't add a space when not in a code block

This also transforms C# foreach commands to be seen as tok::kw_for commands (to ensure foreach gets the same Brace Wrapping behavior as for without littering the code with `if(Style.isCSharp())`

Reviewers: owenpan, klimek, russellmcc, mitchell-stellar

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D67660

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373709 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[clang-format] [PR43333] Fix C# breaking before function name when using Attributes
Paul Hoad [Fri, 4 Oct 2019 07:56:49 +0000 (07:56 +0000)]
[clang-format] [PR43333] Fix C# breaking before function name when using Attributes

Summary:
This is  a fix for https://bugs.llvm.org/show_bug.cgi?id=43333

This comes with 3 main parts

  - C# attributes cause function names on a new line even when AlwaysBreakAfterReturnType is set to None
  - Add AlwaysBreakAfterReturnType  to None by default in the Microsoft style,
  - C# unit tests are not using Microsoft style (which we created to define the default C# style to match a vanilla C# project).

Reviewers: owenpan, klimek, russellmcc, mitchell-stellar

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang-tools-extra, #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D67629

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373707 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[clang] [cmake] Add distribution install targets for remaining components
Michal Gorny [Fri, 4 Oct 2019 05:43:20 +0000 (05:43 +0000)]
[clang] [cmake] Add distribution install targets for remaining components

Add install targets as necessary to install bash-autocomplete,
scan-build and scan-view via LLVM_DISTRIBUTION_TARGETS.

Differential Revision: https://reviews.llvm.org/D68413

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373695 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoProperly handle instantiation-dependent array bounds.
Richard Smith [Fri, 4 Oct 2019 01:25:59 +0000 (01:25 +0000)]
Properly handle instantiation-dependent array bounds.

We previously failed to treat an array with an instantiation-dependent
but not value-dependent bound as being an instantiation-dependent type.
We now track the array bound expression as part of a constant array type
if it's an instantiation-dependent expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373685 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[OPENMP]Fix the test on Windows, NFC.
Alexey Bataev [Thu, 3 Oct 2019 22:10:33 +0000 (22:10 +0000)]
[OPENMP]Fix the test on Windows, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373672 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoASTContext - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Thu, 3 Oct 2019 21:47:42 +0000 (21:47 +0000)]
ASTContext - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us.

We can also remove a number of explicit asserts and reply on the internal asserts in castAs<>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373667 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoOverloadCandidate::getNumParams - silence static analyzer getAs<FunctionProtoType...
Simon Pilgrim [Thu, 3 Oct 2019 21:27:02 +0000 (21:27 +0000)]
OverloadCandidate::getNumParams - silence static analyzer getAs<FunctionProtoType> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use castAs<FunctionProtoType> directly and if not assert will fire for us.

Also replaces an auto to make the type more obvious.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373665 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[OPENMP50]Codegen support for scores in context selectors.
Alexey Bataev [Thu, 3 Oct 2019 20:49:48 +0000 (20:49 +0000)]
[OPENMP50]Codegen support for scores in context selectors.

If the context selector has associated score and several contexts
selectors matches current context, the function with the highest score
must be selected.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373661 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[HIP] Use option -nogpulib to disable linking device lib
Yaxun Liu [Thu, 3 Oct 2019 18:59:56 +0000 (18:59 +0000)]
[HIP] Use option -nogpulib to disable linking device lib

Differential Revision: https://reviews.llvm.org/D68300

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373649 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoCheck for qualified function types after substituting into the operand
Richard Smith [Thu, 3 Oct 2019 18:55:23 +0000 (18:55 +0000)]
Check for qualified function types after substituting into the operand
of 'typeid'.

This is a rare place where it's valid for a function type to be
substituted but not valid for a qualified function type to be
substituted, so needs a special check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373648 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[clang-format] Add ability to wrap braces after multi-line control statements
Paul Hoad [Thu, 3 Oct 2019 18:42:31 +0000 (18:42 +0000)]
[clang-format] Add ability to wrap braces after multi-line control statements

Summary:
Change the BraceWrappingFlags' AfterControlStatement from a bool to an enum with three values:

* "Never": This is the default, and does not do any brace wrapping after control statements.
* "MultiLine": This only wraps braces after multi-line control statements (this really only happens when a ColumnLimit is specified).
* "Always": This always wraps braces after control statements.

The first and last options are backwards-compatible with "false" and "true", respectively.

The new "MultiLine" option is useful for when a wrapped control statement's indentation matches the subsequent block's indentation. It makes it easier to see at a glance where the control statement ends and where the block's code begins. For example:

```
if (
  foo
  && bar )
{
  baz();
}
```

vs.

```
if (
  foo
  && bar ) {
  baz();
}
```

Short control statements (1 line) do not wrap the brace to the next line, e.g.

```
if (foo) {
  bar();
} else {
  baz();
}
```

Reviewers: sammccall, owenpan, reuk, MyDeveloperDay, klimek

Reviewed By: MyDeveloperDay

Subscribers: MyDeveloperDay, cfe-commits

Patch By: mitchell-stellar

Tags: #clang-format, #clang, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D68296

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373647 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoPR43547: substitute into the type of a non-type template parameter if
Richard Smith [Thu, 3 Oct 2019 18:24:40 +0000 (18:24 +0000)]
PR43547: substitute into the type of a non-type template parameter if
it's instantiation-dependent, even if it's not dependent.

There might be a SFINAE check in the parameter type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373643 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[HIP] Enable specifying different default gpu arch for HIP/CUDA.
Michael Liao [Thu, 3 Oct 2019 17:49:20 +0000 (17:49 +0000)]
[HIP] Enable specifying different default gpu arch for HIP/CUDA.

Reviewers: tra, yaxunl

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68394

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373634 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoDeclBase/DeclCXX/DeclTemplate - silence static analyzer getAs<> null dereference...
Simon Pilgrim [Thu, 3 Oct 2019 16:58:01 +0000 (16:58 +0000)]
DeclBase/DeclCXX/DeclTemplate - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373626 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[OPENMP]Fix emission of the declare target variables in device mode.
Alexey Bataev [Thu, 3 Oct 2019 16:46:49 +0000 (16:46 +0000)]
[OPENMP]Fix emission of the declare target variables in device mode.

Declare target variables must be emitted in device mode, target triples
can be empty in this case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373624 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[OPENMP]Improve diagnostics for not found declare target entries.
Alexey Bataev [Thu, 3 Oct 2019 16:20:34 +0000 (16:20 +0000)]
[OPENMP]Improve diagnostics for not found declare target entries.

We can point to the target region + emit parent functions names/real var
names if they were not found in host module during device codegen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373620 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[NFC] Added missing changes for rL373614
David Bolvansky [Thu, 3 Oct 2019 15:26:26 +0000 (15:26 +0000)]
[NFC] Added missing changes for rL373614

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373616 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[Diagnostics] Bitwise negation of a boolean expr always evaluates to true; warn with...
David Bolvansky [Thu, 3 Oct 2019 15:17:59 +0000 (15:17 +0000)]
[Diagnostics] Bitwise negation of a boolean expr always evaluates to true; warn with -Wbool-operation

Requested here:
http://lists.llvm.org/pipermail/cfe-dev/2019-October/063452.html

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373614 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoFix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.
Simon Pilgrim [Thu, 3 Oct 2019 15:10:47 +0000 (15:10 +0000)]
Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373613 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoExprConstant - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Thu, 3 Oct 2019 15:08:30 +0000 (15:08 +0000)]
ExprConstant - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373612 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoRemove duplicate P->getAs<PointerType>() call. NFCI.
Simon Pilgrim [Thu, 3 Oct 2019 15:08:20 +0000 (15:08 +0000)]
Remove duplicate P->getAs<PointerType>() call. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373611 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[Alignment][NFC] Remove StoreInst::setAlignment(unsigned)
Guillaume Chatelet [Thu, 3 Oct 2019 13:17:21 +0000 (13:17 +0000)]
[Alignment][NFC] Remove StoreInst::setAlignment(unsigned)

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet, bollu, jdoerfert

Subscribers: hiraditya, asbirlea, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D68268

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373595 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[libTooling] Add various Stencil combinators for expressions.
Yitzhak Mandelbaum [Thu, 3 Oct 2019 13:01:00 +0000 (13:01 +0000)]
[libTooling] Add various Stencil combinators for expressions.

Summary:
This revision adds three new Stencil combinators:
* `expression`, which idiomatically constructs the source for an expression,
  including wrapping the expression's source in parentheses if needed.
* `deref`, which constructs an idiomatic dereferencing expression.
* `addressOf`, which constructs an idiomatic address-taking expression.

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68315

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373593 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[Alignment][Clang][NFC] Add CharUnits::getAsAlign
Guillaume Chatelet [Thu, 3 Oct 2019 13:00:29 +0000 (13:00 +0000)]
[Alignment][Clang][NFC] Add CharUnits::getAsAlign

Summary:
This is a prerequisite to removing `llvm::GlobalObject::setAlignment(unsigned)`.
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: jholewinski, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68274

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373592 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoSilence static analyzer getAs<RecordType> null dereference warnings. NFCI.
Simon Pilgrim [Thu, 3 Oct 2019 11:22:48 +0000 (11:22 +0000)]
Silence static analyzer getAs<RecordType> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<RecordType> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373584 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[clang][NFC] Fix misspellings in ExternalASTMerger.h
Raphael Isemann [Thu, 3 Oct 2019 09:55:13 +0000 (09:55 +0000)]
[clang][NFC] Fix misspellings in ExternalASTMerger.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373577 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoFix driver tests when `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` is `ON`
Serge Pavlov [Thu, 3 Oct 2019 04:52:46 +0000 (04:52 +0000)]
Fix driver tests when `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` is `ON`

Some Driver tests relied on the default resource direcory having per-os per-arch
subdirectory layout, and when clang is built with `-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON`,
those test fail, because clang by default assumes per-target subdirectories.

Explicitly set `-resource-dir` flag to point to a tree with per-os per-arch layout.

See also: D45604, D62469

Differential Revision: https://reviews.llvm.org/D66981

Patch by Sergej Jaskiewicz <jaskiewiczs@icloud.com>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373565 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[HIP] Support -emit-llvm for device compilation
Yaxun Liu [Thu, 3 Oct 2019 03:27:43 +0000 (03:27 +0000)]
[HIP] Support -emit-llvm for device compilation

Sometimes it is useful to compile HIP device code to LLVM BC. It is not convenient to use clang -cc1 since
there are lots of options needed.

This patch allows clang driver to compile HIP device code to LLVM BC with -emit-llvm -c.

Differential Revision: https://reviews.llvm.org/D68284

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373561 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoRevert 373538 and follow-ups 373549 and 373552.
Nico Weber [Thu, 3 Oct 2019 02:38:43 +0000 (02:38 +0000)]
Revert 373538 and follow-ups 373549 and 373552.

They break tests on (at least) macOS.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373556 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoPR43519: don't inject a diagnostic when constant-evaulation of a
Richard Smith [Thu, 3 Oct 2019 01:20:27 +0000 (01:20 +0000)]
PR43519: don't inject a diagnostic when constant-evaulation of a
pointer-to-member call can't determine a callee.

We will have produced a diagnostic already if the callee is known to be
unevaluatable, and diagnosing here rejects valid code during potential
constant expression checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373553 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoFixing broken builds due to r373538, issues with filepath and hexagon toolchain.
Puyan Lotfi [Thu, 3 Oct 2019 01:19:51 +0000 (01:19 +0000)]
Fixing broken builds due to r373538, issues with filepath and hexagon toolchain.

It appears there are some issues with the hexagon toolchain, and also the file
path for the library file. If this doesn't fix the remaining breakages I will
attempt a revert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373552 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoFixing broken builds due to r373538 due to test that should have been deleted.
Puyan Lotfi [Thu, 3 Oct 2019 00:41:13 +0000 (00:41 +0000)]
Fixing broken builds due to r373538 due to test that should have been deleted.

test/InterfaceStubs/object.cpp should have been deleted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373549 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMark P0784R7 as complete and start defining its feature-test macro.
Richard Smith [Thu, 3 Oct 2019 00:39:37 +0000 (00:39 +0000)]
Mark P0784R7 as complete and start defining its feature-test macro.

Note that this only covers the language side of this feature. (The
library side has its own feature test macro.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373548 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoFor P0784R7: support placement new-expressions in constant evaluation.
Richard Smith [Thu, 3 Oct 2019 00:39:35 +0000 (00:39 +0000)]
For P0784R7: support placement new-expressions in constant evaluation.

For now, we restrict this support to use from within the standard
library implementation, since we're required to make parts of the
standard library that use placement new work, but not permitted to
make uses of placement new from user code work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373547 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoFor P0784R7: allow direct calls to operator new / operator delete from
Richard Smith [Thu, 3 Oct 2019 00:39:33 +0000 (00:39 +0000)]
For P0784R7: allow direct calls to operator new / operator delete from
std::allocator::{allocate,deallocate} in constant evaluation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373546 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[clang][ifs] Clang Interface Stubs ToolChain plumbing.
Puyan Lotfi [Wed, 2 Oct 2019 22:50:07 +0000 (22:50 +0000)]
[clang][ifs] Clang Interface Stubs ToolChain plumbing.

This patch enables end to end support for generating ELF interface stubs
directly from clang. Now the following:

clang -emit-interface-stubs -o libfoo.so a.cpp b.cpp c.cpp

will product an ELF binary with visible symbols populated. Visibility attributes
and -fvisibility can be used to control what gets populated.

* Adding ToolChain support for clang Driver IFS Merge Phase
* Implementing a default InterfaceStubs Merge clang Tool, used by ToolChain
* Adds support for the clang Driver to involve llvm-ifs on ifs files.
* Adds -emit-merged-ifs flag, to tell llvm-ifs to emit a merged ifs text file
  instead of the final object format (normally ELF)

Differential Revision: https://reviews.llvm.org/D63978

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373538 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoFix uninitialized variable warning in CodeGenPGO constructor. NFCI.
Simon Pilgrim [Wed, 2 Oct 2019 21:05:21 +0000 (21:05 +0000)]
Fix uninitialized variable warning in CodeGenPGO constructor. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373526 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoItaniumCXXABI - silence static analyzer getAs<RecordType> null dereference warnings...
Simon Pilgrim [Wed, 2 Oct 2019 20:45:16 +0000 (20:45 +0000)]
ItaniumCXXABI - silence static analyzer getAs<RecordType> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but we should be able to use castAs<RecordType> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373525 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[Clang][Driver][NFC] Corrected DeviceActionBuilder methods' comments.
Sergey Dmitriev [Wed, 2 Oct 2019 20:44:45 +0000 (20:44 +0000)]
[Clang][Driver][NFC] Corrected DeviceActionBuilder methods' comments.

Differential Revision: https://reviews.llvm.org/D68355

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373523 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoCGObjCMac - silence static analyzer dyn_cast<>/getAs<> null dereference warnings...
Simon Pilgrim [Wed, 2 Oct 2019 20:30:37 +0000 (20:30 +0000)]
CGObjCMac - silence static analyzer dyn_cast<>/getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but we should be able to use cast<>/castAs<> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373520 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[Stencil] Hide implementaion detai. NFC.
Benjamin Kramer [Wed, 2 Oct 2019 18:33:44 +0000 (18:33 +0000)]
[Stencil] Hide implementaion detai. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373504 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[OPENMP50]Add parsing/sema analysis for declare variant score.
Alexey Bataev [Wed, 2 Oct 2019 18:19:02 +0000 (18:19 +0000)]
[OPENMP50]Add parsing/sema analysis for declare variant score.

Context selectors may include optional score clause in format
`score(<expr>):`, where `<expr>` must be a constant integer expression.
Added parsing/sema analysis only.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373502 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoType - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Wed, 2 Oct 2019 16:03:36 +0000 (16:03 +0000)]
Type - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373480 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoSilence static analyzer getAs<VectorType> null dereference warnings. NFCI.
Simon Pilgrim [Wed, 2 Oct 2019 15:31:25 +0000 (15:31 +0000)]
Silence static analyzer getAs<VectorType> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<VectorType> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373478 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoSemaOverload - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Wed, 2 Oct 2019 14:02:27 +0000 (14:02 +0000)]
SemaOverload - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373475 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoSemaInit - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Wed, 2 Oct 2019 14:02:18 +0000 (14:02 +0000)]
SemaInit - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373474 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoLog2_32 returns an unsigned. NFCI.
Simon Pilgrim [Wed, 2 Oct 2019 11:49:32 +0000 (11:49 +0000)]
Log2_32 returns an unsigned. NFCI.

Silences clang static analyzer warning about out of bounds (negative) shifts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373451 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoASTContext - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Wed, 2 Oct 2019 11:48:06 +0000 (11:48 +0000)]
ASTContext - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373447 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[ClangFormat] relnotes for r373439
Sam McCall [Wed, 2 Oct 2019 09:52:52 +0000 (09:52 +0000)]
[ClangFormat] relnotes for r373439

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373441 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[clang-rename] Better renaming the typedef decl.
Haojian Wu [Wed, 2 Oct 2019 09:50:46 +0000 (09:50 +0000)]
[clang-rename] Better renaming the typedef decl.

Summary:
when renaming a typedef decl, we used to rename the underlying decl of the
typedef, we should rename the typedef itself.

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68322

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373440 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[ClangFormat] Future-proof Standard option, allow floating or pinning to arbitrary...
Sam McCall [Wed, 2 Oct 2019 09:50:40 +0000 (09:50 +0000)]
[ClangFormat] Future-proof Standard option, allow floating or pinning to arbitrary lang version

Summary:
The historical context:
- clang-format was written when C++11 was current,
  and the main language-version concern was >> vs > > template-closers.
  An option was added to allow selection of the 03/11 behavior, or auto-detection.
- there was no option to choose simply "latest standard" so anyone who didn't
  ever want 03 behavior or auto-detection specified Cpp11.
- In r185149 this option started to affect lexer mode.
- no options were added to cover c++14, as parsing/formatting
  didn't change that much. The usage of Cpp11 to mean "latest" became
  codified e.g. in r206263
- c++17 added some new constructs. These were mostly backwards-compatible and so
  not used in old programs, so having no way to turn them off was OK.
- c++20 added some new constructs and keywords (e.g. co_*) that changed the
  meaning of existing programs, and people started to complain that
  the c++20 parsing couldn't be turned off.

New plan:
 - Default ('Auto') behavior remains unchanged: parse as latest, format
   template-closers based on input.
 - Add new 'Latest' option that more clearly expresses the intent "use
   modern features" that many projects have chosen for their .clang-format files.
 - Allow pinning to *any* language version, using the same name as clang -std:
   c++03, c++11, c++14 etc. These set precise lexer options, and any
   clang-format code depending on these can use a >= check.
 - For backwards compatibility, `Cpp11` is an alias for `Latest`, not `c++11`.
   This matches the historical documented semantics of this option.
   This spelling (and `Cpp03`) are deprecated.

Reviewers: klimek, modocache

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67541

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373439 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoRename TypeNodes.def to TypeNodes.inc for consistency across all
John McCall [Wed, 2 Oct 2019 06:35:23 +0000 (06:35 +0000)]
Rename TypeNodes.def to TypeNodes.inc for consistency across all
our autogenerated files.  NFC.

As requested by Nico Weber.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373425 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoRevert r368237 - Update fix-it hints for std::move warnings.
Richard Trieu [Wed, 2 Oct 2019 02:32:15 +0000 (02:32 +0000)]
Revert r368237 - Update fix-it hints for std::move warnings.

r368237 attempted to improve fix-its for move warnings, but introduced some
regressions to -Wpessimizing-move.  Revert that change and add the missing
test cases to the pessimizing move test to prevent future regressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373421 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoFix crash on constant-evaluation of pseudo-destruction of a pointer.
Richard Smith [Wed, 2 Oct 2019 01:13:57 +0000 (01:13 +0000)]
Fix crash on constant-evaluation of pseudo-destruction of a pointer.

We got confused and thought we might be pseudo-destroying the pointee
instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373418 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoRemove TypeNodes.def from the modulemap.
John McCall [Wed, 2 Oct 2019 01:02:27 +0000 (01:02 +0000)]
Remove TypeNodes.def from the modulemap.

We currently just look for files named in the modulemap in its
associated source directory.  This means that we can't name
generated files, like TypeNodes.def now is, which means we can't
explicitly mark it as textual.  But fortunately that's okay
because (as I understand it) the most important purpose of naming
the header in the modulemap is to ensure that it's not treated as
public, and the search for public headers also only considers
files in the associated source directory.  This isn't an elegant
solution, since among other things it means that a build which
wrote the generated files directly into the source directory would
result in something that wouldn't build as a module, but that's
a problem for all our other generated files as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373416 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoFix unused variable warning. NFCI.
Michael Liao [Wed, 2 Oct 2019 00:22:45 +0000 (00:22 +0000)]
Fix unused variable warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373410 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoEmit TypeNodes.def with tblgen.
John McCall [Tue, 1 Oct 2019 23:13:03 +0000 (23:13 +0000)]
Emit TypeNodes.def with tblgen.

The primary goal here is to make the type node hierarchy available to
other tblgen backends, although it should also make it easier to generate
more selective x-macros in the future.

Because tblgen doesn't seem to allow backends to preserve the source
order of defs, this is not NFC because it significantly re-orders IDs.
I've fixed the one (fortunately obvious) place where we relied on
the old order.  Unfortunately, I wasn't able to share code with the
existing AST-node x-macro generators because the x-macro schema we use
for types is different in a number of ways.  The main loss is that
subclasses aren't ordered together, which doesn't seem important for
types because the hierarchy is generally very shallow with little
clustering.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373407 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoUse scope qualifiers in Clang's tblgen backends to get useful
John McCall [Tue, 1 Oct 2019 23:12:57 +0000 (23:12 +0000)]
Use scope qualifiers in Clang's tblgen backends to get useful
redeclaration checking.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373406 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[clang][OpenMP][NFC] #include GlobalDecl.h to avoid incomplete class type
Jordan Rupprecht [Tue, 1 Oct 2019 22:30:10 +0000 (22:30 +0000)]
[clang][OpenMP][NFC] #include GlobalDecl.h to avoid incomplete class type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373400 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoCGVTables - silence static analyzer getAs<FunctionProtoType> null dereference warning...
Simon Pilgrim [Tue, 1 Oct 2019 22:02:46 +0000 (22:02 +0000)]
CGVTables - silence static analyzer getAs<FunctionProtoType> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but we should be able to use castAs<FunctionProtoType> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373398 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoCGExprAgg - remove duplicate code. NFCI.
Simon Pilgrim [Tue, 1 Oct 2019 21:50:30 +0000 (21:50 +0000)]
CGExprAgg - remove duplicate code. NFCI.

Remove duplicate getAs<> call, avoiding a clang static analyzer null dereference warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373396 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[clang-format] [PR43372] - clang-format shows replacements in DOS files when no repla...
Paul Hoad [Tue, 1 Oct 2019 20:20:22 +0000 (20:20 +0000)]
[clang-format] [PR43372] - clang-format shows replacements in DOS files when no replacement is needed

Summary:
This is a patch to fix PR43372 (https://bugs.llvm.org/show_bug.cgi?id=43372) - clang-format can't format file with includes, ( which really keep providing replacements for already sorted headers.)

A similar issue was addressed by @krasimir in {D60199}, however, this seemingly only prevented the issue when the files being formatted did not contain windows line endings (\r\n)

It's possible this is related to https://twitter.com/StephanTLavavej/status/1176722938243895296 given who @STL_MSFT  works for!

As people often used the existence of replacements to determine if a file needs clang-formatting, this is probably pretty important for windows users

There may be a better way of comparing 2 strings and ignoring \r (which appear in both Results and Code), I couldn't choose between this idiom or the copy_if approach, but I'm happy to change it to whatever people consider more performant.

Reviewers: krasimir, klimek, owenpan, ioeric

Reviewed By: krasimir

Subscribers: cfe-commits, STL_MSFT, krasimir

Tags: #clang-format, #clang, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D68227

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373388 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[OPENMP50]Initial codegen for declare variant implementation vendor.
Alexey Bataev [Tue, 1 Oct 2019 20:18:32 +0000 (20:18 +0000)]
[OPENMP50]Initial codegen for declare variant implementation vendor.

Initial implementation of global aliases emission for the declare
variant pragma with implementation vendor context selector set.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373387 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[NFC] Updated tests after rL373371
David Bolvansky [Tue, 1 Oct 2019 18:18:45 +0000 (18:18 +0000)]
[NFC] Updated tests after rL373371

Forgot to run check-clang-semacxx.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373375 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[OPENMP]Fix PR43330: OpenMP target: Mapping of partial arrays fails.
Alexey Bataev [Tue, 1 Oct 2019 18:18:03 +0000 (18:18 +0000)]
[OPENMP]Fix PR43330: OpenMP target: Mapping of partial arrays fails.

Fixed calculation the size of the array sections.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373374 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[Diagnostics] Make -Wenum-compare-conditional off by default
David Bolvansky [Tue, 1 Oct 2019 18:12:13 +0000 (18:12 +0000)]
[Diagnostics] Make -Wenum-compare-conditional off by default

Too many false positives, eg. in Chromium.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373371 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[ThinLTO] Enable index-only WPD from clang
Teresa Johnson [Tue, 1 Oct 2019 18:08:29 +0000 (18:08 +0000)]
[ThinLTO] Enable index-only WPD from clang

Summary:
To trigger the index-only Whole Program Devirt support added to LLVM, we
need to be able to specify -fno-split-lto-unit in conjunction with
-fwhole-program-vtables. Keep the default for -fwhole-program-vtables as
-fsplit-lto-unit, but don't error on that option combination.

Reviewers: pcc

Subscribers: mehdi_amini, inglorion, steven_wu, dexonsmith, arphaman, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68029

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373370 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[OPENMP]Fix PR43516: Compiler crash with collapse(2) on non-rectangular
Alexey Bataev [Tue, 1 Oct 2019 16:19:10 +0000 (16:19 +0000)]
[OPENMP]Fix PR43516: Compiler crash with collapse(2) on non-rectangular
loop.

Missed check if the condition is also dependent when building final
expressions for the collapsed loop directives.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373348 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[Diagnostics] Move warning into the subgroup (-Wenum-compare-conditional)
David Bolvansky [Tue, 1 Oct 2019 15:44:38 +0000 (15:44 +0000)]
[Diagnostics] Move warning into the subgroup (-Wenum-compare-conditional)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373345 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[clang] Make handling of unnamed template params similar to function params
Kadir Cetinkaya [Tue, 1 Oct 2019 14:08:51 +0000 (14:08 +0000)]
[clang] Make handling of unnamed template params similar to function params

Summary:
Clang uses the location identifier should be inserted for declarator
decls when a decl is unnamed. But for type template and template template
paramaters it uses the location of "typename/class" keyword, which makes it hard
for tooling to insert/change parameter names.

This change tries to unify these two cases by making template parameter
parsing and sourcerange operations similar to function params/declarator decls.

Reviewers: ilya-biryukov

Subscribers: arphaman, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68143

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373340 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[clang] Ignore builtin namespaces in test/Import/cxx-anon-namespace
Raphael Isemann [Tue, 1 Oct 2019 11:53:20 +0000 (11:53 +0000)]
[clang] Ignore builtin namespaces in test/Import/cxx-anon-namespace

Some platforms (e.g. AArch64) put __va_list in the 'std' namespace which might
end up being the first namespace we match in this test. Instead let
the first namespace match via file name/line so that we skip the
builtin namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373327 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[clang][lldb][NFC] Encapsulate ExternalASTMerger::ImporterSource
Raphael Isemann [Tue, 1 Oct 2019 09:02:05 +0000 (09:02 +0000)]
[clang][lldb][NFC] Encapsulate ExternalASTMerger::ImporterSource

NFC preparation work for upcoming ExternalASTMerger patches.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373312 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoDecrease the verbosity of the -ftime-trace option
Sylvestre Ledru [Tue, 1 Oct 2019 07:52:42 +0000 (07:52 +0000)]
Decrease the verbosity of the -ftime-trace option
And move the relevant information in the doc.

Summary:
Currently, building a large software like Firefox shows
'Use chrome://tracing or Speedscope App (https://www.speedscope.app) for flamegraph visualization'
for each file.

Reviewers: anton-afanasyev

Reviewed By: anton-afanasyev

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68260

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373308 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoDon't elide the use of the thread wrapper for a thread_local constinit
Richard Smith [Tue, 1 Oct 2019 01:23:23 +0000 (01:23 +0000)]
Don't elide the use of the thread wrapper for a thread_local constinit
variable with non-trivial destruction.

We still need to invoke the thread wrapper to trigger registration of
the destructor call on thread shutdown.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373289 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[c++20] Add a C++20 version of the existing turing machine test.
Richard Smith [Tue, 1 Oct 2019 00:47:41 +0000 (00:47 +0000)]
[c++20] Add a C++20 version of the existing turing machine test.

Unlike the C++11 version, this one uese mutable state and dynamic
allocation instead of a carefully balanced and ever-accumulating pile of
temporaries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373281 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoDuring constant evaluation, handle CXXBindTemporaryExprs for
Richard Smith [Tue, 1 Oct 2019 00:41:16 +0000 (00:41 +0000)]
During constant evaluation, handle CXXBindTemporaryExprs for
array-of-class types, not just for class types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373279 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[c++20] Fix crash when constant-evaluating an assignment with a
Richard Smith [Tue, 1 Oct 2019 00:07:14 +0000 (00:07 +0000)]
[c++20] Fix crash when constant-evaluating an assignment with a
reference member access on its left-hand side.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373276 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoFix Driver/modules.cpp test to work when build directory name contains '.s'
Tom Stellard [Mon, 30 Sep 2019 23:42:17 +0000 (23:42 +0000)]
Fix Driver/modules.cpp test to work when build directory name contains '.s'

Reviewers: dyung, rsmith, hansw

Subscribers: mati865, mgorny, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66176

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373275 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoFix crash on value-dependent delete-expressions.
Richard Smith [Mon, 30 Sep 2019 22:55:27 +0000 (22:55 +0000)]
Fix crash on value-dependent delete-expressions.

We used to miscompute the 'value-dependent' bit, and would crash if we
tried to evaluate a delete expression that should be value-dependent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373272 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoMake function static that didn't need linkage.
Erich Keane [Mon, 30 Sep 2019 21:24:04 +0000 (21:24 +0000)]
Make function static that didn't need linkage.

In r373247 I added a helper function, but neglected to make it static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373268 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoFix failure caused by r373247
Erich Keane [Mon, 30 Sep 2019 20:45:12 +0000 (20:45 +0000)]
Fix failure caused by r373247

I incorrectly thought that the 'isLambda' check never fired, so when
splitting up a helper function, I lost the 'nullptr' return value.
ClangD Hover functionality apparently uses this, so the Unittest caught
that.

This patch correctly propogates the nullptr from the helper function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373259 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[NFC] Fix tests, second try
David Bolvansky [Mon, 30 Sep 2019 20:41:56 +0000 (20:41 +0000)]
[NFC] Fix tests, second try

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373258 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[OPENMP50]Mark declare variant attribute as inheritable.
Alexey Bataev [Mon, 30 Sep 2019 20:39:29 +0000 (20:39 +0000)]
[OPENMP50]Mark declare variant attribute as inheritable.

Attribute must be inherited by the redeclarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373257 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[NFCI] Updated broken test
David Bolvansky [Mon, 30 Sep 2019 20:23:22 +0000 (20:23 +0000)]
[NFCI] Updated broken test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373256 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[Diagnostics] Warn if enumeration type mismatch in conditional expression
David Bolvansky [Mon, 30 Sep 2019 19:55:50 +0000 (19:55 +0000)]
[Diagnostics] Warn if enumeration type mismatch in conditional expression

Summary:
- Useful warning
- GCC compatibility (GCC warns in C++ mode)

Reviewers: rsmith, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67919

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373252 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoTeach CallGraph to look into Generic Lambdas.
Erich Keane [Mon, 30 Sep 2019 19:12:29 +0000 (19:12 +0000)]
Teach CallGraph to look into Generic Lambdas.

CallGraph visited LambdaExpr by getting the Call Operator from
CXXRecordDecl (LambdaExpr::getCallOperator calls
CXXRecordDecl::getLambdaCallOperator), which replaced generic lambda
call operators with the non-instantiated FunctionDecl.  The result was
that the CallGraph would only pick up non-dependent calls.

This patch does a few things:
1- Extend CXXRecordDecl to have a getDependentLambdaCallOperator, which
will get the FunctionTemplateDecl, rather than immediately getting the
TemplateDecl.
2- Define getLambdaCallOperator and getDependentLambdaCallOperator in
terms of a common function.
3- Extend LambdaExpr with a getDependentCallOperator, which just calls
the above function.
4- Changes CallGraph to handle Generic LambdaExprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373247 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[OPENMP50]Do not emit warning for the function with the currently
Alexey Bataev [Mon, 30 Sep 2019 18:24:35 +0000 (18:24 +0000)]
[OPENMP50]Do not emit warning for the function with the currently
defined body.

If the function is currently defined, we should not emit a warning that
it might be emitted already because it was not really emitted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373243 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoFix buildbot failure from r373217 (don't match metadata id exactly)
Teresa Johnson [Mon, 30 Sep 2019 17:26:48 +0000 (17:26 +0000)]
Fix buildbot failure from r373217 (don't match metadata id exactly)

Fix this failure by ignoring the id of the metadata being checked:
    http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/3046/consoleFull#-21332887158254eaf0-7326-4999-85b0-388101f2d404

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373237 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[Clang] Use -main-file-name for source filename if not set
Teresa Johnson [Mon, 30 Sep 2019 15:05:35 +0000 (15:05 +0000)]
[Clang] Use -main-file-name for source filename if not set

-main-file-name is currently used to set the source name used in debug
information.

If the source filename is "-" and -main-file-name is set, then use the
filename also for source_filename and ModuleID of the output.

The argument is generally used outside the internal clang calls when
running clang in a wrapper like icecc which gives the source via stdin
but still wants to get a object file with the original source filename
both in debug info and IR code.

Patch by: the_jk (Joel Klinghed)

Differential Revision: https://reviews.llvm.org/D67592

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373217 91177308-0d34-0410-b5e6-96231b3b80d8

4 years agoCorrect function declarations; NFC.
Aaron Ballman [Mon, 30 Sep 2019 14:43:52 +0000 (14:43 +0000)]
Correct function declarations; NFC.

This header is included by C code so the functions need to have a prototype. Also, fix the function definitions so that they have C linkage rather than C++ linkage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373213 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[OPENMP] Fix comment, NFC.
Alexey Bataev [Mon, 30 Sep 2019 14:05:26 +0000 (14:05 +0000)]
[OPENMP] Fix comment, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373210 91177308-0d34-0410-b5e6-96231b3b80d8

4 years ago[Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)
Guillaume Chatelet [Mon, 30 Sep 2019 13:34:44 +0000 (13:34 +0000)]
[Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: jholewinski, arsenm, jvesely, nhaehnle, eraman, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D68141

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373207 91177308-0d34-0410-b5e6-96231b3b80d8