]> granicus.if.org Git - clang/log
clang
5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 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

5 years agoDeclCXX/ExprCXX - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Mon, 30 Sep 2019 11:04:12 +0000 (11:04 +0000)]
DeclCXX/ExprCXX - 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@373198 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Alignment][NFC] Remove LoadInst::setAlignment(unsigned)
Guillaume Chatelet [Mon, 30 Sep 2019 09:37:05 +0000 (09:37 +0000)]
[Alignment][NFC] Remove LoadInst::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, jdoerfert

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

Tags: #clang, #llvm

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

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

5 years ago[lldb][clang][modern-type-lookup] Use ASTImporterSharedState in ExternalASTMerger
Raphael Isemann [Mon, 30 Sep 2019 08:52:16 +0000 (08:52 +0000)]
[lldb][clang][modern-type-lookup] Use ASTImporterSharedState in ExternalASTMerger

Summary:
The ExternalASTMerger should use the ASTImporterSharedState. This allows it to
handle std::pair in LLDB (but the rest of libc++ is still work in progress).

Reviewers: martong, shafik, a.sidorin

Subscribers: rnkovacs, christof, JDevlieghere, lldb-commits

Tags: #lldb

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

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

5 years agoDon't crash if a variable with a constexpr destructor has a
Richard Smith [Sun, 29 Sep 2019 20:30:13 +0000 (20:30 +0000)]
Don't crash if a variable with a constexpr destructor has a
value-dependent initializer.

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

5 years ago[clang-format] Reference qualifiers in member templates causing extra indentation.
Paul Hoad [Sun, 29 Sep 2019 13:45:38 +0000 (13:45 +0000)]
[clang-format] Reference qualifiers in member templates causing extra indentation.

Summary:
The following code

```
struct f {
  template <class T>
  void bar() && noexcept {}
};
```

will be formatted to the following with LLVM style, and
`AlwaysBreakTemplateDeclarations: Yes`

```
struct f {
  template <class T>
      void bar() && noexcept {}
};
```

The indentation of the `void bar()` line is wrong.

Reviewers: klimek, owenpan, krasimir, timwoj, MyDeveloperDay

Reviewed By: klimek, MyDeveloperDay

Subscribers: MyDeveloperDay, ilya-biryukov, llvm-commits, cfe-commits

Patch By: AndWass

Tags: #clang-format, #clang, #llvm

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

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

5 years ago[cxx_status] Mark P0784R7 as partially complete.
Richard Smith [Sun, 29 Sep 2019 07:16:13 +0000 (07:16 +0000)]
[cxx_status] Mark P0784R7 as partially complete.

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

5 years agoFor now, disallow lifetime-extended temporaries with non-trivial (but
Richard Smith [Sun, 29 Sep 2019 06:22:54 +0000 (06:22 +0000)]
For now, disallow lifetime-extended temporaries with non-trivial (but
constexpr) destructors from being used in the values of constexpr
variables.

The standard rules here are unclear at best, so rejecting the
problematic cases seems prudent. Prior to this change, we would fail to
run the destructors for these temporaries, even if they had
side-effects, which is certainly not the right behavior.

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

5 years agoFix checking for permitted results of constant expressions.
Richard Smith [Sun, 29 Sep 2019 05:58:31 +0000 (05:58 +0000)]
Fix checking for permitted results of constant expressions.

In the presence of mutable state, we need to check whether temporaries
involved in a constant expression have permissible values at the end of
the overall evaluation, rather than at the end of the evaluation of the
initializer of the temporary.

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

5 years agoFor P0784R7: compute whether a variable has constant destruction if it
Richard Smith [Sun, 29 Sep 2019 05:08:46 +0000 (05:08 +0000)]
For P0784R7: compute whether a variable has constant destruction if it
has a constexpr destructor.

For constexpr variables, reject if the variable does not have constant
destruction. In all cases, do not emit runtime calls to the destructor
for variables with constant destruction.

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

5 years agoSemaExpr - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Sat, 28 Sep 2019 14:01:52 +0000 (14:01 +0000)]
SemaExpr - 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@373150 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDon't install example analyzer plugins
Aaron Puchert [Sat, 28 Sep 2019 13:28:50 +0000 (13:28 +0000)]
Don't install example analyzer plugins

