Commit Graph

63329 Commits

Author SHA1 Message Date
Akira Hatanaka d66dc19251 Add a test case to check a member's default constructor is also run.
This is a follow-up to r266645.

llvm-svn: 266706
2016-04-19 02:21:47 +00:00
Adrian Prantl 2526fca8d8 [ObjC++] Fix crash when emitting debug info for a block member capturing this.
rdar://problem/23871824

llvm-svn: 266698
2016-04-18 23:48:16 +00:00
Richard Smith cceb468f36 Mark -Xclang as being a compilation-only option so that the clang driver
doesn't warn if it's passed to a link action. This matches the behavior for
most other compilation-only options (including things like -f flags), and is
necessary to suppress warnings on systems like cmake that always pass all
compile flags to the linker.

llvm-svn: 266695
2016-04-18 23:12:59 +00:00
Richard Smith e64e7459aa [modules] Remove some more unnecessary forwarding functions.
llvm-svn: 266687
2016-04-18 21:54:58 +00:00
Kostya Serebryany f5b25f83e3 [sanitizer-coverage] make sure coverage flags are not passed to clang if the driver thinks they are unused
llvm-svn: 266673
2016-04-18 21:30:17 +00:00
Kostya Serebryany 6453786b26 [sanitizer-coverage] better docs for -fsanitize-coverage=trace-bb
llvm-svn: 266672
2016-04-18 21:28:37 +00:00
Krzysztof Parzyszek e2bd2dcc9d [Hexagon] V60/HVX builtin definitions for clang
The builtins already exist in LLVM, but are not exposed to the C/C++
programmers. This patch adds all the information about the builtins
needed for clang, as well as a test for all available intrinsics.

llvm-svn: 266671
2016-04-18 21:27:59 +00:00
Manman Ren 99d133482f Block: Fix a crash when we have type attributes or qualifiers with omitted
return type.

Emit a warning instead of crashing in IR generation.

rdar://22762981

Differential Revision: http://reviews.llvm.org/D18567

llvm-svn: 266648
2016-04-18 18:40:51 +00:00
Krzysztof Parzyszek 7f0756cc1f [Hexagon] Define macros __HVX__ and __HVXDBL__ when appropriate
llvm-svn: 266647
2016-04-18 18:38:11 +00:00
Akira Hatanaka bd59b4894e [Parser][ObjC] Make sure c++11 in-class initialization is done when the
constructor's definition is in an implementation block.

Without this commit, ptr doesn't get initialized to null in the
following code:

struct S {
  S();
  void *ptr = nullptr;
};

@implementation I
  S::S() {}
@end

rdar://problem/25693624

llvm-svn: 266645
2016-04-18 18:19:45 +00:00
Aaron Ballman 05164816f0 Clarifying the wording of this diagnostic; it confused parameter and argument.
llvm-svn: 266644
2016-04-18 18:10:53 +00:00
JF Bastien dda2cb17a3 NFC: unify clang / LLVM atomic ordering
This makes the C11 / C++11 *ABI* atomic ordering accessible from LLVM,
as discussed in http://reviews.llvm.org/D18200#inline-151433

This re-applies r266574 which I had reverted in r266575.

Depends on http://reviews.llvm.org/D18875

Original review: http://reviews.llvm.org/D18876

llvm-svn: 266641
2016-04-18 18:01:49 +00:00
Xinliang David Li 90364ca1a7 Update InstrProf pass creator API reference
llvm-svn: 266638
2016-04-18 17:48:12 +00:00
Weiming Zhao b061313c5e [ARM] predefines __ELF__ macro for arm-none-eabi
Summary: predefines __ELF__ macro for arm-none-eabi

Reviewers: silviu.baranga, rengolin

Subscribers: aemerson, rengolin, cfe-commits

Differential Revision: http://reviews.llvm.org/D19225

llvm-svn: 266625
2016-04-18 16:25:46 +00:00
Daniel Jasper c3ff0cd8a2 clang-format: Improve heuristics to detect function declarations/definitions.
Specifically understand ellipses in parameter lists and treat trailing
reference qualifiers and the "{" as signals.

llvm-svn: 266599
2016-04-18 11:31:21 +00:00
Mehdi Amini 7322b8bcc0 Add missing include for StringRef (NFC)
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266594
2016-04-18 09:08:59 +00:00
JF Bastien a76c91fbf6 Revert "NFC: unify clang / LLVM atomic ordering"
This reverts commit b0495df9eae2824bee830cc4c94f5441f0d4cbc9.

