]> granicus.if.org Git - clang/log
clang
5 years agoUpdate the file headers across all of the LLVM projects in the monorepo
Chandler Carruth [Sat, 19 Jan 2019 08:50:56 +0000 (08:50 +0000)]
Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

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

5 years agoConvert two more files that were using Windows line endings and remove
Chandler Carruth [Sat, 19 Jan 2019 06:36:08 +0000 (06:36 +0000)]
Convert two more files that were using Windows line endings and remove
a stray single '\r' from one file. These are the last line ending issues
I can find in the files containing parts of LLVM's file headers.

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

5 years agoRemove random windows line endings that snuck into the middle of this
Chandler Carruth [Sat, 19 Jan 2019 06:36:00 +0000 (06:36 +0000)]
Remove random windows line endings that snuck into the middle of this
code.

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

5 years agoUpdate some code used in our visual studio plugins to use linux file
Chandler Carruth [Sat, 19 Jan 2019 06:29:07 +0000 (06:29 +0000)]
Update some code used in our visual studio plugins to use linux file
endings. We already used them in some cases, and this makes things
consistent. This will also simplify updating the licenses in these
files.

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

5 years agoInstall new LLVM license structure and new developer policy.
Chandler Carruth [Sat, 19 Jan 2019 06:14:24 +0000 (06:14 +0000)]
Install new LLVM license structure and new developer policy.

This installs the new developer policy and moves all of the license
files across all LLVM projects in the monorepo to the new license
structure. The remaining projects will be moved independently.

Note that I've left odd formatting and other idiosyncracies of the
legacy license structure text alone to make the diff easier to read.
Critically, note that we do not in any case *remove* the old license
notice or terms, as that remains necessary until we finish the
relicensing process.

I've updated a few license files that refer to the LLVM license to
instead simply refer generically to whatever license the LLVM project is
under, basically trying to minimize confusion.

This is really the culmination of so many people. Chris led the
community discussions, drafted the policy update and organized the
multi-year string of meeting between lawyers across the community to
figure out the strategy. Numerous lawyers at companies in the community
spent their time figuring out initial answers, and then the Foundation's
lawyer Heather Meeker has done *so* much to help refine and get us ready
here. I could keep going on, but I just want to make sure everyone
realizes what a huge community effort this has been from the begining.

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

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

5 years agoEmit !callback metadata and introduce the callback attribute
Johannes Doerfert [Sat, 19 Jan 2019 05:36:54 +0000 (05:36 +0000)]
Emit !callback metadata and introduce the callback attribute

  With commit r351627, LLVM gained the ability to apply (existing) IPO
  optimizations on indirections through callbacks, or transitive calls.
  The general idea is that we use an abstraction to hide the middle man
  and represent the callback call in the context of the initial caller.
  It is described in more detail in the commit message of the LLVM patch
  r351627, the llvm::AbstractCallSite class description, and the
  language reference section on callback-metadata.

  This commit enables clang to emit !callback metadata that is
  understood by LLVM. It does so in three different cases:
    1) For known broker functions declarations that are directly
       generated, e.g., __kmpc_fork_call for the OpenMP pragma parallel.
    2) For known broker functions that are identified by their name and
       source location through the builtin detection, e.g.,
       pthread_create from the POSIX thread API.
    3) For user annotated functions that carry the "callback(callee, ...)"
       attribute. The attribute has to include the name, or index, of
       the callback callee and how the passed arguments can be
       identified (as many as the callback callee has). See the callback
       attribute documentation for detailed information.

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

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

5 years ago[analyzer] pr37688: Fix a crash upon evaluating a deleted destructor of a union.
Artem Dergachev [Fri, 18 Jan 2019 23:05:07 +0000 (23:05 +0000)]
[analyzer] pr37688: Fix a crash upon evaluating a deleted destructor of a union.

Add a defensive check against an invalid destructor in the CFG.

Unions with fields with destructors have their own destructor implicitly
deleted. Due to a bug in the CFG we're still trying to evaluate them
at the end of the object's lifetime and crash because we are unable
to find the destructor's declaration.

rdar://problem/47362608

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

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

5 years ago[analyzer] Do not try to body-farm Objective-C properties with custom accessors.
Artem Dergachev [Fri, 18 Jan 2019 22:52:13 +0000 (22:52 +0000)]
[analyzer] Do not try to body-farm Objective-C properties with custom accessors.

If a property is defined with a custom getter, we should not behave as if
the getter simply returns an instance variable. We don't support setters,
so they aren't affected.

On top of being the right thing to do, this also fixes a crash on
the newly added test - in which a property and its getter are defined
in two separate categories.

rdar://problem/47051544

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

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

5 years ago[ASTDump] Add test for current AST dump behavior
Stephen Kelly [Fri, 18 Jan 2019 22:15:13 +0000 (22:15 +0000)]
[ASTDump] Add test for current AST dump behavior

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

5 years ago[ASTDump] NFC: Move variable into if() statement
Stephen Kelly [Fri, 18 Jan 2019 22:15:09 +0000 (22:15 +0000)]
[ASTDump] NFC: Move variable into if() statement

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

5 years ago[ASTDump] NFC: Remove redundant condition
Stephen Kelly [Fri, 18 Jan 2019 22:15:05 +0000 (22:15 +0000)]
[ASTDump] NFC: Remove redundant condition