Summary: Fixes PR43430.

Reviewers: hintonda, NoQ, Szelethus, lebedev.ri

Reviewed By: lebedev.ri

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

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

5 years agoDriver tests: set `--sysroot=""` to support clang with `DEFAULT_SYSROOT`
Serge Pavlov [Sat, 28 Sep 2019 12:21:06 +0000 (12:21 +0000)]
Driver tests: set `--sysroot=""` to support clang with `DEFAULT_SYSROOT`

When testing clang that has been compiled with `-DDEFAULT_SYSROOT` set to some path,
some tests would fail. Override sysroot to be empty string for the tests to succeed
when clang is configured with `DEFAULT_SYSROOT`.

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

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

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

5 years ago[TimeProfiler] Fix "OptModule" section and add new "Backend" sections
Anton Afanasyev [Sat, 28 Sep 2019 07:14:12 +0000 (07:14 +0000)]
[TimeProfiler] Fix "OptModule" section and add new "Backend" sections

Remove unnecessary "OptModule" section. Add "PerFunctionPasses",
"PerModulePasses" and "CodeGenPasses" sections under "Backend" section.

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

5 years agoFor P0784R7: add support for explicit destructor calls and
Richard Smith [Fri, 27 Sep 2019 20:24:36 +0000 (20:24 +0000)]
For P0784R7: add support for explicit destructor calls and
pseudo-destructor calls in constant evaluation.

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

5 years ago[Clang][OpenMP Offload] Create start/end symbols for the offloading entry table with...
Sergey Dmitriev [Fri, 27 Sep 2019 20:00:51 +0000 (20:00 +0000)]
[Clang][OpenMP Offload] Create start/end symbols for the offloading entry table with a help of a linker

