Commit Graph

4144 Commits

Author SHA1 Message Date
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
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
Chandler Carruth d564d346a3 Update the license mentioned in this documentation.
llvm-svn: 351651
2019-01-19 11:48:15 +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
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 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
Rafael Stahl 8c48705a19 [analyzer][CrossTU][NFC] Generalize to external definitions instead of external functions
Summary: This is just changing naming and documentation to be general about external definitions that can be imported for cross translation unit analysis. There is at least a plan to add VarDecls: D46421

Reviewers: NoQ, xazax.hun, martong, a.sidorin, george.karpenkov, serge-sans-paille

Reviewed By: xazax.hun, martong

Subscribers: mgorny, whisperity, baloghadamsoftware, szepet, rnkovacs, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits

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

llvm-svn: 350852
2019-01-10 17:44:04 +00:00
Ivan Donchevskii c05e6f430e [libclang] Fix clang_Cursor_isAnonymous
Use the same logic as in TypePrinter::printTag to determine that the tag is anonymous and the separate check for namespaces.

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

llvm-svn: 350805
2019-01-10 09:34:44 +00:00
Alexander Kornienko 935df0659f Remove dependency-related arguments in clang-check.
This is the default behavior of clang tools, but clang-check overrides default
argument adjusters for some reason.

llvm-svn: 350727
2019-01-09 15:00:06 +00:00
Alex Lorenz a19cb2eb6f [libclang] Fix the mismatched delete operator for ExprEvalResult
The '.stringVal' field in ExprEvalResult is allocated using new[],
but was freed using a regular delete. That caused memory leaks in
the test from r350666.

llvm-svn: 350680
2019-01-08 23:28:37 +00:00
Alex Lorenz 65317e1ca0 [libclang] Recommit r336590 with a fix for the memory leak in the test
The original commit had a memory leak in the test has a leak as it doesn't
dispose of the evaluated cursor result.

This also contains the follow-up NFC refactoring commit r336591.

rdar://45893054

Original commit message:

[libclang] evalute compound statement cursors before trying to evaluate
the cursor like a declaration

This change fixes a bug in libclang in which it tries to evaluate a statement
cursor as a declaration cursor, because that statement still has a pointer to
the declaration parent.

rdar://38888477

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

llvm-svn: 350666
2019-01-08 22:32:51 +00:00
Serge Guelton f886c03e47 Portable Python script across Python version
StringIO is obsoleted in Python3, replaced by io.BytesIO or io.StringIO depending on the use.

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

llvm-svn: 350318
2019-01-03 14:26:56 +00:00
Alex Lorenz 977ffd7b8f [libclang] CoroutineBody/Coreturn statements are UnexposedStmts and not Exprs
This change ensures that the libclang CXCursor represents the CoroutineBody
and the Coreturn statement using the appropriate CXCursor_UnexposedStmt kind
instead of CXCursor_UnexposedExpr. The problem with CXCursor_UnexposedExpr is
that the consumer functions assumed that CoroutineBody/Coreturn statements
were valid expressions and performed an invalid downcast to Expr causing
assertion failures or other crashes.

rdar://40204290

llvm-svn: 350282
2019-01-03 01:13:33 +00:00
David Blaikie 0da49a7ef1 PR40096: Forwards-compatible with C++20 rule regarding aggregates not having user-declared ctors
Looks like these were in place to make these types move-only. That's
generally not a feature that the type should prescribe (unless it's an
inherent limitation) - instead leaving it up to the users of a type.

llvm-svn: 349669
2018-12-19 19:33:35 +00:00
Serge Guelton c177c3a5a9 Portable Python script across Python version
urllib2 as been renamed into urllib and the library layout has changed.
Workaround that in a consistent manner.

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

llvm-svn: 349627
2018-12-19 13:46:13 +00:00
Serge Guelton b748c0e696 Portable Python script across Python version
Make scripts more future-proof by importing most __future__ stuff.

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

llvm-svn: 349504
2018-12-18 16:07:37 +00:00
Serge Guelton 3ee1ffc9fc Portable Python script across Python version
commands.getoutput has been move to subprocess module in Python3

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

