Commit Graph

76983 Commits

Author SHA1 Message Date
Aaron Ballman b0d74bfe81 Merge similar target diagnostics for interrupt attribute into one; NFC
Patch by Kristina Bessonova!

llvm-svn: 351969
2019-01-23 18:02:17 +00:00
Richard Smith cfa79b27b5 [ubsan] Check the correct size when sanitizing array new.
We previously forgot to multiply the element size by the array bound.

llvm-svn: 351924
2019-01-23 03:37:29 +00:00
Akira Hatanaka 957accaef0 [Sema][ObjC] Check whether a DelayedDiagnosticPool has been pushed
before adding a delayed diagnostic to DelayedDiagnostics.

This fixes an assertion failure in Sema::DelayedDiagnostics::add that
was caused by the changes made in r141037.

rdar://problem/42782323

llvm-svn: 351911
2019-01-23 00:55:48 +00:00
Vladimir Stefanovic ad255c80e5 [mips] Replace help-text for '-m{no}-relax-pic-calls'. NFC
Thanks to Simon Dardis for the new text.

llvm-svn: 351889
2019-01-22 22:33:53 +00:00
George Karpenkov a9e295604a [analyzer] Insert notes in RetainCountChecker where our dynamic cast modeling assumes 'null' output
rdar://47397214

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

llvm-svn: 351865
2019-01-22 19:51:00 +00:00
George Karpenkov db0c66eeb0 [analyzer] Model another special-case kind of cast for OSObject RetainCountChecker
Differential Revision: https://reviews.llvm.org/D56951

llvm-svn: 351864
2019-01-22 19:50:47 +00:00
Raphael Isemann 1c5d23f140 [ASTImporter] Fix importing OperatorDelete from CXXConstructorDecl
Summary:
Shafik found out that importing a CXXConstructorDecl will create a translation unit that
causes Clang's CodeGen to crash. The reason for that is that we don't copy the OperatorDelete
from the CXXConstructorDecl when importing. This patch fixes it and adds a test case for that.

Reviewers: shafik, martong, a_sidorin, a.sidorin

Reviewed By: martong, a_sidorin

Subscribers: rnkovacs, cfe-commits

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

llvm-svn: 351849
2019-01-22 17:59:45 +00:00
Hans Wennborg a5f7e5b8dc ReleaseNotes: remove openmp notes from r351580
They were for the 8.0 branch, and have been committed there in r351839.

llvm-svn: 351841
2019-01-22 17:01:39 +00:00
Eli Friedman 3f82f9e127 [CodeGen] Always use string computed in Sema for PredefinedExpr
We can't use any other string, anyway, because its type wouldn't
match the type of the PredefinedExpr.

With this change, we don't compute a "nice" name for the __func__ global
when it's used in the initializer for a constant. This doesn't seem like
a great loss, and I'm not sure how to fix it without either storing more
information in the AST, or somehow threading through the information
from ExprConstant.cpp.

This could break some situations involving BlockDecl; currently,
CodeGenFunction::EmitPredefinedLValue has some logic to intentionally
emit a string different from what Sema computed.  This code skips that
logic... but that logic can't work correctly in general anyway.  (For
example, sizeof(__func__) returns the wrong result.) Hopefully this
doesn't affect practical code.

Fixes https://bugs.llvm.org/show_bug.cgi?id=40313 .

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

llvm-svn: 351766
2019-01-22 00:11:17 +00:00
Michal Gorny 4d54038279 [test] Pass -ccc-install-dir in mac compilation db test
Pass -ccc-install-dir explicitly as the compilation database code does
not pass argv[0] to getMainExecutable(), while some systems require it
to return the correct path.  Since the relevant code is apparently only
applicable to Darwin, just pass correct -ccc-install-dir to make
the tests pass on *BSD systems.

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

llvm-svn: 351752
2019-01-21 17:05:43 +00:00
Aaron Ballman a2b04ad5c4 Mark the lambda function pointer conversion operator as noexcept.
This implements CWG DR 1722 and fixes PR40309. Patch by Ignat Loskutov.

llvm-svn: 351750
2019-01-21 16:25:08 +00:00
Aaron Ballman f9694fdbbc Regenerating the C++ DR status page from the latest Core issues list.
llvm-svn: 351749
2019-01-21 16:21:14 +00:00
Anastasia Stulova 5cffa45401 [OpenCL] Allow address spaces as method qualifiers.
Methods can now be qualified with address spaces to prevent
undesirable conversions to generic or to provide custom 
implementation to be used if the object is located in certain
memory segments.