Same as for the corresponding LLVM revert, an assert seems to fire.

llvm-svn: 266575
2016-04-17 21:28:50 +00:00
JF Bastien 0601a77cf0 NFC: unify clang / LLVM atomic ordering
Summary:
Depends on http://reviews.llvm.org/D18875

This makes the C11 / C++11 *ABI* atomic ordering accessible from LLVM, as discussed in http://reviews.llvm.org/D18200#inline-151433

Reviewers: jyknight, reames

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D18876

llvm-svn: 266574
2016-04-17 21:01:09 +00:00
Faisal Vali 5e9e8ac432 Implement CWG 941 - explicit specializations of deleted function templates
template<class T> void f(T) = delete;
  template<> void f(int); // OK.

  f(3); // OK

Implementation strategy:

When an explicit specialization of a function template, a member function template or a member function of a class template is declared, clang first implicitly instantiates the declaration of a specialization from the templated-entity being explicitly specialized (since their signatures must be the same) and then links the explicit specialization being declared as a redeclaration of the aforementioned specialization.  

The problem was that when clang 'implicitly instantiates' the initial specialization, it marks the corresponding FunctionDecl as deleted if the corresponding templated-entity was deleted, rather than waiting to see whether the explicit specialization being declared provides a non-deleted body. (The eager marking of delete has advantages during overload resolution I suppose, where we don't have to try and instantiate a definition of the function to see if it is deleted). 

The present fix entails recognizing that when clang knows that an explicit specialization is being declared (for whichever templated-entity), the prior implicit instantiation should not inherit the 'deleted' status, and so we reset it to false.

I suppose an alternative fix (amongst others) could consider creating a new context (ExplicitSpecializationDeclarationSubstitution or some such) that is checked during template-argument-deduction and final substitution, and avoid inheriting the deleted status during declaration substitution.  But while conceptually cleaner, that would be a slightly more involved change (as could be some of the other alternatives: such as avoid tagging implicit specializations as deleted, and check their primary templates for the deleted status where needed), and so I chose a different path.  Hopefully it'll prove to not be a bad choice.

llvm-svn: 266561
2016-04-17 17:32:04 +00:00
Duncan P. N. Exon Smith f9521b0bb7 DebugInfo: Make DICompositeTypes distinct most of the time
Since elements of most kinds of DICompositeType have back references,
most are involved in uniquing cycles.  Except via the ODR 'identifier:'
field, which doesn't care about the storage type (see r266549),
they have no hope of being uniqued.

Distinct nodes are far more efficient, so use them for most kinds of
DICompositeType definitions (i.e., when DIType::isForwardDecl is false).
The exceptions:

  - DW_TAG_array_type, since their elements never have back-references
    and they never have ODR 'identifier:' fields;

  - DW_TAG_enumeration_type when there is no ODR 'identifier:' field,
    since their elements usually don't have back-references.

This breaks the last major uniquing cycle I'm aware of in the debug info
graph.  The impact won't be enormous for C++ because references to
ODR-uniqued nodes still use string-based DITypeRefs; but this should
prevent a regression in C++ when we drop the string-based references.

This wouldn't have been reasonable until r266549, when composite types
stopped relying on being uniqued by structural equivalence to prevent
blow-ups at LTO time.

llvm-svn: 266556
2016-04-17 07:45:08 +00:00
Mehdi Amini 357deca829 Add missing headers (fix build after headers cleanup in LLVM)
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266525
2016-04-16 08:14:10 +00:00
Alex Denisov d82f494aa4 Replace hardcoded comment at 'lit.site.cfg.in'
At the moment almost every lit.site.cfg.in contains two lines comment:

  ## Autogenerated by LLVM/Clang configuration.
  # Do not edit!

The patch adds variable LIT_SITE_CFG_IN_HEADER, that is replaced from
configure_lit_site_cfg with the note and some useful information.

llvm-svn: 266516
2016-04-16 06:54:46 +00:00
Richard Smith 20d4701b3d [modules] Don't expose *intrin.h headers that cannot be included standalone as
separate modules. These cause build breakage with -fmodules-local-submodule-visibility.

llvm-svn: 266501
2016-04-16 00:46:26 +00:00
Justin Lebar 423019d059 [CUDA] Raise an error if the CUDA install can't be found.
Summary:
Without this change, we silently proceed on without including
__clang_cuda_runtime_wrapper.h.  This leads to very strange behavior --
you say you're compiling CUDA code, but e.g. __device__ is not defined!

Reviewers: tra

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D19180

llvm-svn: 266496
2016-04-16 00:11:11 +00:00
Richard Smith 4d247e7012 Improve diagnostic for the case when a non-defined function-like macro is used
in a preprocessor constant expression.

llvm-svn: 266495
2016-04-16 00:07:09 +00:00
Nemanja Ivanovic d7d45bf8ce Revert 266186 as it breaks anything that includes type_traits on some platforms
Since this patch provided support for the __float128 type but disabled it
on all platforms by default, some platforms can't compile type_traits with
-std=gnu++11 since there is a specialization with __float128.
This reverts the patch until D19125 is approved (i.e. we know which platforms
need this support enabled).

llvm-svn: 266460
2016-04-15 18:04:13 +00:00
Adrian Prantl 19124d3d7e Fix testcase for MSVC targets where the output ordering is different.
llvm-svn: 266449
2016-04-15 16:21:23 +00:00
Adrian Prantl 80578e7ef0 Update testcase to new debug info metadata format.
llvm-svn: 266447
2016-04-15 16:05:13 +00:00
Adrian Prantl e76bda544b Update to match LLVM changes for PR27284.
(Reverse the ownership between DICompileUnit and DISubprogram.)

http://reviews.llvm.org/D19034
<rdar://problem/25256815>

llvm-svn: 266445
2016-04-15 15:55:45 +00:00
NAKAMURA Takumi 9585fc13f1 ASTMatchers.h: Fix formatting. [-Wdocumentation]
llvm-svn: 266444
2016-04-15 15:42:27 +00:00
Nico Weber 917fc9d7cb Revert r266415, it broke parsing SDK headers (PR27367).
llvm-svn: 266431
2016-04-15 14:35:06 +00:00
Alexey Bader 13465da496 Remove include duplicate. NFC.
llvm-svn: 266428
2016-04-15 13:23:26 +00:00
Andrey Bokhanko f7fa634887 [MSVC Compat] Implementation of __unaligned (MS extension) as a type qualifier
This patch implements __unaligned as a type qualifier; before that, it was
modeled as an attribute. Proper mangling of __unaligned is implemented as well.
Some OpenCL code/tests are tangenially affected, as they relied on existing
number and sizes of type qualifiers.

Differential Revision: http://reviews.llvm.org/D18596

llvm-svn: 266415
2016-04-15 08:03:51 +00:00
Hans Wennborg 12f4f8be90 clang-cl: Don't check for existence of linker inputs when /link is used
There might be flags passed to the linker (e.g. /libpath), causing it
to search in paths the Clang driver doesn't know about.

PR27234

llvm-svn: 266402
2016-04-15 01:12:32 +00:00
Hans Wennborg 84ff1d37fc clang-cl: Make /link accept an optional joined argument.
For example, "cl.exe a.c /linkfoo bar" is a valid invocation and
forwards "foo" and "bar" to link.exe. This makes clang-cl handle
that kind of invocation.

Depends on LLVM r266394.

llvm-svn: 266395
2016-04-15 00:24:15 +00:00
Charles Li 1a88adbb27 Lit C++11 Compatibility Patch #8
24 tests have been updated for C++11 compatibility.

llvm-svn: 266387
2016-04-14 23:47:07 +00:00
Matt Arsenault 1dd2752e7a AMDGPU: Add test for generic builtin behavior
llvm-svn: 266383
2016-04-14 22:34:39 +00:00
Reid Kleckner e1a16467a3 In vector comparisons, handle scalar LHS just as we handle scalar RHS
Summary: Fixes PR27258

Reviewers: rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D19123

llvm-svn: 266366
2016-04-14 21:03:38 +00:00
Richard Smith f32cc293fa Make this code less brittle. The benefits of a fixed-size array aren't worth the maintenance cost.
llvm-svn: 266359
2016-04-14 19:45:19 +00:00
Richard Smith 9c4fb0a833 Fix off-by-one error in worst-case number of offsets needed for an AST record.
llvm-svn: 266353
2016-04-14 18:32:54 +00:00
Aaron Ballman 66eb58a756 Add typedefNameDecl() and typeAliasDecl() to the AST matchers; improves hasType() to match on TypedefNameDecl nodes.
Patch by Clement Courbet.

llvm-svn: 266331
2016-04-14 16:05:45 +00:00
Ismail Donmez f677cd539f Fix testcase for the LLVM_LIBDIR_SUFFIX=64 case. Fallout from r266108.
llvm-svn: 266324
2016-04-14 15:32:24 +00:00
Marianne Mailhot-Sarrasin 03137c6538 clang-format: Last line in incomplete block is indented incorrectly
Indentation of the last line was reset to the initial indentation of the block when reaching EOF.

Patch by Maxime Beaulieu

Differential Revision: http://reviews.llvm.org/D19065

llvm-svn: 266321
2016-04-14 14:56:49 +00:00
Marianne Mailhot-Sarrasin 51fe279fbb clang-format: Implemented tab usage for continuation and indentation
Use tabs to fill whitespace at the start of a line.

Patch by Maxime Beaulieu

Differential Revision: http://reviews.llvm.org/D19028

llvm-svn: 266320
2016-04-14 14:52:26 +00:00
Marianne Mailhot-Sarrasin 4988fa1bc5 clang-format: Allow include of clangFormat.h in managed context
Including VirtualFileSystem.h in the clangFormat.h indirectly includes <atomic>.
This header is blocked when compiling with /clr.

Patch by Maxime Beaulieu

Differential Revision: http://reviews.llvm.org/D19064

llvm-svn: 266319
2016-04-14 14:47:37 +00:00
Gabor Horvath 217a98c0d1 [analyzer] Make it possible to query the function name from a CallDescription.
llvm-svn: 266293
2016-04-14 11:56:28 +00:00
Artem Dergachev 4e7c6fdeeb [ASTImporter] Implement some expression-related AST node import.
Introduce ASTImporter unit test framework.

Fix a memory leak introduced in cf8ccff5: an array is allocated
in ImportArray and never freed.

Support new node kinds:

- GCCAsmStmt

- AddrLabelExpr
- AtomicExpr
- CompoundLiteralExpr
- CXXBoolLiteralExpr
- CXXNullPtrLiteralExpr
- CXXThisExpr
- DesignatedInitExpr
- GNUNullExpr
- ImplicitValueInitExpr
- InitListExpr
- OpaqueValueExpr
- PredefinedExpr
- ParenListExpr
- StmtExpr
- VAArgExpr

- BinaryConditionalOperator
- ConditionalOperator

- FloatingLiteral
- StringLiteral

- InjectedClassNameType
- TemplateTypeParmType

- LabelDecl

Patch by Aleksei Sidorin!

Differential Revision: http://reviews.llvm.org/D14286

llvm-svn: 266292
2016-04-14 11:51:27 +00:00
Nico Weber 51f9eaa5e2 Reapply r258505 after r266254, this time with a comment to make it more sticky.
llvm-svn: 266290
2016-04-14 11:12:32 +00:00
Dmitry Polukhin 9d64f72640 [MSVC] Fix check for wchar_t type in case of -fno-wchar
The example below should work identically with and without compiler native
wchar_t support.

void foo(wchar_t * t = L"");

Differential Revision: http://reviews.llvm.org/D19056

llvm-svn: 266287
2016-04-14 09:52:06 +00:00
Michael Zuckerman 0a3508a8d3 [Clang][AVX512][BUILTIN] Adding support for intrinsics of vpmov{d|q}{b|w|d}{128|256|512} instruction set
Differential Revision: http://reviews.llvm.org/D19055

llvm-svn: 266280
2016-04-14 07:56:51 +00:00
Michael Zuckerman d871531687 [Clang][AVX512][Builtin] Adding intrinsics of vpmovus{d|q}{b|w|d}{128|256|512} instruction set
Differential Revision: http://reviews.llvm.org/D19050

llvm-svn: 266278
2016-04-14 06:48:09 +00:00
Mehdi Amini 3d7224c2a7 Make sure the LLVMContext outlive the CompilerInstance
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266277
2016-04-14 05:37:41 +00:00
Mehdi Amini 59fb3ac51b Do not use llvm:getGlobalContext() in unittests
Currently trying to nuke this API from LLVM.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266276
2016-04-14 05:34:32 +00:00
Richard Smith 72e50fe4ac [modules] Store the location of the lexical update record in a decl update as
an offset from the current record rather than as an absolute bit number. This
gives a minor .pcm file size reduction.

llvm-svn: 266269
2016-04-14 00:50:18 +00:00
Alexander Kornienko f11e099052 Reorder ASTNodeKind::AllKindInfo to match NodeKindId.
Summary:
AllKindInfo is being indexed by NodeKindId, so the order must match.
Extended ASTTypeTraits tests to cover this.

Reviewers: sbenza

Subscribers: cfe-commits, klimek

Differential Revision: http://reviews.llvm.org/D19059

llvm-svn: 266268
2016-04-14 00:47:40 +00:00
Richard Smith 645d2cfd9c [modules] Remove CXX_BASE_SPECIFIERS_OFFSETS table. Instead of storing an ID of
a table entry in the corresponding decl, store an offset from the current
record to the relevant CXX_BASE_SPECIFIERS record. This results in fewer
indirections and a minor .pcm file size reduction.

llvm-svn: 266266
2016-04-14 00:29:55 +00:00
Manman Ren 051d0b620d ObjC kindof: order the methods in global pool relative to availability.
r265877 tries to put methods that are deprecated or unavailable to the
front of the global pool to emit diagnostics, but it breaks some of
our existing codes that depend on choosing a certain method for id
lookup.

This commit orders the methods with the same declaration with respect
to the availability, but do not order methods with different declaration.

rdar://25707511

llvm-svn: 266264
2016-04-13 23:43:56 +00:00
Reid Kleckner 9305fd1f86 [CodeGen] Avoid ctor/dtor boilerplate with some C++11
Non-owning pointers that cache LLVM types and constants can use
'nullptr' default member initializers so that we don't need to mention
them in the constructor initializer list.

Owning pointers should use std::unique_ptr so that we don't need to
manually delete them in the destructor. They also don't need to be
mentioned in the constructor at that point.

NFC

llvm-svn: 266263
2016-04-13 23:37:17 +00:00
Richard Smith aa165cf759 [modules] Remove CXX_CTOR_INITIALIZERS_OFFSETS table. Instead of storing an ID
of a table entry in the corresponding decl, store an offset from the current
record to the relevant CXX_CTOR_INITIALIZERS record. This results in fewer
indirections and a minor .pcm file size reduction.

llvm-svn: 266254
2016-04-13 21:57:08 +00:00
Bruno Cardoso Lopes c54768f7fa [SemaObjC] Properly handle mix between type arguments and protocols.
Under certain conditions clang currently fails to properly diagnostic ObjectC
parameter list when type args and protocols are mixed in the same list. This
happens when the first item in the parameter list is a (1) protocol, (2)
unknown type or (3) a list of protocols/unknown types up to the first type
argument. Fix the problem to report the proper error, example:

NSArray<M, NSValue *, NSURL, NSArray <id <M>>> *foo = @[@"a"];
NSNumber *bar = foo[0];
NSLog(@"%@", bar);

$ clang ...
x.m:7:13: error: angle brackets contain both a type ('NSValue') and a protocol ('M')
        NSArray<M, NSValue *, NSURL, NSArray <id <M>>> *foo = @[@"a"];
                ~  ^

Differential Revision: http://reviews.llvm.org/D18997

rdar://problem/22204367

llvm-svn: 266245
2016-04-13 20:59:07 +00:00
Hans Wennborg 3480435fa8 Make sure CheckDestructor gets called on dllimported classes if the vtable is used (PR27319)
llvm-svn: 266242
2016-04-13 20:21:15 +00:00
Charles Li 64a1a81e76 Lit C++11 Compatibility Patch #7
13 tests have been updated for C++11 compatibility.
Differential Revision: http://reviews.llvm.org/D19068

llvm-svn: 266239
2016-04-13 20:00:45 +00:00
Bruno Cardoso Lopes 50688beb10 [CrashReproducer] Add test to run the reproducer script + modules
Now that we have basic support in place, make sure the reproducer script
works with modules for a simple testcase.

llvm-svn: 266235
2016-04-13 19:28:24 +00:00
Bruno Cardoso Lopes fc8644cd62 [CrashReproducer] Setup 'use-external-names' in YAML files.
Hide the real paths when rebuilding from VFS by setting up the crash
reproducer to use 'use-external-names' = false. This way we avoid
module redifinition errors and consistently use the same paths against
all modules.

With this change on Darwin we are able to simulate a crash for a simple
application using "Foundation/Foundation.h" (which relies on a bunch of
different frameworks and headers) and successfully rebuild all the
modules by relying solely at the VFS overlay.

llvm-svn: 266234
2016-04-13 19:28:21 +00:00
Bruno Cardoso Lopes f6f1def558 [VFS] Move default values to in-class member initialization. NFC
llvm-svn: 266233
2016-04-13 19:28:16 +00:00
Hubert Tong 97b0663492 Remove redundant null-check; NFC
llvm-svn: 266226
2016-04-13 18:41:03 +00:00
David Blaikie bbc00888dd libclang: Use early-return to reduce indentation.
& since I'll get blamed for all the lines anyway, remove some
else-after-return and otherwise tidy things up.

llvm-svn: 266224
2016-04-13 18:36:19 +00:00
David Blaikie 5927257206 Simplify memory management of CXEvalResultKind/ExprEvalResult using unique_ptr and a dtor
This doesn't seem to need to be a C type, C only handles a void*, so use
new/delete as usual to simplify allocation and cleanup.

Follow-up to r265994

llvm-svn: 266222
2016-04-13 18:23:33 +00:00
Devin Coughlin 4ac12425ba [analyzer] Nullability: Suppress diagnostic on bind with cast.
Update the nullability checker to allow an explicit cast to nonnull to
suppress a warning on an assignment of nil to a nonnull:

id _Nonnull x = (id _Nonnull)nil; // no-warning

This suppression as already possible for diagnostics on returns and
function/method arguments.

rdar://problem/25381178

llvm-svn: 266219
2016-04-13 17:59:24 +00:00
Chris Bieneman f5a7ec7a5c [OrderFiles] Don't allow lit to run dtrace multithreaded
Dtrace is implemented to try and minimize performance impact on the process being traced. This results in dtrace dropping samples if it is taking too many CPU resources. Multi-threading dtrace increases the sample drop rate dramatically.

llvm-svn: 266213
2016-04-13 17:12:56 +00:00
Tim Northover 54e5000e2a AArch64: allow 64-bit access to sysregs.
Although all the registers are actually 32-bits, I think we have to assume the
high 32-bits could be RES0 (the ARM ARM is unclear). If so, reading as a 32-bit
register can require extra zero extension operations.

llvm-svn: 266212
2016-04-13 17:08:55 +00:00
Tim Northover 99694feca5 ARM: make Darwin's "-arch armv7em" default to hard-float.
We've already paid the price for separate "armv7m" and "armv7em" slices
(support in other tools), it's silly to make them identical other than the
default CPU.

rdar://23055688

llvm-svn: 266211
2016-04-13 17:08:51 +00:00
Michael Zuckerman e1680617b0 [Clang][AVX512][Builtin] Adding support to intrinsics of pmovs{d|q}{b|w|d}{128|256|512} instruction set
Differential Revision: http://reviews.llvm.org/D19023

llvm-svn: 266202
2016-04-13 15:02:04 +00:00
Aaron Ballman fd00f48fba Reverting r266199; it causes build bot failures.
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/3255
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/3517  

llvm-svn: 266201
2016-04-13 14:53:52 +00:00
Aaron Ballman 4fb7f509fd Add functions declared in ctype.h to builtin function database. All functions are annotated with nothrow and pure attribute, which enables better optimization.
Patch by Taewook Oh.

llvm-svn: 266199
2016-04-13 13:55:58 +00:00
Alexey Bataev 35aaee63cc [OPENMP 4.0] Fixed DSA analysis for taskloop directives.
Patch make clang to perform analysis for task-based directives also for
taskloop-based directives.

llvm-svn: 266198
2016-04-13 13:36:48 +00:00
Michael Zuckerman c2b6128a8f [Clang][AVX512][Builtin] Adding support for VBROADCAST and VPBROADCASTB/W/D/Q instruction set
Differential Revision: http://reviews.llvm.org/D19012

llvm-svn: 266195
2016-04-13 12:58:01 +00:00
Alexander Kornienko 7d20a5afdb Add AST Matchers for CXXConstructorDecl::isDelegatingConstructor and CXXMethodDecl::isUserProvided.
Summary: Added two AST matchers: isDelegatingConstructor for CXXConstructorDecl::IsDelegatingConstructor; and isUserProvided corresponding to CXXMethodDecl::isUserProvided.

Reviewers: aaron.ballman, alexfh

Subscribers: klimek, cfe-commits

Patch by Michael Miller!

Differential Revision: http://reviews.llvm.org/D19038

llvm-svn: 266189
2016-04-13 11:13:08 +00:00
Michael Zuckerman 074edd7c1e [Clang][AVX512][Builtin] Adding supporting to intrinsics of cvt{b|d|q}2mask{128|256|512} and cvtmask2{b|d|q}{128|256|512} instruction set.
Differential Revision: http://reviews.llvm.org/D19009

llvm-svn: 266188
2016-04-13 10:49:37 +00:00
Alexey Bader 01fb4cb34b [modules] Add OpenCLImageTypes.def to module map to fix the modules build.
llvm-svn: 266187
2016-04-13 09:54:47 +00:00
Nemanja Ivanovic 50f29e06a1 Enable support for __float128 in Clang
This patch corresponds to review:
http://reviews.llvm.org/D15120

It adds support for the __float128 keyword, literals and a target feature to
enable it. This support is disabled by default on all targets and any target
that has support for this type is free to add it.

Based on feedback that I've received from target maintainers, this appears to
be the right thing for most targets. I have not heard from the maintainers of
X86 which I believe supports this type. I will subsequently investigate the
impact of enabling this on X86.

llvm-svn: 266186
2016-04-13 09:49:45 +00:00
Alexander Kornienko 6b8ad6a20d Try to use readability-identifier-naming check on Clang.
llvm-svn: 266184
2016-04-13 08:59:49 +00:00
Alexander Kornienko 171b71d1b8 [clang-tidy] Disable misc-unused-parameters for clang.
llvm-svn: 266182
2016-04-13 08:47:42 +00:00
Alexey Bader b62f14400f [OpenCL] Move OpenCLImageTypes.def from clangAST to clangBasic library.
Putting OpenCLImageTypes.def to clangAST library violates layering requirement: "It's not OK for a Basic/ header to include an AST/ header".
This fixes the modules build.

Differential revision: http://reviews.llvm.org/D18954
Reviewers: Richard Smith, Vassil Vassilev.

llvm-svn: 266180
2016-04-13 08:33:41 +00:00
Richard Smith cda2e89578 constexpr -> const to appease MSVC bots.
llvm-svn: 266178
2016-04-13 07:47:38 +00:00
NAKAMURA Takumi 4982b625f0 ASTWriterDecl.cpp: Prune a couple of \param(s), corresponding to r266160. [-Wdocumentation]
llvm-svn: 266177
2016-04-13 07:45:10 +00:00
Richard Smith efc884a466 [modules] Add some missing blockinfo records. No functionality change except to llvm-bcanalyzer output.
llvm-svn: 266176
2016-04-13 07:41:35 +00:00
Chuang-Yu Cheng 8eac7ae9ad [PPC64][VSX] Add a couple of new data types for vec_vsx_ld and vec_vsx_st intrinsics and fix incorrect testcases with minor refactoring
New added data types:
  vector double vec_vsx_ld (int, const double *);
  vector float vec_vsx_ld (int, const float *);
  vector bool short vec_vsx_ld (int, const vector bool short *);
  vector bool int vec_vsx_ld (int, const vector bool int *);
  vector signed int vec_vsx_ld (int, const signed int *);
  vector unsigned int vec_vsx_ld (int, const unsigned int *);

  void vec_vsx_st (vector double, int, double *);
  void vec_vsx_st (vector float, int, float *);
  void vec_vsx_st (vector bool short, int, vector bool short *);
  void vec_vsx_st (vector bool short, int, signed short *);
  void vec_vsx_st (vector bool short, int, unsigned short *);
  void vec_vsx_st (vector bool int, int, vector bool int *);
  void vec_vsx_st (vector bool int, int, signed int *);
  void vec_vsx_st (vector bool int, int, unsigned int *);

Also fix testcases which use non-vector argument version of vec_vsx_ld or
vec_vsx_st, but pass incorrect parameter.

llvm-svn: 266166
2016-04-13 05:16:31 +00:00
Richard Smith f1c23dc4c7 [modules] Refactor handling of cases where we write an offset to a prior record into the bitstream and simplify a little, in preparation for doing this in more cases.
llvm-svn: 266160
2016-04-13 02:12:03 +00:00
Devin Coughlin b2d2a018d6 [analyzer] Nullability: Treat nil _Nonnull ivar as invariant violation.
Treat a _Nonnull ivar that is nil as an invariant violation in a similar
fashion to how a nil _Nonnull parameter is treated as a precondition violation.

This avoids warning on defensive returns of nil on defensive internal
checks, such as the following common idiom:

@class InternalImplementation
@interface PublicClass {
  InternalImplementation * _Nonnull _internal;
}
-(id _Nonnull)foo;
@end

@implementation PublicClass
-(id _Nonnull)foo {
  if (!_internal)
    return nil; // no-warning

  return [_internal foo];
}
@end

rdar://problem/24485171

llvm-svn: 266157
2016-04-13 00:41:54 +00:00
NAKAMURA Takumi 0d8d1d1cb2 clang/test/Driver/cl-options.c: Fix an expression to recognize dos r'\\'.
llvm-svn: 266154
2016-04-13 00:22:25 +00:00
Akira Hatanaka 2d3690bc98 [ObjC] Pop all cleanups created in EmitObjCForCollectionStmt before
exiting the for-in loop.

This commit fixes a bug where EmitObjCForCollectionStmt didn't pop
cleanups for captures.

For example, in the following for-in loop, a block which captures self
is passed to foo1:

for (id x in [self foo1:^{ use(self); }]) {
  use(x);
  break;
}

Previously, the code in EmitObjCForCollectionStmt wouldn't pop the
cleanup for the captured self before exiting the loop, which caused
code-gen to generate an IR in which objc_release was called twice on
the captured self.

This commit fixes the bug by entering a RunCleanupsScope before the
loop condition is evaluated and forcing its cleanup before exiting the
loop.

rdar://problem/16865751

Differential Revision: http://reviews.llvm.org/D18618

llvm-svn: 266147
2016-04-12 23:10:58 +00:00
Manman Ren 16a7d637dd ObjC class properties: add diagnostics for unimplemented class properties.
rdar://24711047

llvm-svn: 266146
2016-04-12 23:01:55 +00:00
Konstantin Zhuravlyov 5124bf8edc [AMDGPU] Add debugger related target options
Differential Revision: http://reviews.llvm.org/D18748

llvm-svn: 266133
2016-04-12 21:42:15 +00:00
David Blaikie 7164767de2 Add a fixme for an old patch I had lying around that I'm not going to finish any time so n
llvm-svn: 266127
2016-04-12 21:22:48 +00:00
Ed Maste 1bc232d342 Always use --eh-frame-hdr on FreeBSD, even for -static
FreeBSD uses LLVM's libunwind on FreeBSD/arm64 today (and is expected to
use it more widely in the future), and it requires the EH frame segment
in static binaries.

This is the same as r203742 for NetBSD.

Differential Revision:	http://reviews.llvm.org/D19029

llvm-svn: 266123
2016-04-12 21:11:46 +00:00
Eric Christopher d5c75eed44 Add a couple of missing vsx load and store intrinsics.
Patch by Jing Yu!

llvm-svn: 266122
2016-04-12 21:08:54 +00:00
Yaxun Liu b5e80c3117 Pass -backend-option to LLVM when there is no target machine.
Clang should pass -backend-option to LLVM even though there is no target machine, since LLVM passes are used when emitting LLVM IR.

Differential Revision: http://reviews.llvm.org/D17552

llvm-svn: 266117
2016-04-12 20:22:32 +00:00
Richard Smith 6893570853 [modules] Extend r266113 to cope with submodules.
llvm-svn: 266116
2016-04-12 20:20:33 +00:00
Richard Smith 58df343b76 [modules] When an incompatible module file is explicitly provided for a module,
and we fall back to textual inclusion, don't require the module as a whole to
be marked available; it's OK if some other file in the same module is missing,
just as it would be if the header were explicitly marked textual.

llvm-svn: 266113
2016-04-12 19:58:30 +00:00