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

5 years ago[analyzer] A speculative attempt to avoid gcc-7 crashes caused by r372942.
Artem Dergachev [Thu, 26 Sep 2019 07:01:31 +0000 (07:01 +0000)]
[analyzer] A speculative attempt to avoid gcc-7 crashes caused by r372942.

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

5 years ago[SortIncludesTest] Add SortPriority fields to fix -Wmissing-field-initializers after...
Mikael Holmen [Thu, 26 Sep 2019 06:49:37 +0000 (06:49 +0000)]
[SortIncludesTest] Add SortPriority fields to fix -Wmissing-field-initializers after D64695/r372919

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

5 years ago[analyzer] Avoid small vectors of non-default-constructibles.
Artem Dergachev [Thu, 26 Sep 2019 06:33:21 +0000 (06:33 +0000)]
[analyzer] Avoid small vectors of non-default-constructibles.

Unconfuses certain compilers.

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

5 years ago[clang-format] Add SortPriority fields to fix -Wmissing-field-initializers after...
Fangrui Song [Thu, 26 Sep 2019 02:02:17 +0000 (02:02 +0000)]
[clang-format] Add SortPriority fields to fix -Wmissing-field-initializers after D64695/r372919

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

5 years ago[libTooling] Add `run` combinator to Stencils.
Yitzhak Mandelbaum [Thu, 26 Sep 2019 00:53:56 +0000 (00:53 +0000)]
[libTooling] Add `run` combinator to Stencils.

Summary:
This revision adds `run`, a StencilPart that runs a user-defined function that
computes a result over `MatchFinder::MatchResult`.

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

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

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

5 years agoSimplify -fms-compatibility include lookup logic, NFC
Reid Kleckner [Wed, 25 Sep 2019 22:50:50 +0000 (22:50 +0000)]
Simplify -fms-compatibility include lookup logic, NFC

This include search logic has an extra parameter to deal with Windows
includes with backslashes, which get normalized to forward slashes on
non-Windows under -fms-compatibility.

Hoist the conditional operator out of LookupHeaderIncludeOrImport and
pass the result in instead of repeating the ?: expression everywhere.

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

5 years agoFix memory leak in DeclTest.
Evgeniy Stepanov [Wed, 25 Sep 2019 22:38:20 +0000 (22:38 +0000)]
Fix memory leak in DeclTest.

Fixes a leak introduced in r372903, detected on the ASan bot.
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/35430/steps/check-clang%20asan/logs/stdio

Direct leak of 192 byte(s) in 1 object(s) allocated from:
    #0 0x561d88 in operator new(unsigned long) /b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/asan/asan_new_delete.cc:105
    #1 0x1a48779 in clang::ItaniumMangleContext::create(clang::ASTContext&, clang::DiagnosticsEngine&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/lib/AST/ItaniumMangle.cpp:5134:10
    #2 0xdff000 in Decl_AsmLabelAttr_Test::TestBody() /b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/unittests/AST/DeclTest.cpp:97:23

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

5 years ago[clang-format] Modified SortIncludes and IncludeCategories to priority for sorting...
Paul Hoad [Wed, 25 Sep 2019 20:33:01 +0000 (20:33 +0000)]
[clang-format] Modified SortIncludes and IncludeCategories to priority for sorting #includes within the Group Category.

Summary:
This new Style rule is made as a part of adding support for NetBSD KNF in clang-format. NetBSD have it's own priority of includes which should be followed while formatting NetBSD code. This style sorts the Cpp Includes according to the priorities of NetBSD, as mentioned in the [Style Guide](http://cvsweb.netbsd.org/bsdweb.cgi/src/share/misc/style?rev=HEAD&content-type=text/x-cvsweb-markup)
 The working of this Style rule shown below:

**Configuration:**
This revision introduces a new field under IncludeCategories named `SortPriority` which defines the priority of ordering the `#includes` and the `Priority` will define the categories for grouping the `#include blocks`.