These conditions are duplicated from the dumpDeclContext function called
within the if(). This is presumably an attempt to avoid calling the
function in the case it will do nothing.

That may have made sense in the past if the code was different, but it
doesn't make sense now.

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

5 years ago[ASTDump] NFC: Remove non-needed braces
Stephen Kelly [Fri, 18 Jan 2019 22:14:59 +0000 (22:14 +0000)]
[ASTDump] NFC: Remove non-needed braces

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

5 years ago[ASTDump] Mark null params with a tag rather than a child node
Stephen Kelly [Fri, 18 Jan 2019 22:00:16 +0000 (22:00 +0000)]
[ASTDump] Mark null params with a tag rather than a child node

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

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

5 years ago[ASTDump] Mark BlockDecls which capture this with a tag
Stephen Kelly [Fri, 18 Jan 2019 21:55:24 +0000 (21:55 +0000)]
[ASTDump] Mark BlockDecls which capture this with a tag

Summary:
Removal of the child node makes it easier to separate traversal from
output generation.

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

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

5 years ago[ASTDump] Mark variadic declarations with a tag instead of child node
Stephen Kelly [Fri, 18 Jan 2019 21:38:30 +0000 (21:38 +0000)]
[ASTDump] Mark variadic declarations with a tag instead of child node

Summary:
This makes it easier to separate traversal of the AST from output
generation.

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

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

5 years ago[Sema] Suppress a warning about a forward-declared fixed enum in C mode
Erik Pilkington [Fri, 18 Jan 2019 21:33:23 +0000 (21:33 +0000)]
[Sema] Suppress a warning about a forward-declared fixed enum in C mode

As of r343360, we support fixed-enums in C. This lead to some
warnings in project headers where a fixed enum is forward declared
then later defined. In C++, this is fine, the forward declaration is
treated as a complete type even though the definition isn't present.
We use this rule in C too, but still warn about the forward
declaration anyways. This patch suppresses the warning.

rdar://problem/47356469

Differential revision: https://reviews.llvm.org/D56879

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

5 years ago[Fixed Point Arithmetic] Fixed Point Addition Constant Expression Evaluation
Leonard Chan [Fri, 18 Jan 2019 21:04:25 +0000 (21:04 +0000)]
[Fixed Point Arithmetic] Fixed Point Addition Constant Expression Evaluation

This patch includes logic for constant expression evaluation of fixed point additions.

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

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

5 years agoFix MSVC "not all control paths return a value" warning. NFCI.
Simon Pilgrim [Fri, 18 Jan 2019 20:40:35 +0000 (20:40 +0000)]
Fix MSVC "not all control paths return a value" warning. NFCI.

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

5 years ago[OPENMP][DOCS] Release notes/OpenMP support updates, NFC.
Kelvin Li [Fri, 18 Jan 2019 19:57:37 +0000 (19:57 +0000)]
[OPENMP][DOCS] Release notes/OpenMP support updates, NFC.

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

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

5 years ago[mips] Add '-mrelax-pic-calls', '-mno-relax-pic-calls'
Vladimir Stefanovic [Fri, 18 Jan 2019 19:54:51 +0000 (19:54 +0000)]
[mips] Add '-mrelax-pic-calls', '-mno-relax-pic-calls'

These two options enable/disable emission of R_{MICRO}MIPS_JALR fixups along
with PIC calls. The linker may then try to turn PIC calls into direct jumps.
By default, these fixups do get emitted by the backend, use
'-mno-relax-pic-calls' to omit them.

Differential revision: https://reviews.llvm.org/D56878

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

5 years ago[NFC] Fix wParentheses warning in ASTContext getFixedPointSemantics
Erich Keane [Fri, 18 Jan 2019 19:31:54 +0000 (19:31 +0000)]
[NFC] Fix wParentheses warning in ASTContext getFixedPointSemantics

Change-Id: I862f00a548236872fe24f7da8eb2bf7917e123ff

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

5 years agoRevert "Fix failing MSan bots"
George Karpenkov [Fri, 18 Jan 2019 19:24:55 +0000 (19:24 +0000)]
Revert "Fix failing MSan bots"

This reverts commit 2cedaaef383d8d6142046074ffebc2bb5a914778.

Revert with a fix.

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

5 years ago[clang] Change to range-based invocation of llvm::sort
Mandeep Singh Grang [Fri, 18 Jan 2019 18:45:26 +0000 (18:45 +0000)]
[clang] Change to range-based invocation of llvm::sort

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

5 years ago[X86] Only define _XCR_XFEATURE_ENABLED_MASK in xsaveintrin.h when _MSC_VER is define...
Craig Topper [Fri, 18 Jan 2019 17:51:51 +0000 (17:51 +0000)]
[X86] Only define _XCR_XFEATURE_ENABLED_MASK in xsaveintrin.h when _MSC_VER is defined. Remove from intrin.h.

I think this was my intention when I added it xsaveintrin.h

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

5 years ago[clang][slh] add Clang attr no_speculative_load_hardening
Zola Bridges [Fri, 18 Jan 2019 17:20:46 +0000 (17:20 +0000)]
[clang][slh] add Clang attr no_speculative_load_hardening

