Commit Graph

62023 Commits

Author SHA1 Message Date
Ekaterina Romanova deec50a3d2 This patch adds doxygen comments for the intrinsincs in the header file __wmmintrin_pclmul.h. The doxygen comments are automatically generated based on Sony's intrinsics document.
Differential Revision: http://reviews.llvm.org/D15999

llvm-svn: 259239
2016-01-29 20:37:14 +00:00
Yaron Keren cdae941e03 Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment.
llvm-svn: 259232
2016-01-29 19:38:18 +00:00
Manman Ren ad0e791e0b Class Property: generate metadata for class properties in classes.
The list of class properties is saved in
Old ABI: cls->isa->ext->properties
New ABI: cls->isa->ro->properties

rdar://23891898

llvm-svn: 259229
2016-01-29 19:22:54 +00:00
Manman Ren dfef4069e3 Class Property: warn for synthesize on a class property.
rdar://23891898

llvm-svn: 259226
2016-01-29 19:16:39 +00:00
Manman Ren 0fe61f8688 Class Property: parse @dynamic (class).
rdar://23891898

llvm-svn: 259224
2016-01-29 19:05:57 +00:00
Devin Coughlin 07c451fa4a [analyzer] Suppress null reports from defensive checks in function-like macros.
We already do this for case splits introduced as a result of defensive null
checks in functions and methods, so do the same for function-like macros.

rdar://problem/19640441

llvm-svn: 259222
2016-01-29 18:47:13 +00:00
Anna Zaks ad9e7ea6d7 [analyzer] Improve Nullability checker diagnostics
- Include the position of the argument on which the nullability is violated
- Differentiate between a 'method' and a 'function' in the message wording
- Test for the error message text in the tests
- Fix a bug with setting 'IsDirectDereference' which resulted in regular dereferences assumed to have call context.

llvm-svn: 259221
2016-01-29 18:43:15 +00:00
Hans Wennborg 2b79910d8b Revert r259210 "Extend hasType narrowing matcher for TypedefDecls, add functionProtoType matcher for FunctionProtoType nodes, extend parameterCountIs to FunctionProtoType nodes."
It didn't pass check-clang.

llvm-svn: 259218
2016-01-29 18:24:34 +00:00
Aaron Ballman fb9d0e354d Extend hasType narrowing matcher for TypedefDecls, add functionProtoType matcher for FunctionProtoType nodes, extend parameterCountIs to FunctionProtoType nodes.
Patch by Richard Thomson

llvm-svn: 259210
2016-01-29 17:03:11 +00:00
Aaron Ballman 865a7d8aab Removing unnecessary casts; NFC.
llvm-svn: 259194
2016-01-29 13:53:26 +00:00
Yaron Keren c6d8a57edf Implement TemplateArgument::dump() method for debugging, patterned after TemplateName::dump().
llvm-svn: 259192
2016-01-29 13:46:15 +00:00
Benjamin Kramer 987a1d21e7 Add an optional ToolName argument to runToolOnCodeWithArgs/buildASTFromCodeWithArgs.
This can be used as a way to modify argv[0] for a clang tool.

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

llvm-svn: 259187
2016-01-29 11:29:02 +00:00
Ulrich Weigand 1a0c1804b3 Add target triple to CodeGenOpenCL/pipe_types.cl test case
The test is failing on SystemZ since different IR is being
generated due to platform ABI differences.  Add a target triple.

Fix suggested by Anastasia Stulova.

llvm-svn: 259183
2016-01-29 10:45:23 +00:00
Nathan Wilson 4661c610be [Concepts] Implement a portion of Concepts TS[dcl.spec.concept]p5 and p6:
Diagnose if the return type of a function concept or declaration type of a
variable concept is not bool.

Reviewers: hubert.reinterpretcast

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