Reviewers: cfe-commits, mgorny, christos, MyDeveloperDay

Reviewed By: MyDeveloperDay

Subscribers: lebedev.ri, rdwampler, christos, mgorny, krytarowski

Patch By: Manikishan

Tags: #clang, #clang-format

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

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

5 years ago[libTooling][NFC] Switch StencilTest.cpp to use EXPECT_THAT_EXPECTED
Yitzhak Mandelbaum [Wed, 25 Sep 2019 20:04:25 +0000 (20:04 +0000)]
[libTooling][NFC] Switch StencilTest.cpp to use EXPECT_THAT_EXPECTED

Summary:
Currently, some tests use homegrown matchers to handle `llvm::Expected`
values. This revision standardizes on EXPECT_THAT_EXPECTED and `HasValue`.

Reviewers: ilya-biryukov

Subscribers: cfe-commits

Tags: #clang

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

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

5 years ago[OPENMP50]Parsing/sema support for 'implementation/vendor' context
Alexey Bataev [Wed, 25 Sep 2019 19:43:37 +0000 (19:43 +0000)]
[OPENMP50]Parsing/sema support for 'implementation/vendor' context
selector.

Added basic parsing/semantic support for
'implementation={vendor(<vendor>)}' context selector.

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

5 years ago[Mangle] Add flag to asm labels to disable '\01' prefixing
Vedant Kumar [Wed, 25 Sep 2019 18:00:31 +0000 (18:00 +0000)]
[Mangle] Add flag to asm labels to disable '\01' prefixing

LLDB synthesizes decls using asm labels. These decls cannot have a mangle
different than the one specified in the label name. I.e., the '\01' prefix
should not be added.

Fixes an expression evaluation failure in lldb's TestVirtual.py on iOS.

rdar://45827323

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

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

5 years ago[CUDA][HIP] Enable kernel function return type deduction.
Michael Liao [Wed, 25 Sep 2019 16:51:45 +0000 (16:51 +0000)]
[CUDA][HIP] Enable kernel function return type deduction.

Summary:
- Even though only `void` is still accepted as the deduced return type,
  enabling deduction/instantiation on the return type allows more
  consistent coding.

Reviewers: tra, jlebar

Subscribers: cfe-commits, yaxunl

Tags: #clang

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

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

5 years agoRe-land r372863: [AST] Extract Decl::printNestedNameSpecifier helper from Decl::print...
Ilya Biryukov [Wed, 25 Sep 2019 15:46:04 +0000 (15:46 +0000)]
Re-land r372863: [AST] Extract Decl::printNestedNameSpecifier helper from Decl::printQualifiedName

Reverted in r372880 due to the test failure.
Also contains a fix that adjusts printQualifiedName to return the same results as before in
case of anonymous function locals and parameters.

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

5 years ago[NFC] Fix typo in `getPreviousDecl` comment.
Yitzhak Mandelbaum [Wed, 25 Sep 2019 14:58:39 +0000 (14:58 +0000)]
[NFC] Fix typo in `getPreviousDecl` comment.

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

5 years agoRevert r372863: [AST] Extract Decl::printNestedNameSpecifier helper from Decl::printQ...
Ilya Biryukov [Wed, 25 Sep 2019 14:50:12 +0000 (14:50 +0000)]
Revert r372863: [AST] Extract Decl::printNestedNameSpecifier helper from Decl::printQualifiedName

Reason: causes a test failure, will investigate and re-land with a fix.

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

5 years ago[libTooling] Introduce the MatchConsumer abstraction
Yitzhak Mandelbaum [Wed, 25 Sep 2019 13:34:04 +0000 (13:34 +0000)]
[libTooling] Introduce the MatchConsumer abstraction

Summary:
This revision introduces a separate (small) library for the `MatchConsumer`
abstraction: computations over AST match results.  This abstraction is central
to the Transformer framework, and there deserves being defined explicitly.

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

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

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