Summary:
This attribute will allow users to opt specific functions out of
speculative load hardening. This compliments the Clang attribute
named speculative_load_hardening. When this attribute or the attribute
speculative_load_hardening is used in combination with the flags
-mno-speculative-load-hardening or -mspeculative-load-hardening,
the function level attribute will override the default during LLVM IR
generation. For example, in the case, where the flag opposes the
function attribute, the function attribute will take precendence.
The sticky inlining behavior of the speculative_load_hardening attribute
may cause a function with the no_speculative_load_hardening attribute
to be tagged with the speculative_load_hardening tag in
subsequent compiler phases which is desired behavior since the
speculative_load_hardening LLVM attribute is designed to be maximally
conservative.

If both attributes are specified for a function, then an error will be
thrown.

Reviewers: chandlerc, echristo, kristof.beyls, aaron.ballman

Subscribers: llvm-commits

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

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

5 years agoRevert "Clang side support for @cc assembly operands."
Nirav Dave [Fri, 18 Jan 2019 16:03:08 +0000 (16:03 +0000)]
Revert "Clang side support for @cc assembly operands."

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

5 years agoClang side support for @cc assembly operands.
Nirav Dave [Fri, 18 Jan 2019 15:57:23 +0000 (15:57 +0000)]
Clang side support for @cc assembly operands.

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

5 years agoFix test failure from r351495
Erich Keane [Fri, 18 Jan 2019 13:58:10 +0000 (13:58 +0000)]
Fix test failure from r351495

The test has problems due to some platforms having a different type for
ptrdiff_t, so the error message is different.  The error message doesn't
matter to the test for anything other than an incompatible intger to
pointer conversion, so this patch removes the integral type from the
expected message.

Change-Id: I80e786f9b80268163813774bbf25a9ca25b6c60c

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

5 years ago[OpenCL] Fix overloading ranking rules for addrspace conversions.
Anastasia Stulova [Fri, 18 Jan 2019 11:38:16 +0000 (11:38 +0000)]
[OpenCL] Fix overloading ranking rules for addrspace conversions.

Extend ranking to work with address spaces correctly when
resolving overloads.

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

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

5 years ago[analyzer] Unbreak building of SymbolReaperTest true BUILD_SHARED_LIBS=True
Alex Bradbury [Fri, 18 Jan 2019 10:13:07 +0000 (10:13 +0000)]
[analyzer] Unbreak building of SymbolReaperTest true BUILD_SHARED_LIBS=True

Extra dependencies need to be listed for StaticAnalysisTests in order for
linking to succeed when BUILD_SHARED_LIBS=True.

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

5 years ago[tooling] Add a new argument adjuster for deleting plugin related command line args
Kadir Cetinkaya [Fri, 18 Jan 2019 09:00:31 +0000 (09:00 +0000)]
[tooling] Add a new argument adjuster for deleting plugin related command line args

Summary:
Currently both clangd and clang-tidy makes use of this mechanism so
putting it into tooling so that all tools can make use of it.

Reviewers: ilya-biryukov, sammccall

Subscribers: ioeric, cfe-commits

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

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

5 years agoFix failing MSan bots
Vlad Tsyrklevich [Fri, 18 Jan 2019 08:43:22 +0000 (08:43 +0000)]
Fix failing MSan bots

Revert r351508-351514, this block of changes introduced a consistent
MSan failure on the sanitizer bots.

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

5 years ago[analyzer] Introduce proper diagnostic for freeing unowned object
George Karpenkov [Fri, 18 Jan 2019 03:13:53 +0000 (03:13 +0000)]
[analyzer] Introduce proper diagnostic for freeing unowned object

Insert a note when the object becomes not (exclusively) owned.

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

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

5 years ago[analyzer] Extend the PathDiagnosticLocation constructor to handle CallExitEnd
George Karpenkov [Fri, 18 Jan 2019 03:13:40 +0000 (03:13 +0000)]
[analyzer] Extend the PathDiagnosticLocation constructor to handle CallExitEnd

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

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

5 years ago[analyzer] [NFC] Clean up messy handling of bug categories in RetainCountChecker
George Karpenkov [Fri, 18 Jan 2019 03:13:27 +0000 (03:13 +0000)]
[analyzer] [NFC] Clean up messy handling of bug categories in RetainCountChecker

https://reviews.llvm.org/D56887

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

5 years ago[analyzer] const-ify reference to bug type used in BugReporter
George Karpenkov [Fri, 18 Jan 2019 03:13:14 +0000 (03:13 +0000)]
[analyzer] const-ify reference to bug type used in BugReporter

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

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

5 years ago[analyzer] Extend BugType constructor to accept "SuppressOnSink" as a parameter
George Karpenkov [Fri, 18 Jan 2019 03:13:01 +0000 (03:13 +0000)]
[analyzer] Extend BugType constructor to accept "SuppressOnSink" as a parameter

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

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

5 years ago[analyzer] [RetainCountChecker] Produce a correct message when OSTypeAlloc is used
George Karpenkov [Fri, 18 Jan 2019 03:12:48 +0000 (03:12 +0000)]
[analyzer] [RetainCountChecker] Produce a correct message when OSTypeAlloc is used

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

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

5 years ago[analyzer] [RetainCountChecker] Smart pointer support.
George Karpenkov [Fri, 18 Jan 2019 03:12:35 +0000 (03:12 +0000)]
[analyzer] [RetainCountChecker] Smart pointer support.

rdar://47323216

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

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