llvm-svn: 259159
2016-01-29 04:43:59 +00:00
Craig Topper 07390fedee Remove unnecessary forward declaration. NFC
llvm-svn: 259156
2016-01-29 04:01:09 +00:00
Eric Christopher 65de644e81 Add the clang debug info test directory to .gitignore as it's managed separately.
llvm-svn: 259138
2016-01-29 01:35:55 +00:00
Eric Christopher d160c50f6b Use a consistent spelling for vtables.
llvm-svn: 259137
2016-01-29 01:35:53 +00:00
Justin Lebar c0e42750da [CUDA] Generate CUDA's printf alloca in its function's entry block.
Summary:
This is necessary to prevent llvm from generating stacksave intrinsics
around this alloca.  NVVM doesn't have a stack, and we don't handle said
intrinsics.

Reviewers: rnk, echristo

Subscribers: cfe-commits, jhen, tra

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

llvm-svn: 259122
2016-01-28 23:58:28 +00:00
Manman Ren 494ee5b049 Class Property: change PropertyMap to include isClassProperty.
PropertyMap used to map IdentifierInfo (name of the property) to
ObjcPropertyDecl *. Now that a class property can have the same name as
an instance property, we change PropertyMap to map a pair <IdentifierInfo *,
unsigned> to ObjcPropertyDecl *.

Also update a few places from iterating over instance_properties to
iterating over all properties.

rdar://23891898

llvm-svn: 259119
2016-01-28 23:36:05 +00:00
Devin Coughlin 134de6ffd8 [analyzer] NullabilityChecker: Remove unused isReturnSelf() function.
Remove the now-unused isReturnSelf() function so we don't get a compiler
warning. Apologies for not doing this in r259099.

llvm-svn: 259118
2016-01-28 23:34:13 +00:00
Manman Ren 581c2b9d46 Check for frontend errors after releasing the Builder.
Frontend can emit errors when releaseing the Builder. If there are errors before
or when releasing the Builder, we reset the module to stop here before invoking
the backend.

Before this commit, clang will continue to invoke the backend and backend can
crash.

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

llvm-svn: 259116
2016-01-28 23:29:02 +00:00
Rafael Espindola 29dfc23373 Update for llvm change.
llvm-svn: 259108
2016-01-28 22:56:41 +00:00
Devin Coughlin de21767a4d [analyzer] Suppress nullability warnings in copy, mutableCopy, and init families.
There are multiple, common idioms of defensive nil-checks in copy,
mutableCopy, and init methods in ObjC. The analyzer doesn't currently have the
capability to distinguish these idioms from true positives, so suppress all
warnings about returns in those families. This is a pretty blunt suppression
that we should improve later.

rdar://problem/24395811

llvm-svn: 259099
2016-01-28 22:23:34 +00:00
Sunil Srivastava e7f0058c39 Implementation of PS4 ABI, Round 1
Added a test to safeguard linux ABI.

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

llvm-svn: 259095
2016-01-28 21:36:31 +00:00
Nico Weber 7b837f578a Include RecordDecls from anonymous unions in the AST.
For

  void f() {
    union { int i; };
  }

clang used to omit the RecordDecl from the anonymous union from the AST.
That's because the code creating it only called PushOnScopeChains(), which adds
it to the current DeclContext, which here is the function's DeclContext. But
RecursiveASTVisitor doesn't descent into all decls in a FunctionDecl.

Instead, for DeclContexts that contain statements, return the RecordDecl so
that it can be included in the DeclStmt containing the VarDecl for the union.

Interesting bits from the AST before this change:

|-FunctionDecl
| `-CompoundStmt
|   |-DeclStmt
|   | `-VarDecl 0x589cd60 <col:3> col:3 implicit used 'union (anonymous at test.cc:3:3)' callinit

After this change:

-FunctionDecl
| `-CompoundStmt
|   |-DeclStmt
|   | |-CXXRecordDecl 0x4612e48 <col:3, col:18> col:3 union definition
|   | | |-FieldDecl 0x4612f70 <col:11, col:15> col:15 referenced i 'int'
|   | `-VarDecl 0x4613010 <col:3> col:3 implicit used 'union (anonymous at test.cc:3:3)' callinit

This is now closer to how anonymous struct and unions are represented as
members of structs.  It also enabled deleting some one-off code in the
template instantiation code.