llvm-svn: 349503
2018-12-18 16:07:06 +00:00
Serge Guelton d458974c45 Portable Python script across Python version
In Python3, dict.items, dict.keys, dict.values, zip, map and filter no longer return lists, they create generator instead.

The portability patch consists in forcing an extra `list` call if the result is actually used as a list.
`map` are replaced by list comprehension and `filter` by filtered list comprehension.

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

llvm-svn: 349501
2018-12-18 16:04:21 +00:00
Haojian Wu ef87c26796 [AST] Unify the code paths of traversing lambda expressions.
Summary:
This supposes to be a non-functional change. We have two code paths when
traversing lambda expressions:

1) traverse the function proto typeloc when parameters and return type
are explicit;
2) otherwise fallback to traverse parameter decls and return type loc
individually;

This patch unifies the code path to always traverse parameters and
return type, rather than relying on traversing the full type-loc.

Reviewers: ilya-biryukov

Subscribers: arphaman, cfe-commits

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

llvm-svn: 349494
2018-12-18 15:29:12 +00:00
Serge Guelton c0ebe773cd Portable Python script across Python version
Using from __future__ import print_function it is possible to have a compatible behavior of `print(...)` across Python version.

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

llvm-svn: 349454
2018-12-18 08:36:33 +00:00
Serge Guelton 73cf752f1b Portable Python script across Python version
ConfigParser module has been renamed as configparser in Python3

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

llvm-svn: 349449
2018-12-18 08:25:25 +00:00
Serge Guelton 366c089bb3 Portable Python script across Python version
dict no longer have the `has_key` method in Python3. Instead, one can
use the `in` keyword which already works in Python2.

llvm-svn: 349447
2018-12-18 08:22:47 +00:00
Fangrui Song 7643f42bdd [libclang] Add dependency on clangSerialization to unbreak -DBUILD_SHARED_LIBS=1 build after rC349237
Frontend headers have undefined reference on the symbol `clang::PCHContainerOperations::PCHContainerOperations()` through some shared_ptr usage. Any dependents will get the undefined reference which can only be resolved by explicit dependency on clangSerialization (due to -z defs).

llvm-svn: 349259
2018-12-15 08:54:06 +00:00
Richard Trieu d2e5accdd6 Fix includes and dependencies for libclang
Remove unneeded includes
Add needed include
Remove dependency on Serialization

llvm-svn: 349237
2018-12-15 04:25:19 +00:00
Aaron Ballman 7d880862d2 Update the scan-build to generate SARIF.
This updates the scan-build perl script to allow outputting to sarif in a more natural fashion by specifying -sarif as a command line argument, similar to how -plist is already supported.

llvm-svn: 349082
2018-12-13 20:55:34 +00:00
Mikael Nilsson 9d2872db74 [OpenCL] Add generic AS to 'this' pointer
Address spaces are cast into generic before invoking the constructor.

Added support for a trailing Qualifiers object in FunctionProtoType.

Note: This recommits the previously reverted patch, 
      but now it is commited together with a fix for lldb.

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

llvm-svn: 349019
2018-12-13 10:15:27 +00:00
Serge Guelton 040ee58795 Portable Python script across Python version
SocketServer has been renamed socketserver in Python3.

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

llvm-svn: 349010
2018-12-13 07:45:55 +00:00
Serge Guelton b3835de3ee Portable Python script across Python version
Use higher-level and more compatible threading module to start a new thread.

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

llvm-svn: 349008
2018-12-13 07:42:30 +00:00
Steven Wu 098742faa9 [Driver] Add support for -fembed-bitcode for assembly file
Summary:
Handle -fembed-bitcode for assembly inputs. When the input file is
assembly, write a marker as "__LLVM,__asm" section.

Fix llvm.org/pr39659

Reviewers: compnerd, dexonsmith

Reviewed By: compnerd

Subscribers: rjmccall, dblaikie, jkorous, cfe-commits

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

llvm-svn: 348943
2018-12-12 17:30:16 +00:00
Mikael Nilsson 90646732bf Revert "[OpenCL] Add generic AS to 'this' pointer"
Reverting because the patch broke lldb.

llvm-svn: 348931
2018-12-12 15:06:16 +00:00
Alex Bradbury f7dc77e942 [clang-fuzzer] Add explicit dependency on clangSerialization for clangHandleCXX after rC348907
This library was breaking my -DBUILD_SHARED_LIBS=1 build. rC348915 seemed to miss this case.