5 years ago[analyzer] A speculative fix for buildbot failures in the new SymbolReaperTest.
Artem Dergachev [Fri, 18 Jan 2019 01:37:14 +0000 (01:37 +0000)]
[analyzer] A speculative fix for buildbot failures in the new SymbolReaperTest.

I expect an xvalue to be easier to convert.

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

5 years ago[analyzer] MoveChecker: Add one more common resetting method, "append".
Artem Dergachev [Fri, 18 Jan 2019 00:16:25 +0000 (00:16 +0000)]
[analyzer] MoveChecker: Add one more common resetting method, "append".

This is especially crucial for reports related to use-after-move of
standard library objects.

rdar://problem/47338505

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

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

5 years ago[analyzer] Make sure base-region and its sub-regions are either all alive or all...
Artem Dergachev [Fri, 18 Jan 2019 00:08:56 +0000 (00:08 +0000)]
[analyzer] Make sure base-region and its sub-regions are either all alive or all dead.

SymbolReaper now realizes that our liveness analysis isn't sharp enough
to discriminate between liveness of, say, variables and their fields.
Surprisingly, this didn't quite work before: having a variable live only
through Environment (eg., calling a C++ method on a local variable
as the last action ever performed on that variable) would not keep the
region value symbol of a field of that variable alive.

It would have been broken in the opposite direction as well, but both
Environment and RegionStore use the scanReachableSymbols mechanism for finding
live symbols regions within their values, and due to that they accidentally
end up marking the whole chain of super-regions as live when at least one
sub-region is known to be live.

It is now a direct responsibility of SymbolReaper to maintain this invariant,
and a unit test was added in order to make sure it stays that way.

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

rdar://problem/46914108

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

5 years agoMake integral-o-pointer conversions in SFINAE illegal.
Erich Keane [Thu, 17 Jan 2019 23:11:15 +0000 (23:11 +0000)]
Make integral-o-pointer conversions in SFINAE illegal.

As reported in PR40362, allowing the conversion from an integral to a
pointer type (despite being illegal in the C++ standard) will cause
surprsing results when testing for certain behaviors in SFINAE.  This
patch converts the error to a SFINAE Error and adds a test to ensure
that it is still a warning in non-SFINAE but an error in it.

Change-Id: I1f475637fa4d83217ae37dc6b5dbf653e118fae4

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

5 years agoFix cleanup registration for lambda captures.
Richard Smith [Thu, 17 Jan 2019 22:05:50 +0000 (22:05 +0000)]
Fix cleanup registration for lambda captures.

Lambda captures should be destroyed if an exception is thrown only if
the construction of the complete lambda-expression has not completed.
(If the lambda-expression has been fully constructed, any exception will
invoke its destructor, which will destroy the captures.)

This is directly modeled after how we handle the equivalent situation in
InitListExprs.

Note that EmitLambdaLValue was unreachable because in C++11 onwards the
frontend never creates the awkward situation where a prvalue expression
(such as a lambda) is used in an lvalue context (such as the left-hand
side of a class member access).

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

5 years agoAdd -Wctad-maybe-unsupported to diagnose CTAD on types with no user defined deduction...
Eric Fiselier [Thu, 17 Jan 2019 21:44:24 +0000 (21:44 +0000)]
Add -Wctad-maybe-unsupported to diagnose CTAD on types with no user defined deduction guides.

Summary:
Some style guides want to allow using CTAD only on types that "opt-in"; i.e. on types that are designed to support it and not just types that *happen* to work with it.

This patch implements the `-Wctad-maybe-unsupported` warning, which is off by default, which warns when CTAD is used on a type that does not define any deduction guides.

The following pattern can be used to suppress the warning in cases where the type intentionally doesn't define any deduction guides:

```
struct allow_ctad_t;

template <class T>
struct TestSuppression {
  TestSuppression(T) {}
};
TestSuppression(allow_ctad_t)->TestSuppression<void>; // guides with incomplete parameter types are never considered.
```

Reviewers: rsmith, james.dennett, gromer

Reviewed By: rsmith

Subscribers: jdennett, Quuxplusone, lebedev.ri, cfe-commits

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

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

5 years agoFix -Wsign-compare in new tests
Reid Kleckner [Thu, 17 Jan 2019 20:52:46 +0000 (20:52 +0000)]
Fix -Wsign-compare in new tests

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

5 years agoRevert r351209 (which was a revert of r350891) with a fix.
Aaron Ballman [Thu, 17 Jan 2019 20:21:34 +0000 (20:21 +0000)]
Revert r351209 (which was a revert of r350891) with a fix.

The test case had a parse error that was causing the condition string to be misreported. We now have better fallback code for error cases.

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

5 years ago[CodeGenObjC] Use a constant value for non-fragile ivar offsets when possible
Erik Pilkington [Thu, 17 Jan 2019 18:18:53 +0000 (18:18 +0000)]
[CodeGenObjC] Use a constant value for non-fragile ivar offsets when possible

If a class inherits from NSObject and has an implementation, then we
can assume that ivar offsets won't need to be updated by the runtime.
This allows us to index into the object using a constant value and
avoid loading from the ivar offset variable.

This patch was adapted from one written by Pete Cooper.

rdar://problem/10132568

Differential revision: https://reviews.llvm.org/D56802

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