Finally, it fixes a crash with ASTMatchers, see the included test case
(this fixes http://crbug.com/580749).

llvm-svn: 259079
2016-01-28 19:25:00 +00:00
Nico Weber 16f7e554a1 Remove unused parameter.
llvm-svn: 259077
2016-01-28 19:12:32 +00:00
Manman Ren 5b786407d0 Class Property: class property and instance property can have the same name.
Add "enum ObjCPropertyQueryKind" to a few APIs that used to only take the name
of the property: ObjCPropertyDecl::findPropertyDecl,
ObjCContainerDecl::FindPropertyDeclaration,
ObjCInterfaceDecl::FindPropertyVisibleInPrimaryClass,
ObjCImplDecl::FindPropertyImplDecl, and Sema::ActOnPropertyImplDecl.

ObjCPropertyQueryKind currently has 3 values:
OBJC_PR_query_unknown, OBJC_PR_query_instance, OBJC_PR_query_class

This extra parameter specifies that we are looking for an instance property with
the given name, or a class property with the given name, or any property with
the given name (if both exist, the instance property will be returned).

rdar://23891898

llvm-svn: 259070
2016-01-28 18:49:28 +00:00
Xinliang David Li 3106d9a122 [PGO] test case cleanups
1. Make test case more focused and robust by focusing on what to be tested (linkage, icall) -- make it easier to validate
2. Testing linkages of data and counter variables instead of names. Counters and data are more relavant to be tested.

llvm-svn: 259067
2016-01-28 18:25:53 +00:00
Nico Weber b0dd911f16 Fix strange indent.
llvm-svn: 259063
2016-01-28 18:06:31 +00:00
Vedant Kumar bc6b80a0ff [Coverage] Use a set to track visited FileIDs (NFC)
llvm-svn: 259061
2016-01-28 17:52:18 +00:00
Oliver Stannard 92d4c328d1 Revert r259036, it introduces a cyclic library dependency
llvm-svn: 259043
2016-01-28 13:09:49 +00:00
Oliver Stannard 7a964feccb Add backend dignostic printer for unsupported features
Re-commit of r258950 after fixing layering violation.

Add backend dignostic printer for unsupported features

The related LLVM patch adds a backend diagnostic type for reporting
unsupported features, this adds a printer for them to clang.

In the case where debug location information is not available, I've
changed the printer to report the location as the first line of the
function, rather than the closing brace, as the latter does not give the
user any information. This also affects optimisation remarks.

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

llvm-svn: 259036
2016-01-28 10:07:34 +00:00
Yury Gribov 154e57f832 Fix isBeforeInTranslationUnit to not abort on macros defined in cmdline.
Differential Revision: http://reviews.llvm.org/D15804

llvm-svn: 259031
2016-01-28 09:28:18 +00:00
Yury Gribov 976892fefc Small refactor in isBeforeInTranslationUnit.
Differential Revision: http://reviews.llvm.org/D15804

llvm-svn: 259030
2016-01-28 09:27:46 +00:00
Craig Topper 3efc7c0c46 [Lex] Share some common code between decimal and octal parsing in NumericLiteralParser.
There were a couple slight variations between the two copies that I don't believe were intentional. For example, only one of the paths checked for digit separations proceeding a '.', but I think the lexer itself splits the token if a digit separator proceeds a period.

llvm-svn: 259022
2016-01-28 05:22:54 +00:00
NAKAMURA Takumi 628a7a0aef Revert r258951 (and r258950), "Refactor backend diagnostics for unsupported features"
It broke layering violation in LLVMIR.

clang r258950 "Add backend dignostic printer for unsupported features"
llvm  r258951 "Refactor backend diagnostics for unsupported features"

llvm-svn: 259016
2016-01-28 04:41:32 +00:00
George Burgess IV a2f29fa694 [Sema] Make extended vectors of `bool` an error.
In OpenCL, `bool` vectors are a reserved type, and are therefore
illegal.

Outside of OpenCL, if we try to make an extended vector of N `bool`s,
Clang will lower it to an `[N x i1]`. LLVM has no ABI for bitvectors, so
lots of operations on such vectors are thoroughly broken. As a result,
this patch makes them illegal in everything else, as well. :)

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