Linker automatically provides __start_<section name> and __stop_<section name> symbols to satisfy unresolved references if <section name> is representable as a C identifier (see https://sourceware.org/binutils/docs/ld/Input-Section-Example.html for details). These symbols indicate the start address and end address of the output section respectively. Therefore, renaming OpenMP offload entries section name from ".omp.offloading_entries" to "omp_offloading_entries" to use this feature.

This is the first part of the patch for eliminating OpenMP linker script (please see https://reviews.llvm.org/D64943).

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

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

5 years ago[libTooling] Transformer: refine `SourceLocation` specified as anchor of changes.
Yitzhak Mandelbaum [Fri, 27 Sep 2019 15:26:04 +0000 (15:26 +0000)]
[libTooling] Transformer: refine `SourceLocation` specified as anchor of changes.

Summary: Every change triggered by a rewrite rule is anchored at a particular
location in the source code.  This patch refines how that location is chosen and
defines it as an explicit function so it can be shared by other Transformer
implementations.

This patch was inspired by a bug found by a clang tidy, wherein two changes were
anchored at the same location (the expansion loc of the macro) resulting in the
discarding of the second change.

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

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

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

5 years ago[OpenCL] Pass LangOptions as const ref
Sven van Haastregt [Fri, 27 Sep 2019 13:31:29 +0000 (13:31 +0000)]
[OpenCL] Pass LangOptions as const ref

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

5 years ago[clang] [AST] Treat "inline gnu_inline" the same way as "extern inline gnu_inline...
Martin Storsjo [Fri, 27 Sep 2019 12:25:19 +0000 (12:25 +0000)]
[clang] [AST] Treat "inline gnu_inline" the same way as "extern inline gnu_inline" in C++ mode

This matches how GCC handles it, see e.g. https://gcc.godbolt.org/z/HPplnl.
GCC documents the gnu_inline attribute with "In C++, this attribute does
not depend on extern in any way, but it still requires the inline keyword
to enable its special behavior."

The previous behaviour of gnu_inline in C++, without the extern
keyword, can be traced back to the original commit that added
support for gnu_inline, SVN r69045.

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

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

5 years agoRevert r373056: [clang-format] Reference qualifiers in member templates causing extra...
Ilya Biryukov [Fri, 27 Sep 2019 09:49:20 +0000 (09:49 +0000)]
Revert r373056: [clang-format] Reference qualifiers in member templates causing extra indentation

Reason: this breaks unit tests.

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

5 years ago[clang-format] Reference qualifiers in member templates causing extra indentation
Ilya Biryukov [Fri, 27 Sep 2019 09:24:58 +0000 (09:24 +0000)]
[clang-format] Reference qualifiers in member templates causing extra indentation

The following code

```
struct f {
  template <class T>
  void bar() && noexcept {}
};
```

will be formatted to the following with LLVM style, and
`AlwaysBreakTemplateDeclarations: Yes`

```
struct f {
  template <class T>
      void bar() && noexcept {}
};
```

The indentation of the `void bar()` line is wrong.

Patch by Andreas Wass (AndWass)!

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

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

5 years agoFix the 'directory' field in DumpCompilationDatabase and add test
Hans Wennborg [Fri, 27 Sep 2019 08:14:45 +0000 (08:14 +0000)]
Fix the 'directory' field in DumpCompilationDatabase and add test

This broke in r371027 due to a missing negation
(llvm::sys::fs::current_path returns false on success).

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

5 years ago[test] Use %clang_cc1 instead of %clang -cc1
Fangrui Song [Fri, 27 Sep 2019 05:37:06 +0000 (05:37 +0000)]
[test] Use %clang_cc1 instead of %clang -cc1

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

5 years agoFix use-after-free found in Clang's testsuite.
Richard Smith [Fri, 27 Sep 2019 05:36:16 +0000 (05:36 +0000)]
Fix use-after-free found in Clang's testsuite.

We need to discard all remaining cleanups if an earlier cleanup failed,
otherwise we may try to rerun the remaining cleanups later, potentially
after the scope containing the object is destroyed. (This can happen
when checking a potential constant expression.)

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

5 years agoRevert r373034
Nicholas Allegra [Fri, 27 Sep 2019 01:58:31 +0000 (01:58 +0000)]
Revert r373034

It breaks the build on MSVC.

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

5 years agoFor P0784R7: add support for new (std::nothrow).
Richard Smith [Fri, 27 Sep 2019 01:26:49 +0000 (01:26 +0000)]
For P0784R7: add support for new (std::nothrow).

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

5 years agoFor P0784R7: Add support for dynamic allocation with new / delete during
Richard Smith [Fri, 27 Sep 2019 01:26:47 +0000 (01:26 +0000)]
For P0784R7: Add support for dynamic allocation with new / delete during
constant evaluation.

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

5 years ago[Consumed][NFC] Refactor handleCall to take function argument list.
Nicholas Allegra [Thu, 26 Sep 2019 23:47:18 +0000 (23:47 +0000)]
[Consumed][NFC] Refactor handleCall to take function argument list.

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

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

5 years ago[OpenMP 5.0] Fix user-defined mapper lookup in sema
Michael Kruse [Thu, 26 Sep 2019 22:53:01 +0000 (22:53 +0000)]
[OpenMP 5.0] Fix user-defined mapper lookup in sema

This patches fixes the case when a user-defined mapper is attached to
the elements of an array, and to report error when a mapper is used for
types other than struct, class, and union.

Patch by Lingda Li <lildmh@gmail.com>

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

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

5 years agoAlways rebuild a DeclRefExpr if its FoundDecl would change.
Richard Smith [Thu, 26 Sep 2019 22:28:32 +0000 (22:28 +0000)]
Always rebuild a DeclRefExpr if its FoundDecl would change.

Fixes a regression introduced by r369999.

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

5 years ago[OPENMP50]Emit warnings if the functions was defined/used before marked
Alexey Bataev [Thu, 26 Sep 2019 20:04:15 +0000 (20:04 +0000)]
[OPENMP50]Emit warnings if the functions was defined/used before marked
declare variant.

We can use the original function if it was used/emitted already. So,
just use warnings for these cases, not errors.

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

5 years ago[clang-scan-deps] Allow continuation line backslashes followed by whitespace
Alex Lorenz [Thu, 26 Sep 2019 19:28:51 +0000 (19:28 +0000)]
[clang-scan-deps] Allow continuation line backslashes followed by whitespace
in the dependency source minimizer

Clang allows continuations that have whitespace between the backslash and the newline.
This patch ensures that the dependency source minimizer can handle the whitespace between
the backslash and the newline when looking for a line continuation.

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

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

5 years agoRevert "[analyzer] A speculative attempt to avoid gcc-7 crashes..."
Artem Dergachev [Thu, 26 Sep 2019 18:52:00 +0000 (18:52 +0000)]
Revert "[analyzer] A speculative attempt to avoid gcc-7 crashes..."

This reverts commit r372940 which was an overreaction to a flaky buildbot.

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

5 years agoOnly pass -coverage-notes-file when emitting coverage
Reid Kleckner [Thu, 26 Sep 2019 18:13:19 +0000 (18:13 +0000)]
Only pass -coverage-notes-file when emitting coverage

The only functional change here is that -coverage-notes-file is not
passed to -cc1 in some situations.

This code appears to be trying to put the gcno and gcda output next to
the final object file, but it's doing that in a really convoluted way
that needs to be re-examined. It looks for -c or -S in the original
command, and then looks at the -o argument if present in order to handle
the -fno-integrated-as case. However, this doesn't work if this is a
link command with multiple inputs. I looked into fixing this, but the
check-profile test suite has a lot of dependencies on this behavior, so
I left it all alone.

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

5 years agoMove normalization of `\` in #includes from -fms-compatibility to -fms-extensions
Reid Kleckner [Thu, 26 Sep 2019 17:19:22 +0000 (17:19 +0000)]
Move normalization of `\` in #includes from -fms-compatibility to -fms-extensions

Handling backslashes in include paths in the implementation isn't
non-conforming.

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

5 years agoUn-XFAIL coverage_no_integrated_as.c test on Windows
Reid Kleckner [Thu, 26 Sep 2019 16:56:25 +0000 (16:56 +0000)]
Un-XFAIL coverage_no_integrated_as.c test on Windows

You can't use -fno-integrated-as for *-msvc triples because no usable
standalone assembler exists. Perhaps we could teach clang to emit a .s
and then reinvoke itself, but that's a bit silly.

Anyway, fix the test by using an Itanium ABI triple, which will become
mingw, which will assume gnu as is a usable assembler.

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

5 years ago[OpenCL] Add -Wconversion to fdeclare-opencl-builtins test
Sven van Haastregt [Thu, 26 Sep 2019 13:31:36 +0000 (13:31 +0000)]
[OpenCL] Add -Wconversion to fdeclare-opencl-builtins test

Add the -Wconversion -Werror options to check no unexpected conversion
is done.

Patch by Pierre Gondois and Sven van Haastregt.

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

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

5 years ago[Testing] Workaround libcxx bug when OS is "none"
David Zarzycki [Thu, 26 Sep 2019 08:19:44 +0000 (08:19 +0000)]
[Testing] Workaround libcxx bug when OS is "none"

If clang is configured to use libcxx as the default C++ standard
library, then using "none" for the OS in the target triple will cause
libcxx to #error needlessly. Passing -nostdinc++ is a workaround for
these tests. See also: https://reviews.llvm.org/D68075

Please note: this workaround will probably exist for a few years until
the installed version of libcxx is updated.

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