5 years ago[AST] Extract Decl::printNestedNameSpecifier helper from Decl::printQualifiedName
Ilya Biryukov [Wed, 25 Sep 2019 13:09:10 +0000 (13:09 +0000)]
[AST] Extract Decl::printNestedNameSpecifier helper from Decl::printQualifiedName

Summary:
To be used in clangd, e.g. in D66647.
Currently the alternative to this function is doing string manipulation on results of `printQualifiedName`, which is
hard-to-impossible to get right in presence of template arguments.

Reviewers: kadircet, aaron.ballman

Reviewed By: kadircet, aaron.ballman

Subscribers: aaron.ballman, usaxena95, cfe-commits

Tags: #clang

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

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

5 years agoAdd a release note for r372844
Hans Wennborg [Wed, 25 Sep 2019 11:53:17 +0000 (11:53 +0000)]
Add a release note for r372844

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

5 years agoRevert r370850 "Re-commit r363191 "[MS] Pretend constexpr variable template specializ...
Hans Wennborg [Wed, 25 Sep 2019 11:09:46 +0000 (11:09 +0000)]
Revert r370850 "Re-commit r363191 "[MS] Pretend constexpr variable template specializations are inline""

This work-around was necessary to handle standard library headers in
Visual Studio 2019 16.2. Now that 16.3 has shipped to stable, we can
remove it.

> Re-commit r363191 "[MS] Pretend constexpr variable template specializations are inline"
>
> While the next Visual Studio update (16.3) will fix this issue, that hasn't
> shipped yet. Until then Clang wouldn't work with MSVC's headers which seems
> unfortunate. Let's keep this in until VS 16.3 ships. (See also PR42843.)
>
>> Fixes link errors with clang and the latest Visual C++ 14.21.27702
>> headers, which was reported as PR42027.
>>
>> I chose to intentionally make these things linkonce_odr, i.e.
>> discardable, so that we don't emit definitions of these things in every
>> translation unit that includes STL headers.
>>
>> Note that this is *not* what MSVC does: MSVC has not yet implemented C++
>> DR2387, so they emit fully specialized constexpr variable templates with
>> static / internal linkage.
>>
>> Reviewers: rsmith
>>
>> Differential Revision: https://reviews.llvm.org/D63175

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

5 years ago[OpenCL] Add image query builtin functions
Sven van Haastregt [Wed, 25 Sep 2019 09:12:59 +0000 (09:12 +0000)]
[OpenCL] Add image query builtin functions

Add the image query builtin functions from the OpenCL C specification.

Patch by Pierre Gondois and Sven van Haastregt.

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

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

5 years ago[Driver] Always use -z separate-loadable-segments with lld on Fuchsia
Fangrui Song [Wed, 25 Sep 2019 07:06:50 +0000 (07:06 +0000)]
[Driver] Always use -z separate-loadable-segments with lld on Fuchsia

The option was added to lld in D67481/372807.

Reviewed By: phosek

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

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

5 years ago [x86] Adding support for some missing intrinsics: _castf32_u32, _castf64_u64, _castu...
Pengfei Wang [Wed, 25 Sep 2019 02:24:05 +0000 (02:24 +0000)]
 [x86] Adding support for some missing intrinsics: _castf32_u32, _castf64_u64, _castu32_f32, _castu64_f64

Summary:
Adding support for some missing intrinsics:
_castf32_u32, _castf64_u64, _castu32_f32, _castu64_f64

Reviewers: craig.topper, LuoYuanke, RKSimon, pengfei

Reviewed By: RKSimon

Subscribers: llvm-commits

Patch by yubing (Bing Yu)

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

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

5 years ago[NFC] Strenghten preconditions for warning
David Bolvansky [Tue, 24 Sep 2019 20:10:57 +0000 (20:10 +0000)]
[NFC] Strenghten preconditions for warning

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