llvm-svn: 259011
2016-01-28 01:38:18 +00:00
Mike Aizatsky 3828cbbf9f [sancov] sancov tool documentation
Differential Revision: http://reviews.llvm.org/D16432

llvm-svn: 259000
2016-01-27 23:56:12 +00:00
Evgeniy Stepanov 2952bf5005 Strengthen cfi-check-fail test.
r258993 allows stricter testing for basic block labels by making
sure that they are always followed by ":". Use this to improve the
test.

llvm-svn: 258997
2016-01-27 22:28:56 +00:00
Tim Northover 4c9ac7d7df ARMv7k: simplify logic for deciding sjlj-exceptions.
Slight change of behaviour in the odd armv7+watchos case, which should match
the other runtime components.

llvm-svn: 258994
2016-01-27 22:14:02 +00:00
Daniel Jasper 15b01116d9 clang-format: [Java] Remove unnecessary line break after complex annotations
Before:
  @Annotation("Some"
      + " text")
  List<Integer>
      list;

After:
  @Annotation("Some"
      + " text")
  List<Integer> list;

llvm-svn: 258981
2016-01-27 20:14:23 +00:00
Manman Ren d36f7d5a9a Class Property: create accessors (class methods) for class property.
Change a few places where we assume property accessors can only be instance
methods.

rdar://23891898

llvm-svn: 258980
2016-01-27 20:10:32 +00:00
Manman Ren efe1bacd92 Class Property: handle class properties.
At places where we handle instance properties, if necessary.

rdar://23891898

llvm-svn: 258979
2016-01-27 20:00:32 +00:00
Tim Northover d88ecb30a1 ARMv7k: select ABI based on v7k Arch rather than watchos OS.
Various bits we'd like to use the new ABI actually compile with "-arch armv7k
-miphoneos-version-min=9.0". Not ideal, but also not ridiculous given how
slices work.

llvm-svn: 258976
2016-01-27 19:32:40 +00:00
John McCall e399e5bd3d Emit calls to objc_unsafeClaimAutoreleasedReturnValue when
reclaiming a call result in order to ignore it or assign it
to an __unsafe_unretained variable.  This avoids adding
an unwanted retain/release pair when the return value is
not actually returned autoreleased (e.g. when it is returned
from a nonatomic getter or a typical collection accessor).

This runtime function is only available on the latest Apple
OS releases; the backwards-compatibility story is that you
don't get the optimization unless your deployment target is
recent enough.  Sorry.

rdar://20530049

llvm-svn: 258962
2016-01-27 18:32:30 +00:00
Oliver Stannard 5e03a4b837 Add backend dignostic printer for unsupported features
The related LLVM patch adds a backend diagnostic type for reporting
unsupported features, this adds a printer for them to clang.

In the case where debug location information is not available, I've
changed the printer to report the location as the first line of the
function, rather than the closing brace, as the latter does not give the
user any information. This also affects optimisation remarks.

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

llvm-svn: 258950
2016-01-27 17:30:28 +00:00
Chris Bieneman 94d6788f9a Adding back in a test that I inadvertently removed in r258862
llvm-svn: 258935
2016-01-27 15:51:56 +00:00
Benjamin Kramer 5e45630edf Update for LLVM change.
llvm-svn: 258918
2016-01-27 10:01:30 +00:00
Daniel Marjamaki e114669caf Fix array index out of bounds
Differential Revision: http://reviews.llvm.org/D16582

llvm-svn: 258911
2016-01-27 07:33:50 +00:00
Yunzhong Gao 7cbc78e72b Adding a test for PR25717.
The test tries to produce a large preprocessed output to the console, and checks
that we do not see any unexpected fatal errors.

The test is not enabled unless a lit parameter "--param enable_console=1" is
passed on the command line to lit.py.

llvm-svn: 258902
2016-01-27 02:18:28 +00:00