5 years ago[ObjC] Follow-up r350768 and allow the use of unavailable methods that are
Alex Lorenz [Thu, 17 Jan 2019 18:12:45 +0000 (18:12 +0000)]
[ObjC] Follow-up r350768 and allow the use of unavailable methods that are
declared in a parent class from within the @implementation context

This commit extends r350768 and allows the use of methods marked as unavailable
that are declared in a parent class/category from within the @implementation of
the class where the method is marked as unavailable.
This allows users to call init that's marked as unavailable even if they don't
define it.

rdar://47134898

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

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

5 years agoTLS: Respect visibility for thread_local variables on Darwin (PR40327)
Vlad Tsyrklevich [Thu, 17 Jan 2019 17:53:45 +0000 (17:53 +0000)]
TLS: Respect visibility for thread_local variables on Darwin (PR40327)

Summary:
Teach clang to mark thread wrappers for thread_local variables with
hidden visibility when the original variable is marked with hidden
visibility. This is necessary on Darwin which exposes the thread wrapper
instead of the thread variable. The thread wrapper would previously
always be created with default visibility unless it had
linkonce*/weak_odr linkage.

Reviewers: rjmccall

Reviewed By: rjmccall

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

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

5 years agoCodeGen: Cast llvm.flt.rounds result to match __builtin_flt_rounds
Anton Korobeynikov [Thu, 17 Jan 2019 15:21:55 +0000 (15:21 +0000)]
CodeGen: Cast llvm.flt.rounds result to match __builtin_flt_rounds

llvm.flt.rounds returns an i32, but the builtin expects an integer.
On targets where integers are not 32-bits clang tries to bitcast the result, causing an assertion failure.

The patch enables newlib build for msp430.

Patch by Edward Jones!

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

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

5 years ago[NewPM] Add -fsanitize={memory,thread} handling to clang
Philip Pfaffe [Thu, 17 Jan 2019 10:10:47 +0000 (10:10 +0000)]
[NewPM] Add -fsanitize={memory,thread} handling to clang

Summary: This is the missing bit to drive thread and memory sanitizers through clang using the new PassManager.

Reviewers: chandlerc, fedor.sergeev, vitalybuka, leonardchan

Subscribers: bollu, llvm-commits

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

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

5 years ago[CMake][Fuchsia] Disable modules for the second stage build
Petr Hosek [Thu, 17 Jan 2019 04:12:30 +0000 (04:12 +0000)]
[CMake][Fuchsia] Disable modules for the second stage build

This made the toolchain build 50% slower.

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

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

5 years ago[X86] Add custom emission for the avx512 scatter builtins to convert from scalar...
Craig Topper [Thu, 17 Jan 2019 00:34:19 +0000 (00:34 +0000)]
[X86] Add custom emission for the avx512 scatter builtins to convert from scalar integer to vXi1 for the mask arguments to the intrinsics.

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

5 years ago[Frontend] Make WrapperFrontendAction call WrappedAction.PrepareToExecuteAction.
Volodymyr Sapsai [Thu, 17 Jan 2019 00:20:43 +0000 (00:20 +0000)]
[Frontend] Make WrapperFrontendAction call WrappedAction.PrepareToExecuteAction.

Fixes `-emit-header-module` when GenerateHeaderModuleAction is wrapped
by another frontend action.

rdar://problem/47302588

Reviewers: rsmith, arphaman

Reviewed By: arphaman

Subscribers: jkorous, dexonsmith, cfe-commits

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

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

5 years ago[analyzer] Another RetainCountChecker cleanup
George Karpenkov [Wed, 16 Jan 2019 23:21:38 +0000 (23:21 +0000)]
[analyzer] Another RetainCountChecker cleanup

This is not NFC strictly speaking, since it unifies CleanupAttr handling,
so that out parameters now also understand it.

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

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

5 years ago[analyzer] [NFC] Yet another minor cleanup of RetainCountChecker
George Karpenkov [Wed, 16 Jan 2019 23:21:15 +0000 (23:21 +0000)]
[analyzer] [NFC] Yet another minor cleanup of RetainCountChecker

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

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

5 years agoRecommit r351160 "[X86] Make _xgetbv/_xsetbv on non-windows platforms"
Craig Topper [Wed, 16 Jan 2019 22:56:25 +0000 (22:56 +0000)]
Recommit r351160 "[X86] Make _xgetbv/_xsetbv on non-windows platforms"

V8 has been fixed now.

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

5 years ago[X86] Add versions of the avx512 gather intrinsics that take the mask as a vXi1 vecto...
Craig Topper [Wed, 16 Jan 2019 22:34:33 +0000 (22:34 +0000)]
[X86] Add versions of the avx512 gather intrinsics that take the mask as a vXi1 vector instead of a scalar

We need to custom handle these so we can turn the scalar mask into a vXi1 vector.

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

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

5 years agoFix libc++ mac driver test to pass on Windows
Reid Kleckner [Wed, 16 Jan 2019 22:05:34 +0000 (22:05 +0000)]
Fix libc++ mac driver test to pass on Windows

There is a substitution for 'clang-check' to absolutize it, so the
'$(which clang-check)' is unnecessary.

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

5 years agoPR40329: [adl] Fix determination of associated classes when searching a
Richard Smith [Wed, 16 Jan 2019 22:01:39 +0000 (22:01 +0000)]
PR40329: [adl] Fix determination of associated classes when searching a
member enum and then its enclosing class.