As this seems an "obvious" fix, I am committing without pre-commit review as
per the LLVM developer policy.

llvm-svn: 348929
2018-12-12 14:33:24 +00:00
Mikael Nilsson 78de84719b [OpenCL] Add generic AS to 'this' pointer
Address spaces are cast into generic before invoking the constructor.

Added support for a trailing Qualifiers object in FunctionProtoType.

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

llvm-svn: 348927
2018-12-12 14:11:59 +00:00
Fangrui Song 5313327f61 Add explicit dependency on clangSerialization for a bunch of components to fix -DBUILD_SHARED_LIBS=on build
This is a more thorough fix of rC348911.
The story about -DBUILD_SHARED_LIBS=on build after rC348907 (Move PCHContainerOperations from Frontend to Serialization) is:

1. libclangSerialization.so defines PCHContainerReader dtor, ...
2. clangFrontend and clangTooling define classes inheriting from PCHContainerReader, thus their DSOs have undefined references on PCHContainerReader dtor
3. Components depending on either clangFrontend or clangTooling cannot be linked unless they have explicit dependency on clangSerialization due to the default linker option -z defs. The explicit dependency could be avoided if libclang{Frontend,Tooling}.so had these undefined references.

This patch adds the explicit dependency on clangSerialization to make them build.

llvm-svn: 348915
2018-12-12 08:02:18 +00:00
Ivan Donchevskii c5929138f5 [libclang] Revert removal of tidy plugin support from libclang introduced in r347496
Differential Revision: https://reviews.llvm.org/D55415

llvm-svn: 348764
2018-12-10 15:58:50 +00:00
Serge Guelton dc7d7e3fe8 Portable Python script across Python version
Workaround naming and hierarchy changes in BaseHTTPServer and SimpleHTTPServer module.

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

llvm-svn: 348184
2018-12-03 20:26:51 +00:00
Serge Guelton f606a5ae62 Portable Python script across Python version
Python2 supports both backticks and `repr` to access the __repr__ slot. Python3 only supports `repr`.

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

llvm-svn: 348182
2018-12-03 20:12:34 +00:00
Serge Guelton 09616bdb4a Portable Python script across version
Have all classes derive from object: that's implicitly the default in Python3,
it needs to be done explicilty in Python2.

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

llvm-svn: 348127
2018-12-03 12:12:48 +00:00
Serge Guelton 3de410848c Portable Python script across Python version
Python2 supports the two following equivalent construct

	raise ExceptionType, exception_value
and
	raise ExceptionType(exception_value)

Only the later is supported by Python3.

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

llvm-svn: 348126
2018-12-03 12:11:21 +00:00
Richard Trieu 8e0e80fc9f [diagtool] Remove unneeded header includes.
llvm-svn: 347726
2018-11-28 03:59:35 +00:00
Ivan Donchevskii 60b7103ce8 [libclang] Fix clang_Cursor_getNumArguments and clang_Cursor_getArgument for CXXConstructExpr
Constructors have the same methods for arguments as call expressions.
Let's provide a way to get their arguments the same way.

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

llvm-svn: 347654
2018-11-27 12:02:39 +00:00
Sander de Smalen 44a2253a54 [AArch64] Add aarch64_vector_pcs function attribute to Clang
This is the Clang patch to complement the following LLVM patches:
  https://reviews.llvm.org/D51477
  https://reviews.llvm.org/D51479

More information describing the vector ABI and procedure call standard
can be found here:

https://developer.arm.com/products/software-development-tools/\
                          hpc/arm-compiler-for-hpc/vector-function-abi

Patch by Kerry McLaughlin.

Reviewed By: rjmccall

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

llvm-svn: 347571
2018-11-26 16:38:37 +00:00
Benjamin Kramer da113f3202 Remove the optional dependency from libclang to clang-tidy/include-fixer
clangd does a better job on both of these, so don't slow down everyone's build
for a poorly working libclang feature.

llvm-svn: 347496
2018-11-23 15:02:33 +00:00
Fangrui Song cabb36d38d [libclang] Unify getCursorDecl and getCursorParentDecl
They do the same thing, thus the latter (which has only 2 call sites) can be deleted.