This commit extends parsing and standard C++ overloading to
work for an address space of a method (i.e. implicit 'this'
parameter).

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

llvm-svn: 351747
2019-01-21 16:01:38 +00:00
Adam Balogh cfa434ae41 [Analyzer] Remove extra blank line from Iterator Checker (test commit)
llvm-svn: 351746
2019-01-21 15:31:23 +00:00
Johannes Doerfert e068d054e8 [NFC] Fix comparison warning issues by MSVC
llvm-svn: 351744
2019-01-21 14:23:46 +00:00
Jonas Toth 67b7e23fa1 [clang] add tests to ExprMutAnalyzer that reproduced a crash in ASTMatchers
Summary:
This patch adds two unit-tests that are the result of reducing a crashing TU
when running ExprMutAnalyzer over it. They are added only to ensure the regression
that has been fixed with https://reviews.llvm.org/D56444 don't creep back.

Reviewers: aaron.ballman, sammccall, rsmith, george.karpenkov

Reviewed By: sammccall

Subscribers: baloghadamsoftware, a.sidorin, Szelethus, donat.nagy, dkrupp, cfe-commits

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

llvm-svn: 351743
2019-01-21 13:26:18 +00:00
Sam Parker a96f8461e7 [AArch64] Use LL for 64-bit intrinsic arguments
The ACLE states that 64-bit crc32, wsr, rsr and rbit operands are
uint64_t so we should have the clang builtin match this description
- which is what we already do for AArch32.

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

llvm-svn: 351740
2019-01-21 11:01:05 +00:00
Raphael Isemann 4e4c0664f9 [ASTImporter] Add test for importing anonymous namespaces.
Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: a_sidorin, martong, cfe-commits

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

llvm-svn: 351739
2019-01-21 10:14:31 +00:00
Chandler Carruth 4a1b95bda0 Fix typos throughout the license files that somehow I and my reviewers
all missed!

Thanks to Alex Bradbury for pointing this out, and the fact that I never
added the intended `legacy` anchor to the developer policy. Add that
anchor too. With hope, this will cause the links to all resolve
successfully.

llvm-svn: 351731
2019-01-21 09:52:34 +00:00
Petr Hosek 9c178356e0 [Driver] Don't pass default value to getCompilerRTArgString
Using static library is already a default.

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

llvm-svn: 351710
2019-01-21 01:34:09 +00:00
Petr Hosek 6d58c9e2b2 [CMake][Fuchsia] Drop -DNDEBUG, re-enable modules
-DNDEBUG is no longer needed now that we don't enable assertions,
modules should improve build times for the second stage.

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

llvm-svn: 351709
2019-01-21 01:06:50 +00:00
Craig Topper 98b761541e [X86] Add missing test cases for some int/fp->fp conversion intrinsics with rounding mode. Use non-default rounding mode on some tests.
For some reason we were missing tests for several unmasked conversion intrinsics, but had their mask form.

Also use a non-default rounding mode on some tests to provide better coverage for a future patch.

llvm-svn: 351708
2019-01-20 23:49:50 +00:00
Serge Guelton c190404249 Tentative fix for r351701 and gcc 6.2 build on ubuntu
llvm-svn: 351706
2019-01-20 23:43:37 +00:00
Serge Guelton be88539b85 Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...>
As noted in https://bugs.llvm.org/show_bug.cgi?id=36651, the specialization for
isPodLike<std::pair<...>> did not match the expectation of
std::is_trivially_copyable which makes the memcpy optimization invalid.

This patch renames the llvm::isPodLike trait into llvm::is_trivially_copyable.
Unfortunately std::is_trivially_copyable is not portable across compiler / STL
versions. So a portable version is provided too.

Note that the following specialization were invalid:

    std::pair<T0, T1>
    llvm::Optional<T>

Tests have been added to assert that former specialization are respected by the
standard usage of llvm::is_trivially_copyable, and that when a decent version
of std::is_trivially_copyable is available, llvm::is_trivially_copyable is
compared to std::is_trivially_copyable.

As of this patch, llvm::Optional is no longer considered trivially copyable,
even if T is. This is to be fixed in a later patch, as it has impact on a
long-running bug (see r347004)

Note that GCC warns about this UB, but this got silented by https://reviews.llvm.org/D50296.

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