There are situations where ADL will collect a class but not the complete
set of associated classes / namespaces of that class. When that
happened, and we later tried to collect those associated classes /
namespaces, we would previously short-circuit the lookup and not find
them. Eg, for:

  struct A : B { enum E; };

if we first looked for associated classes/namespaces of A::E, we'd find
only A. But if we then tried to also collect associated
classes/namespaces of A (which should include the base class B), we
would not add B because we had already visited A.

This also fixes a minor issue where we would fail to collect associated
classes from an overloaded class member access expression naming a
static member function.

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

5 years ago[Fixed Point Arithmetic] Fixed Point Subtraction
Leonard Chan [Wed, 16 Jan 2019 19:53:50 +0000 (19:53 +0000)]
[Fixed Point Arithmetic] Fixed Point Subtraction

This patch covers subtraction between fixed point types and other fixed point
types or integers, using the conversion rules described in 4.1.4 of N1169.

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

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

5 years ago[Fixed Point Arithmetic] Add APFixedPoint to APValue
Leonard Chan [Wed, 16 Jan 2019 18:53:05 +0000 (18:53 +0000)]
[Fixed Point Arithmetic] Add APFixedPoint to APValue

This adds APFixedPoint to the union of values that can be represented with an APValue.

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

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

5 years ago[Fixed Point Arithmetic] Fixed Point Addition
Leonard Chan [Wed, 16 Jan 2019 18:13:59 +0000 (18:13 +0000)]
[Fixed Point Arithmetic] Fixed Point Addition

This patch covers addition between fixed point types and other fixed point
types or integers, using the conversion rules described in 4.1.4 of N1169.

Usual arithmetic rules do not apply to binary operations when one of the
operands is a fixed point type, and the result of the operation must be
calculated with the full precision of the operands, so we should not perform
any casting to a common type.

This patch does not include constant expression evaluation for addition of
fixed point types. That will be addressed in another patch since I think this
one is already big enough.

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

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

5 years agoAdd a REQUIRES: darwin line for a mac test.
Jeremy Morse [Wed, 16 Jan 2019 17:41:29 +0000 (17:41 +0000)]
Add a REQUIRES: darwin line for a mac test.

This test, apparently for macs, fails on Windows as lit can't emulate
the shell subprocess $(which...) correctly. Some other netbsd and linux
buildbots also fail here. Limit to macs as a temporary workaround.

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

5 years agoAdded test cases for dumping variadic-like functions; NFC.
Aaron Ballman [Wed, 16 Jan 2019 16:12:30 +0000 (16:12 +0000)]
Added test cases for dumping variadic-like functions; NFC.

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

5 years agoAdded a test case for dumping blocks that capture 'this'; NFC.
Aaron Ballman [Wed, 16 Jan 2019 15:40:23 +0000 (15:40 +0000)]
Added a test case for dumping blocks that capture 'this'; NFC.

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

5 years ago[MSP430] Improve support of 'interrupt' attribute
Anton Korobeynikov [Wed, 16 Jan 2019 13:44:01 +0000 (13:44 +0000)]
[MSP430] Improve support of 'interrupt' attribute

* Accept as an argument constants in range 0..63 (aligned with TI headers and linker scripts provided with TI GCC toolchain).
* Emit function attribute 'interrupt'='xx' instead of aliases (used in the backend to create a section for particular interrupt vector).
* Add more diagnostics.

Patch by Kristina Bessonova!

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

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

5 years ago[MSP430] Fix msp430-toolchain.c on Windows (added in r351228)
Anton Korobeynikov [Wed, 16 Jan 2019 13:28:30 +0000 (13:28 +0000)]
[MSP430] Fix msp430-toolchain.c on Windows (added in r351228)

Patch by Kristina Bessonova!

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

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

5 years agoSet '-target' flag in the test checking the MacOS include dir
Ilya Biryukov [Wed, 16 Jan 2019 13:18:59 +0000 (13:18 +0000)]
Set '-target' flag in the test checking the MacOS include dir

To fix a buildbot failure on PS4, see
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/42251

The test was added in r351222 and aims to check only a particular
Mac configuration. However it relied on the default compiler target
by default, therefore unintentionally failing on PS4.

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

5 years agoBump the trunk version to 9.0.0svn
Hans Wennborg [Wed, 16 Jan 2019 10:57:02 +0000 (10:57 +0000)]
Bump the trunk version to 9.0.0svn

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

5 years ago[Support] Remove error return value from one overload of fs::make_absolute
Pavel Labath [Wed, 16 Jan 2019 09:55:32 +0000 (09:55 +0000)]
[Support] Remove error return value from one overload of fs::make_absolute

Summary:
The version of make_absolute which accepted a specific directory to use
as the "base" for the computation could never fail, even though it
returned a std::error_code. The reason for that seems to be historical
-- the CWD flavour (which can fail due to failure to retrieve CWD) was
there first, and the new version was implemented by extending that.

This removes the error return value from the non-CWD overload and
reimplements the CWD version on top of that. This enables us to remove
some dead code where people were pessimistically trying to handle the
errors returned from this function.

Reviewers: zturner, sammccall

Subscribers: hiraditya, kristina, llvm-commits

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

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

5 years agoReapply [Tooling] Make clang-tool find libc++ dir on mac when running on a file witho...
Sam McCall [Wed, 16 Jan 2019 09:41:26 +0000 (09:41 +0000)]
Reapply [Tooling] Make clang-tool find libc++ dir on mac when running on a file without compilation database.