llvm-svn: 347293
2018-11-20 08:00:00 +00:00
David Blaikie 9941da4191 Sink BuryPointer from Clang into LLVM for reuse there
llvm-svn: 347141
2018-11-17 18:04:13 +00:00
Andrew Savonichev 3fee351867 [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension
Summary:
Documentation can be found at https://www.khronos.org/registry/OpenCL/extensions/intel/cl_intel_device_side_avc_motion_estimation.txt

Patch by Kristina Bessonova


Reviewers: Anastasia, yaxunl, shafik

Reviewed By: Anastasia

Subscribers: arphaman, sidorovd, AlexeySotkin, krisb, bader, asavonic, cfe-commits

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

llvm-svn: 346392
2018-11-08 11:25:41 +00:00
Andrew Savonichev 3b12b7e702 Revert r346326 [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation
This patch breaks Index/opencl-types.cl LIT test:

Script:
--
: 'RUN: at line 1';   stage1/bin/c-index-test -test-print-type llvm/tools/clang/test/Index/opencl-types.cl -cl-std=CL2.0 | stage1/bin/FileCheck llvm/tools/clang/test/Index/opencl-types.cl
--
Command Output (stderr):
--
llvm/tools/clang/test/Index/opencl-types.cl:3:26: warning: unsupported OpenCL extension 'cl_khr_fp16' - ignoring [-Wignored-pragmas]
llvm/tools/clang/test/Index/opencl-types.cl:4:26: warning: unsupported OpenCL extension 'cl_khr_fp64' - ignoring [-Wignored-pragmas]
llvm/tools/clang/test/Index/opencl-types.cl:8:9: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
llvm/tools/clang/test/Index/opencl-types.cl:11:8: error: declaring variable of type 'half' is not allowed
llvm/tools/clang/test/Index/opencl-types.cl:15:3: error: use of type 'double' requires cl_khr_fp64 extension to be enabled
llvm/tools/clang/test/Index/opencl-types.cl:16:3: error: use of type 'double4' (vector of 4 'double' values) requires cl_khr_fp64 extension to be enabled
llvm/tools/clang/test/Index/opencl-types.cl:26:26: warning: unsupported OpenCL extension 'cl_khr_gl_msaa_sharing' - ignoring [-Wignored-pragmas]
llvm/tools/clang/test/Index/opencl-types.cl:35:44: error: use of type '__read_only image2d_msaa_t' requires cl_khr_gl_msaa_sharing extension to be enabled
llvm/tools/clang/test/Index/opencl-types.cl:36:49: error: use of type '__read_only image2d_array_msaa_t' requires cl_khr_gl_msaa_sharing extension to be enabled
llvm/tools/clang/test/Index/opencl-types.cl:37:49: error: use of type '__read_only image2d_msaa_depth_t' requires cl_khr_gl_msaa_sharing extension to be enabled
llvm/tools/clang/test/Index/opencl-types.cl:38:54: error: use of type '__read_only image2d_array_msaa_depth_t' requires cl_khr_gl_msaa_sharing extension to be enabled

llvm-svn: 346338
2018-11-07 18:34:19 +00:00
Andrew Savonichev 35dfce723c [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension
Summary:
Documentation can be found at https://www.khronos.org/registry/OpenCL/extensions/intel/cl_intel_device_side_avc_motion_estimation.txt

Patch by Kristina Bessonova


Reviewers: Anastasia, yaxunl, shafik

Reviewed By: Anastasia

Subscribers: arphaman, sidorovd, AlexeySotkin, krisb, bader, asavonic, cfe-commits

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

llvm-svn: 346326
2018-11-07 15:44:01 +00:00
Patrick Lyster 7a2a27c4a4 Add support for 'atomic_default_mem_order' clause on 'requires' directive. Also renamed test files relating to 'requires'. Differntial review: https://reviews.llvm.org/D53513
llvm-svn: 345967
2018-11-02 12:18:11 +00:00
Gabor Horvath 9c0fdc15e0 [analyzer][CTU] Correctly signal in the function index generation tool if there was an error
Differential Revision: https://reviews.llvm.org/D53979

llvm-svn: 345965
2018-11-02 11:22:22 +00:00