llvm-svn: 351701
2019-01-20 21:19:56 +00:00
Craig Topper 9fddc3fd00 [X86] Remove the cvtuqq2ps256/cvtqq2ps256 mask builtins. Replace with uitofp/sitofp and select.
Reviewers: RKSimon, spatel

Reviewed By: RKSimon

Subscribers: kristina, cfe-commits

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

llvm-svn: 351694
2019-01-20 19:04:56 +00:00
Simon Pilgrim a7bcd72c0a [X86] Replace VPCOM/VPCOMU with generic integer comparisons (clang)
These intrinsics can always be replaced with generic integer comparisons without any regression in codegen, even for -O0/-fast-isel cases.

Noticed while cleaning up vector integer comparison costs for PR40376.

A future commit will remove/autoupgrade the existing VPCOM/VPCOMU llvm intrinsics.

llvm-svn: 351687
2019-01-20 16:40:33 +00:00
Johannes Doerfert 685a9ea294 [FIX] Generalize the expected results for callback clang tests
llvm-svn: 351665
2019-01-19 20:46:10 +00:00
Chandler Carruth d564d346a3 Update the license mentioned in this documentation.
llvm-svn: 351651
2019-01-19 11:48:15 +00:00
Stephen Kelly 8805f67da9 [ASTDump] NFC: Convert iterative loops to cxx_range_for
This is coming up a lot in reviews. Better just to change them all at
once.

llvm-svn: 351647
2019-01-19 09:57:59 +00:00
Stephen Kelly aaebc5f2c5 [ASTDump] NFC: Use `const auto` in cxx_range_for loops
This is coming up a lot in reviews. Better just to do them all at once.

llvm-svn: 351646
2019-01-19 09:57:51 +00:00
Johannes Doerfert 7c31f455af [FIX] Restrict callback pthreads_create test to linux only
llvm-svn: 351643
2019-01-19 09:40:10 +00:00
Johannes Doerfert 14b1a6ad4c [NFC] Generalize expected output for callback test
llvm-svn: 351642
2019-01-19 09:40:08 +00:00
Chandler Carruth f71e94dd98 Update the license header in this man-page file.
It contains an `$Id$` expansion and so can only be updated from a true
Subversion client.

See the details of this update in r351636.

llvm-svn: 351640
2019-01-19 09:24:38 +00:00
Stephen Kelly 25f18bfd4f Move decl context dumping to TextNodeDumper
Summary: Only an obscure case is moved.

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 351637
2019-01-19 09:05:55 +00:00
Chandler Carruth 2946cd7010 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.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Chandler Carruth 4a50956c07 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.

llvm-svn: 351634
2019-01-19 06:36:08 +00:00
Chandler Carruth d92d70b7f0 Remove random windows line endings that snuck into the middle of this
code.

llvm-svn: 351633
2019-01-19 06:36:00 +00:00
Chandler Carruth 79b37483c8 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.

llvm-svn: 351632
2019-01-19 06:29:07 +00:00
Chandler Carruth 469bdefd44 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

llvm-svn: 351631
2019-01-19 06:14:24 +00:00
Johannes Doerfert ac991bbb44 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

llvm-svn: 351629
2019-01-19 05:36:54 +00:00
Artem Dergachev 097a049740 [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

llvm-svn: 351610
2019-01-18 23:05:07 +00:00
Artem Dergachev c2c47f24f5 [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

llvm-svn: 351609
2019-01-18 22:52:13 +00:00
Stephen Kelly 44283aa485 [ASTDump] Add test for current AST dump behavior
llvm-svn: 351606
2019-01-18 22:15:13 +00:00
Stephen Kelly 1e07f4e2e7 [ASTDump] NFC: Move variable into if() statement
llvm-svn: 351605
2019-01-18 22:15:09 +00:00
Stephen Kelly 4e35baa842 [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.

llvm-svn: 351604
2019-01-18 22:15:05 +00:00
Stephen Kelly f4129fd58b [ASTDump] NFC: Remove non-needed braces
llvm-svn: 351603
2019-01-18 22:14:59 +00:00
Stephen Kelly bbd08cce79 [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

llvm-svn: 351601
2019-01-18 22:00:16 +00:00
Stephen Kelly 5110ebd9fe [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

llvm-svn: 351600
2019-01-18 21:55:24 +00:00
Stephen Kelly 149119dc5f [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

llvm-svn: 351597
2019-01-18 21:38:30 +00:00
Erik Pilkington 14d47cfd49 [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

llvm-svn: 351595
2019-01-18 21:33:23 +00:00