This reverts commit r351282, and re-lands r351222 and r351229 with the
use-after-free fixed.

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

5 years ago[NewPM][TSan] Reiterate the TSan port
Philip Pfaffe [Wed, 16 Jan 2019 09:28:01 +0000 (09:28 +0000)]
[NewPM][TSan] Reiterate the TSan port

Summary:
Second iteration of D56433 which got reverted in rL350719. The problem
in the previous version was that we dropped the thunk calling the tsan init
function. The new version keeps the thunk which should appease dyld, but is not
actually OK wrt. the current semantics of function passes. Hence, add a
helper to insert the functions only on the first time. The helper
allows hooking into the insertion to be able to append them to the
global ctors list.

Reviewers: chandlerc, vitalybuka, fedor.sergeev, leonardchan

Subscribers: hiraditya, bollu, llvm-commits

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

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

5 years agoUsersManual.rst: Update the clang-cl flags section
Hans Wennborg [Wed, 16 Jan 2019 09:13:47 +0000 (09:13 +0000)]
UsersManual.rst: Update the clang-cl flags section

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

5 years ago[test] Disable Python binding tests w/ LLVM_ENABLE_PIC=OFF
Michal Gorny [Wed, 16 Jan 2019 08:05:13 +0000 (08:05 +0000)]
[test] Disable Python binding tests w/ LLVM_ENABLE_PIC=OFF

Disable Python binding tests when LLVM_ENABLE_PIC is disabled,
as libclang.so is not being built in that case.  Reported by Nico Weber.

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

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

5 years ago[SEH] Pass the frame pointer from SEH finally to finally functions
Sanjin Sijaric [Wed, 16 Jan 2019 07:39:44 +0000 (07:39 +0000)]
[SEH] Pass the frame pointer from SEH finally to finally functions

Pass the frame pointer that the first finally block receives onto the nested
finally block, instead of generating it using localaddr.

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

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

5 years ago[X86] Correct the type string for __builtin_ia32_gathersiv16sf to make the indices...
Craig Topper [Wed, 16 Jan 2019 07:17:14 +0000 (07:17 +0000)]
[X86] Correct the type string for __builtin_ia32_gathersiv16sf to make the indices an integer type not an FP type.

The element count and width remain the same. This went unnoticed because default conversion from builtin to intrinsic will generate a bitcast if the types don't match.

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

5 years ago[WebAssembly] COWS has been renamed to WASI.
Dan Gohman [Wed, 16 Jan 2019 05:23:57 +0000 (05:23 +0000)]
[WebAssembly] COWS has been renamed to WASI.

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

5 years ago[SemaCXX] Unconfuse Clang when std::align_val_t is unscoped in C++03
Eric Fiselier [Wed, 16 Jan 2019 02:34:36 +0000 (02:34 +0000)]
[SemaCXX] Unconfuse Clang when std::align_val_t is unscoped in C++03

When -faligned-allocation is specified in C++03 libc++ defines
std::align_val_t as an unscoped enumeration type (because Clang didn't
provide scoped enumerations as an extension until 8.0).
Unfortunately Clang confuses the `align_val_t` overloads of delete with
the sized deallocation overloads which aren't enabled. This caused Clang
to call the aligned deallocation function as if it were the sized
deallocation overload.

For example: https://godbolt.org/z/xXJELh

This patch fixes the confusion.

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

5 years ago[EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp
Eli Friedman [Wed, 16 Jan 2019 00:50:44 +0000 (00:50 +0000)]
[EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp

This is the clang counterpart to D56747.

Patch by Mandeep Singh Grang.

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

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

5 years agoRevert "[Tooling] Make clang-tool find libc++ dir on mac when running on a file witho...
Vlad Tsyrklevich [Wed, 16 Jan 2019 00:37:39 +0000 (00:37 +0000)]
Revert "[Tooling] Make clang-tool find libc++ dir on mac when running on a file without compilation database."

This reverts commits r351222 and r351229, they were causing ASan/MSan failures
on the sanitizer bots.

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

5 years agoRe-order type param children of ObjC nodes
Stephen Kelly [Tue, 15 Jan 2019 23:07:30 +0000 (23:07 +0000)]
Re-order type param children of ObjC nodes

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

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

5 years agoNFC: Some cleanups that I missed in the previous commit
Stephen Kelly [Tue, 15 Jan 2019 23:05:11 +0000 (23:05 +0000)]
NFC: Some cleanups that I missed in the previous commit

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

5 years agoRe-order overrides in FunctionDecl dump
Stephen Kelly [Tue, 15 Jan 2019 22:50:37 +0000 (22:50 +0000)]
Re-order overrides in FunctionDecl dump

Output all content which is local to the FunctionDecl before traversing
to child AST nodes.

This is necessary so that all of the part which is local to the
FunctionDecl can be split into a different method.

Reviewers: aaron.ballman

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

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

5 years agoNFC: Replace iterator loop with cxx_range_for
Stephen Kelly [Tue, 15 Jan 2019 22:45:46 +0000 (22:45 +0000)]
NFC: Replace iterator loop with cxx_range_for

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

5 years ago[clang-cl] Alias /Zc:alignedNew[-] to -f[no-]aligned-allocation
Reid Kleckner [Tue, 15 Jan 2019 21:24:55 +0000 (21:24 +0000)]
[clang-cl] Alias /Zc:alignedNew[-] to -f[no-]aligned-allocation

Implements PR40180.

clang-cl has one minor behavior difference with cl with this change.
Clang allows the user to enable the C++17 feature of aligned allocation
without enabling all of C++17, but MSVC will not call the aligned
allocation overloads unless -std:c++17 is passed. While our behavior is
technically incompatible, it would require making driver mode specific
changes to match MSVC precisely, and clang's behavior is useful because
it allows people to experiment with new C++17 features individually.
Therefore, I plan to leave it as is.

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

5 years agoEnable IAS for OpenBSD SPARC.
Brad Smith [Tue, 15 Jan 2019 21:04:36 +0000 (21:04 +0000)]
Enable IAS for OpenBSD SPARC.

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

5 years agoCodeGen: Remove debug printf unintentionally added in r351228.
Peter Collingbourne [Tue, 15 Jan 2019 20:59:59 +0000 (20:59 +0000)]
CodeGen: Remove debug printf unintentionally added in r351228.

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

5 years agoImplement BlockDecl::Capture dump in terms of visitors
Stephen Kelly [Tue, 15 Jan 2019 20:41:37 +0000 (20:41 +0000)]
Implement BlockDecl::Capture dump in terms of visitors

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

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

5 years agoNFC: Implement OMPClause dump in terms of visitors
Stephen Kelly [Tue, 15 Jan 2019 20:31:31 +0000 (20:31 +0000)]
NFC: Implement OMPClause dump in terms of visitors

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

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

5 years agoImplement CXXCtorInitializer dump in terms of Visitor
Stephen Kelly [Tue, 15 Jan 2019 20:17:33 +0000 (20:17 +0000)]
Implement CXXCtorInitializer dump in terms of Visitor

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

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

5 years ago[MSVC Compat] Fix typo correction for inclusion directives.
Volodymyr Sapsai [Tue, 15 Jan 2019 20:08:23 +0000 (20:08 +0000)]
[MSVC Compat] Fix typo correction for inclusion directives.

In MSVC compatibility mode we were checking not the typo corrected
filename but the original filename.

Reviewers: christylee, compnerd

Reviewed By: christylee

Subscribers: jkorous, dexonsmith, sammccall, hokein, cfe-commits

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

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

5 years ago[Nios2] Remove Nios2 backend
Craig Topper [Tue, 15 Jan 2019 19:58:36 +0000 (19:58 +0000)]
[Nios2] Remove Nios2 backend

As mentioned here http://lists.llvm.org/pipermail/llvm-dev/2019-January/129121.html This backend is incomplete and has not been maintained in several months.

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

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

5 years ago[Tooling] Fix broken compliation databse tests.
Haojian Wu [Tue, 15 Jan 2019 19:51:39 +0000 (19:51 +0000)]
[Tooling] Fix broken compliation databse tests.

I forgot to update the unittest in r351222.

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

5 years ago[MSP430] Provide a toolchain description
Anton Korobeynikov [Tue, 15 Jan 2019 19:44:05 +0000 (19:44 +0000)]
[MSP430] Provide a toolchain description

This is an initial implementation for msp430 toolchain including
-mmcu option support
-mhwmult options support
-integrated-as by default

The toolchain uses msp430-elf-as as a linker and supports msp430-gcc toolchain tree.

Patch by Kristina Bessonova!

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

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

5 years ago[Tooling] Make clang-tool find libc++ dir on mac when running on a file without compi...
Haojian Wu [Tue, 15 Jan 2019 19:05:50 +0000 (19:05 +0000)]
[Tooling] Make clang-tool find libc++ dir on mac when running on a file without compilation database.

Summary:
This is a regression of r348365.

When clang-tools run on a file without a complation database (`clang-check /tmp/t.cc`),
we will use fixed compilation database as a fallback. However the actual compiler
path in the fallback complation command is just `clang-tool` which is
insufficient to detect the libc++ dir.

Reviewers: ilya-biryukov, EricWF

Reviewed By: ilya-biryukov

Subscribers: cfe-commits

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

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

5 years ago[Solaris] Move enabling IAS for SPARC from the Solaris toolchain to Generic_GCC.
Brad Smith [Tue, 15 Jan 2019 18:24:03 +0000 (18:24 +0000)]
[Solaris] Move enabling IAS for SPARC from the Solaris toolchain to Generic_GCC.

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

5 years agoFix cpu-dispatch MV regression caused by r347812
Erich Keane [Tue, 15 Jan 2019 17:51:09 +0000 (17:51 +0000)]
Fix cpu-dispatch MV regression caused by r347812

r347812 permitted forward declarations for cpu-dispatch functions, which
are occassionally useful as exposition in  header files.  However, this inadvertently
permitted this function to become multiversioned after a usage.  This
patch ensures that the "CausesMV" checks are still run in the
forward-declaration case.

Change-Id: Icb6f975a2d068f088b89e3bbe26cf1d24f5a972c

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

5 years agoRevert "[X86] Make _xgetbv/_xsetbv on non-windows platforms"
Benjamin Kramer [Tue, 15 Jan 2019 17:23:36 +0000 (17:23 +0000)]
Revert "[X86] Make _xgetbv/_xsetbv on non-windows platforms"

This reverts commit r351160. Breaks building v8.

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