]> granicus.if.org Git - clang/log
clang
8 years agoARM: allow both vfma and vfms intrinsics on v7.
Tim Northover [Tue, 2 Feb 2016 18:02:10 +0000 (18:02 +0000)]
ARM: allow both vfma and vfms intrinsics on v7.

The main purpose here is that vfma/vfms should be symmetric, and they are
supported on most v7 cores.

The new ArchGuard is suggested by ACLE but prophylactic for us. Almost all CPUs
with NEON *will* have vfma, and the few exceptions I know of (e.g. Cortex-A8)
are incorrectly modelled by Clang so can't trigger a test.

Fortunately, they're getting rarer. But if we ever do support them properly
arm_neon.h should now do the right thing.

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

8 years agoPR23057: Fix assertion `Val && "isa<> used on a null pointer"' on invalid for-range...
Denis Zobnin [Tue, 2 Feb 2016 17:33:09 +0000 (17:33 +0000)]
PR23057: Fix assertion `Val && "isa<> used on a null pointer"' on invalid for-range expression.

Fix the issue discovered by fuzzing (PR23057, comment 18) by handling nullptr in Sema::ActOnCXXForRangeDecl
and correct delayed typos in for-range expression before calling Sema::ActOnCXXForRangeStmt. Also fixes PR26288.

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

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

8 years agoMake CodeGen headers self-contained.
Benjamin Kramer [Tue, 2 Feb 2016 16:05:18 +0000 (16:05 +0000)]
Make CodeGen headers self-contained.

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

8 years agoMake the remaining headers self-contained.
Benjamin Kramer [Tue, 2 Feb 2016 14:24:21 +0000 (14:24 +0000)]
Make the remaining headers self-contained.

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

8 years ago[StaticAnalyzer] Pull SymExpr and SymbolData into its own header to avoid cyclic...
Benjamin Kramer [Tue, 2 Feb 2016 14:24:11 +0000 (14:24 +0000)]
[StaticAnalyzer] Pull SymExpr and SymbolData into its own header to avoid cyclic includes.

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

8 years agoAdd backend dignostic printer for unsupported features
Oliver Stannard [Tue, 2 Feb 2016 13:52:52 +0000 (13:52 +0000)]
Add backend dignostic printer for unsupported features

Re-commit of r258950 after fixing layering violation.

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.

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

8 years agoFix for PR8901: attribute "mode" rejected for enums and dependent types.
Denis Zobnin [Tue, 2 Feb 2016 13:50:39 +0000 (13:50 +0000)]
Fix for PR8901: attribute "mode" rejected for enums and dependent types.

Allow "mode" attribute for enum types, except for vector modes, for compatibility with GCC.
Support "mode" attribute with dependent types.

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

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

8 years agoTest commit (NFC).
Denis Zobnin [Tue, 2 Feb 2016 12:39:08 +0000 (12:39 +0000)]
Test commit (NFC).

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

8 years ago[OpenCL] Eliminate warning when declaring OpenCL builtin functions.
Anastasia Stulova [Tue, 2 Feb 2016 11:29:43 +0000 (11:29 +0000)]
[OpenCL] Eliminate warning when declaring OpenCL builtin functions.

OpenCL builtin functions are usually declared in header files.
Currently clang emits warning for OpenCL builtin functions
which have the same name as standard C library functions.

This commit eliminates such warnings by not adding the C standard
includes following the restriction from OpenCL v1.2 s6.9.f.

Patch by Liu Yaxun (Sam)!

Review: http://reviews.llvm.org/D16692

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

8 years agoMake headers self-contained.
Benjamin Kramer [Tue, 2 Feb 2016 11:06:57 +0000 (11:06 +0000)]
Make headers self-contained.

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

8 years agoMove DebugInfoKind into its own header to cut the cyclic dependency edge from Driver...
Benjamin Kramer [Tue, 2 Feb 2016 11:06:51 +0000 (11:06 +0000)]
Move DebugInfoKind into its own header to cut the cyclic dependency edge from Driver to Frontend.

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

8 years agoclang-format: Make AlignAfterOpenBracket also affect angle brackets.
Daniel Jasper [Tue, 2 Feb 2016 10:28:11 +0000 (10:28 +0000)]
clang-format: Make AlignAfterOpenBracket also affect angle brackets.

Patch by Matthew Whitehead, thank you.

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

8 years ago[OPENMP 4.0] Allow to use 'omp simd' directive inside other simd-regions.
Alexey Bataev [Tue, 2 Feb 2016 04:59:52 +0000 (04:59 +0000)]
[OPENMP 4.0] Allow to use 'omp simd' directive inside other simd-regions.

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

8 years ago[OpenMP] Prevent nesting of target constructs within target code execution regions.
Arpith Chacko Jacob [Tue, 2 Feb 2016 04:00:47 +0000 (04:00 +0000)]
[OpenMP] Prevent nesting of target constructs within target code execution regions.

Summary:
This patch enhances Sema to check for the following restriction:

OpenMP 4.5 [2.17 Nesting of Regions]
If a target, target update, target data, target enter data, or
target exit data construct is encountered during execution of a
target region, the behavior is unspecified.

Reviewers: ABataev

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

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

8 years ago[asan] Add iOS support for Address Sanitizer
Anna Zaks [Tue, 2 Feb 2016 02:04:48 +0000 (02:04 +0000)]
[asan] Add iOS support for Address Sanitizer

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

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

8 years agoTemplate Type Diffing change
Richard Trieu [Tue, 2 Feb 2016 00:36:59 +0000 (00:36 +0000)]
Template Type Diffing change

When all the arguments of a template are elided, print "A<...>" instead of
"A<[2 * ...]>".  Also remove comment fragment that means nothing.

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

8 years agoAlways build a new TypeSourceInfo for function templates with parameters
Nico Weber [Mon, 1 Feb 2016 22:31:51 +0000 (22:31 +0000)]
Always build a new TypeSourceInfo for function templates with parameters

RecursiveASTVisitor::TraverseFunctionHelper() traverses a function's
ParmVarDecls by going to the function's getTypeSourceInfo if it exists, and
`DEF_TRAVERSE_TYPELOC(FunctionProtoType` then goes to the function's
ParmVarDecls.

For a function template that doesn't have parameters that explicitly depend on
the template parameter, we used to be clever and not build a new
TypeSourceInfo. That meant that when an instantiation of such a template is
visited, its TypeSourceInfo would point to the ParmVarDecls of the template,
not of the instantiation, which then confused clients of RecursiveASTVisitor.

So don't be clever for function templates that have parameters, even if none of
the parameters depend on the type.

Fixes PR26257.
http://reviews.llvm.org/D16478

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

8 years agoUndoing commit r259366 to debug buildbot failure.
Arpith Chacko Jacob [Mon, 1 Feb 2016 22:02:05 +0000 (22:02 +0000)]
Undoing commit r259366 to debug buildbot failure.
> http://reviews.llvm.org/D16758

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

8 years agoCode clean up; NFC.
Aaron Ballman [Mon, 1 Feb 2016 21:28:33 +0000 (21:28 +0000)]
Code clean up; NFC.

Patch by Alexander Riccio.

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

8 years agoFix attribute((mode([word|unwind_word]))) for x32
Reid Kleckner [Mon, 1 Feb 2016 18:58:24 +0000 (18:58 +0000)]
Fix attribute((mode([word|unwind_word]))) for x32

Patch by H.J. Lu

```
typedef unsigned int gcc_word __attribute__((mode(word)));
```
and

```
typedef unsigned int gcc_unwind_word __attribute__((mode(unwind_word)));
```
define the largest unsigned integer types which can be stored in a
general purpose register, which may not be the pointer type.  For x32,
they aren't pointer nor unsigned long.  We should

1. Make getUnwindWordWidth and getRegisterWidth virtual,
2. Override them for x32, similar to hasInt128Type.
3. Use getRegisterWidth for __attribute__((mode(word)));

This fixes PR 24706.

Reviewers: rnk

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

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

8 years agodocs: Clarify that cfi-unrelated-cast is based on lifetime.
Peter Collingbourne [Mon, 1 Feb 2016 18:55:50 +0000 (18:55 +0000)]
docs: Clarify that cfi-unrelated-cast is based on lifetime.

Also restore Makefile.sphinx which is needed to build the documentation.

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

8 years agoMove LocInfoType from Sema to AST.
Benjamin Kramer [Mon, 1 Feb 2016 17:42:01 +0000 (17:42 +0000)]
Move LocInfoType from Sema to AST.

While transient and only used during parsing, LocInfoTypes are still used
from ASTDumper and are part of the AST.

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

8 years ago[OpenMP] Prevent nesting of target constructs within target code execution regions.
Arpith Chacko Jacob [Mon, 1 Feb 2016 16:32:47 +0000 (16:32 +0000)]
[OpenMP] Prevent nesting of target constructs within target code execution regions.

Summary:
This patch enhances Sema to check for the following restriction:

OpenMP 4.5 [2.17 Nesting of Regions]
If a target, target update, target data, target enter data, or
target exit data construct is encountered during execution of a
target region, the behavior is unspecified.

Reviewers: ABataev

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

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

8 years agoReapply r259210 with a fix for RegistryTest.cpp.
Aaron Ballman [Mon, 1 Feb 2016 14:11:47 +0000 (14:11 +0000)]
Reapply r259210 with a fix for RegistryTest.cpp.

Patch by Richard Thomson.

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

8 years agoRemove the egregious PCHContainer layering hack that doesn't seem to be necessary...
Benjamin Kramer [Mon, 1 Feb 2016 13:22:39 +0000 (13:22 +0000)]
Remove the egregious PCHContainer layering hack that doesn't seem to be necessary anymore.

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

8 years agoclang-format: Fix incorrect pointer detection in lambdas in constructor
Daniel Jasper [Mon, 1 Feb 2016 11:21:07 +0000 (11:21 +0000)]
clang-format: Fix incorrect pointer detection in lambdas in constructor
initializers.

Before:
  Constructor() : member([](A *a, B * b) {}) {}

After:
  Constructor() : member([](A *a, B *b) {}) {}

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

8 years agoclang-format: Add option to disable string literal formatting.
Daniel Jasper [Mon, 1 Feb 2016 11:21:02 +0000 (11:21 +0000)]
clang-format: Add option to disable string literal formatting.

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

8 years agoclang-format: Fix alignment of trailing multiline columns.
Daniel Jasper [Mon, 1 Feb 2016 11:20:55 +0000 (11:20 +0000)]
clang-format: Fix alignment of trailing multiline columns.

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

8 years agoclang-format: [JS] Treat "in" as a proper operator.
Daniel Jasper [Mon, 1 Feb 2016 11:20:47 +0000 (11:20 +0000)]
clang-format: [JS] Treat "in" as a proper operator.

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

8 years ago[analyzer] Use a wider integer type for an array index.
Artem Dergachev [Mon, 1 Feb 2016 09:29:17 +0000 (09:29 +0000)]
[analyzer] Use a wider integer type for an array index.

Avoids unexpected overflows while performing pointer arithmetics in 64-bit code.
Moreover, neither PointerDiffType nor 'int' can be used as a common array index
type because arrays may have size (and indexes) more than PTRDIFF_MAX but less
than SIZE_MAX.

Patch by Aleksei Sidorin!

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

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

8 years agoMark DR1250 as implemented
David Majnemer [Mon, 1 Feb 2016 01:33:17 +0000 (01:33 +0000)]
Mark DR1250 as implemented

We implemented this DR back in r258768 but forgot to mark it as
implemented.

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

8 years agoReplace usage of llvm::utostr_32 with just llvm::utostr. While this is less efficient...
Craig Topper [Sun, 31 Jan 2016 04:20:03 +0000 (04:20 +0000)]
Replace usage of llvm::utostr_32 with just llvm::utostr. While this is less efficient, its unclear that the one place using the _32 version was doing so for efficiency.

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

8 years ago[Parser] Update CachedTokens while parsing ObjectiveC template argument list
Bruno Cardoso Lopes [Sun, 31 Jan 2016 00:47:51 +0000 (00:47 +0000)]
[Parser] Update CachedTokens while parsing ObjectiveC template argument list

Consider the following ObjC++ snippet:

--
@protocol PA;
@protocol PB;

@class NSArray<ObjectType>;
typedef int some_t;

id<PA> FA(NSArray<id<PB>> *h, some_t group);
--

This would hit an assertion in the parser after generating an annotation token
while trying to update the token cache:

Assertion failed: (CachedTokens[CachedLexPos-1].getLastLoc() == Tok.getAnnotationEndLoc() && "The annotation should be until the most recent cached token")
...
7 clang::Preprocessor::AnnotatePreviousCachedTokens(clang::Token const&) + 494
8 clang::Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec(bool, bool, clang::CXXScopeSpec&, bool) + 1163
9 clang::Parser::TryAnnotateTypeOrScopeToken(bool, bool) + 361
10 clang::Parser::isCXXDeclarationSpecifier(clang::Parser::TPResult, bool*) + 598
...

The cached preprocessor token in this case is:

greatergreater '>>' Loc=<testcase.mm:7:24>

while the annotation ("NSArray<id<PB>>") ends at "testcase.mm:7:25", hence the
assertion.

Properly update the CachedTokens during template parsing to contain
two greater tokens instead of a greatergreater.

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

rdar://problem/23494277

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

8 years agoNo need to use utostr when putting integers into a raw_ostream. NFC
Craig Topper [Sun, 31 Jan 2016 00:20:26 +0000 (00:20 +0000)]
No need to use utostr when putting integers into a raw_ostream. NFC

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

8 years agoConvert an unsigned to Twine instead of using utostr since we're already building...
Craig Topper [Sun, 31 Jan 2016 00:20:24 +0000 (00:20 +0000)]
Convert an unsigned to Twine instead of using utostr since we're already building a Twine. NFC

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

8 years ago[AST] Pull simple method inline.
Benjamin Kramer [Sat, 30 Jan 2016 12:16:23 +0000 (12:16 +0000)]
[AST] Pull simple method inline.

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

8 years agoassert(false) -> llvm_unreachable().
Davide Italiano [Sat, 30 Jan 2016 08:03:54 +0000 (08:03 +0000)]
assert(false) -> llvm_unreachable().

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

8 years ago[analyzer] Make suppression of macro defensive checks work with -analyzer-eagerly...
Devin Coughlin [Sat, 30 Jan 2016 01:59:33 +0000 (01:59 +0000)]
[analyzer] Make suppression of macro defensive checks work with -analyzer-eagerly-assume.

This is the default for the analyzer but the flag is added by the driver so
our suppression tests didn't cover this case.

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

8 years ago[SemaCXX] Fix crash-on-invalid while trying to deduce return type of a lambda.
Argyrios Kyrtzidis [Sat, 30 Jan 2016 01:51:20 +0000 (01:51 +0000)]
[SemaCXX] Fix crash-on-invalid while trying to deduce return type of a lambda.

rdar://22032373

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

8 years agoAvoid overly large SmallPtrSet/SmallSet
Matthias Braun [Sat, 30 Jan 2016 01:27:06 +0000 (01:27 +0000)]
Avoid overly large SmallPtrSet/SmallSet

These sets perform linear searching in small mode so it is never a good
idea to use SmallSize/N bigger than 32.

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

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

8 years agoRemove references to autotools build.
Alexey Samsonov [Sat, 30 Jan 2016 00:54:42 +0000 (00:54 +0000)]
Remove references to autotools build.

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

8 years agoThis patch adds doxygen comments for the intrinsincs in the header file __wmmintrin_a...
Ekaterina Romanova [Fri, 29 Jan 2016 23:59:00 +0000 (23:59 +0000)]
This patch adds doxygen comments for the intrinsincs in the header file __wmmintrin_aes.h.
The doxygen comments are automatically generated based on Sony's intrinsics document.

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

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

8 years agoImprove -Wconstant-conversion
Richard Trieu [Fri, 29 Jan 2016 23:51:16 +0000 (23:51 +0000)]
Improve -Wconstant-conversion

Switch the evaluation from isIntegerConstantExpr to EvaluateAsInt.
EvaluateAsInt will evaluate more types of expressions than
isIntegerConstantExpr.

Move one case from -Wsign-conversion to -Wconstant-conversion.  The case is:
1) Source and target types are signed
2) Source type is wider than the target type
3) The source constant value is positive
4) The conversion will store the value as negative in the target.

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

8 years agoClass Property: generate metadata for class properties in protocols.
Manman Ren [Fri, 29 Jan 2016 23:46:55 +0000 (23:46 +0000)]
Class Property: generate metadata for class properties in protocols.

The list of class properties is saved in
Old ABI: protocol->ext->class_properties (protocol->ext->size will be updated)
New ABI: protocol->class_properties (protocol->size will be updated)

rdar://23891898

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

8 years agoClass Property: generate metadata for class properties in categories.
Manman Ren [Fri, 29 Jan 2016 23:45:01 +0000 (23:45 +0000)]
Class Property: generate metadata for class properties in categories.

The list of class properties is saved in
Old ABI: category->class_properties (category->size will be updated as well)
New ABI: category->class_properties (a flag in objc_image_info to indicate
         whether or not the list of class properties is present)

rdar://23891898

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

8 years ago[UBSan] Add documentation for runtime issue suppression.
Alexey Samsonov [Fri, 29 Jan 2016 23:07:14 +0000 (23:07 +0000)]
[UBSan] Add documentation for runtime issue suppression.

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

8 years agoThis patch adds doxygen comments for the intrinsincs in the header file __wmmintrin_p...
Ekaterina Romanova [Fri, 29 Jan 2016 20:37:14 +0000 (20:37 +0000)]
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

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

8 years agoAnnotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post...
Yaron Keren [Fri, 29 Jan 2016 19:38:18 +0000 (19:38 +0000)]
Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment.

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

8 years agoClass Property: generate metadata for class properties in classes.
Manman Ren [Fri, 29 Jan 2016 19:22:54 +0000 (19:22 +0000)]
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

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

8 years agoClass Property: warn for synthesize on a class property.
Manman Ren [Fri, 29 Jan 2016 19:16:39 +0000 (19:16 +0000)]
Class Property: warn for synthesize on a class property.

rdar://23891898

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

8 years agoClass Property: parse @dynamic (class).
Manman Ren [Fri, 29 Jan 2016 19:05:57 +0000 (19:05 +0000)]
Class Property: parse @dynamic (class).

rdar://23891898

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

8 years ago[analyzer] Suppress null reports from defensive checks in function-like macros.
Devin Coughlin [Fri, 29 Jan 2016 18:47:13 +0000 (18:47 +0000)]
[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

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

8 years ago[analyzer] Improve Nullability checker diagnostics
Anna Zaks [Fri, 29 Jan 2016 18:43:15 +0000 (18:43 +0000)]
[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.

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

8 years agoRevert r259210 "Extend hasType narrowing matcher for TypedefDecls, add functionProtoT...
Hans Wennborg [Fri, 29 Jan 2016 18:24:34 +0000 (18:24 +0000)]
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.

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

8 years agoExtend hasType narrowing matcher for TypedefDecls, add functionProtoType matcher...
Aaron Ballman [Fri, 29 Jan 2016 17:03:11 +0000 (17:03 +0000)]
Extend hasType narrowing matcher for TypedefDecls, add functionProtoType matcher for FunctionProtoType nodes, extend parameterCountIs to FunctionProtoType nodes.

Patch by Richard Thomson

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

8 years agoRemoving unnecessary casts; NFC.
Aaron Ballman [Fri, 29 Jan 2016 13:53:26 +0000 (13:53 +0000)]
Removing unnecessary casts; NFC.

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

8 years agoImplement TemplateArgument::dump() method for debugging, patterned after TemplateName...
Yaron Keren [Fri, 29 Jan 2016 13:46:15 +0000 (13:46 +0000)]
Implement TemplateArgument::dump() method for debugging, patterned after TemplateName::dump().

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

8 years agoAdd an optional ToolName argument to runToolOnCodeWithArgs/buildASTFromCodeWithArgs.
Benjamin Kramer [Fri, 29 Jan 2016 11:29:02 +0000 (11:29 +0000)]
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

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

8 years agoAdd target triple to CodeGenOpenCL/pipe_types.cl test case
Ulrich Weigand [Fri, 29 Jan 2016 10:45:23 +0000 (10:45 +0000)]
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.

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

8 years ago[Concepts] Implement a portion of Concepts TS[dcl.spec.concept]p5 and p6:
Nathan Wilson [Fri, 29 Jan 2016 04:43:59 +0000 (04:43 +0000)]
[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

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

8 years agoRemove unnecessary forward declaration. NFC
Craig Topper [Fri, 29 Jan 2016 04:01:09 +0000 (04:01 +0000)]
Remove unnecessary forward declaration. NFC

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

8 years agoAdd the clang debug info test directory to .gitignore as it's managed separately.
Eric Christopher [Fri, 29 Jan 2016 01:35:55 +0000 (01:35 +0000)]
Add the clang debug info test directory to .gitignore as it's managed separately.

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

8 years agoUse a consistent spelling for vtables.
Eric Christopher [Fri, 29 Jan 2016 01:35:53 +0000 (01:35 +0000)]
Use a consistent spelling for vtables.

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

8 years ago[CUDA] Generate CUDA's printf alloca in its function's entry block.
Justin Lebar [Thu, 28 Jan 2016 23:58:28 +0000 (23:58 +0000)]
[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

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

8 years agoClass Property: change PropertyMap to include isClassProperty.
Manman Ren [Thu, 28 Jan 2016 23:36:05 +0000 (23:36 +0000)]
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

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

8 years ago[analyzer] NullabilityChecker: Remove unused isReturnSelf() function.
Devin Coughlin [Thu, 28 Jan 2016 23:34:13 +0000 (23:34 +0000)]
[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.

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

8 years agoCheck for frontend errors after releasing the Builder.
Manman Ren [Thu, 28 Jan 2016 23:29:02 +0000 (23:29 +0000)]
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

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

8 years agoUpdate for llvm change.
Rafael Espindola [Thu, 28 Jan 2016 22:56:41 +0000 (22:56 +0000)]
Update for llvm change.

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

8 years ago[analyzer] Suppress nullability warnings in copy, mutableCopy, and init families.
Devin Coughlin [Thu, 28 Jan 2016 22:23:34 +0000 (22:23 +0000)]
[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

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

8 years agoImplementation of PS4 ABI, Round 1
Sunil Srivastava [Thu, 28 Jan 2016 21:36:31 +0000 (21:36 +0000)]
Implementation of PS4 ABI, Round 1
Added a test to safeguard linux ABI.

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

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

8 years agoInclude RecordDecls from anonymous unions in the AST.
Nico Weber [Thu, 28 Jan 2016 19:25:00 +0000 (19:25 +0000)]
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).

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

8 years agoRemove unused parameter.
Nico Weber [Thu, 28 Jan 2016 19:12:32 +0000 (19:12 +0000)]
Remove unused parameter.

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

8 years agoClass Property: class property and instance property can have the same name.
Manman Ren [Thu, 28 Jan 2016 18:49:28 +0000 (18:49 +0000)]
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

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

8 years ago[PGO] test case cleanups
Xinliang David Li [Thu, 28 Jan 2016 18:25:53 +0000 (18:25 +0000)]
[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.

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

8 years agoFix strange indent.
Nico Weber [Thu, 28 Jan 2016 18:06:31 +0000 (18:06 +0000)]
Fix strange indent.

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

8 years ago[Coverage] Use a set to track visited FileIDs (NFC)
Vedant Kumar [Thu, 28 Jan 2016 17:52:18 +0000 (17:52 +0000)]
[Coverage] Use a set to track visited FileIDs (NFC)

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

8 years agoRevert r259036, it introduces a cyclic library dependency
Oliver Stannard [Thu, 28 Jan 2016 13:09:49 +0000 (13:09 +0000)]
Revert r259036, it introduces a cyclic library dependency

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

8 years agoAdd backend dignostic printer for unsupported features
Oliver Stannard [Thu, 28 Jan 2016 10:07:34 +0000 (10:07 +0000)]
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

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

8 years agoFix isBeforeInTranslationUnit to not abort on macros defined in cmdline.
Yury Gribov [Thu, 28 Jan 2016 09:28:18 +0000 (09:28 +0000)]
Fix isBeforeInTranslationUnit to not abort on macros defined in cmdline.

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

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

8 years agoSmall refactor in isBeforeInTranslationUnit.
Yury Gribov [Thu, 28 Jan 2016 09:27:46 +0000 (09:27 +0000)]
Small refactor in isBeforeInTranslationUnit.

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

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

8 years ago[Lex] Share some common code between decimal and octal parsing in NumericLiteralParser.
Craig Topper [Thu, 28 Jan 2016 05:22:54 +0000 (05:22 +0000)]
[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.

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

8 years agoRevert r258951 (and r258950), "Refactor backend diagnostics for unsupported features"
NAKAMURA Takumi [Thu, 28 Jan 2016 04:41:32 +0000 (04:41 +0000)]
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"

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

8 years ago[Sema] Make extended vectors of `bool` an error.
George Burgess IV [Thu, 28 Jan 2016 01:38:18 +0000 (01:38 +0000)]
[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

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

8 years ago[sancov] sancov tool documentation
Mike Aizatsky [Wed, 27 Jan 2016 23:56:12 +0000 (23:56 +0000)]
[sancov] sancov tool documentation

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

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

8 years agoStrengthen cfi-check-fail test.
Evgeniy Stepanov [Wed, 27 Jan 2016 22:28:56 +0000 (22:28 +0000)]
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.

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

8 years agoARMv7k: simplify logic for deciding sjlj-exceptions.
Tim Northover [Wed, 27 Jan 2016 22:14:02 +0000 (22:14 +0000)]
ARMv7k: simplify logic for deciding sjlj-exceptions.

Slight change of behaviour in the odd armv7+watchos case, which should match
the other runtime components.

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

8 years agoclang-format: [Java] Remove unnecessary line break after complex annotations
Daniel Jasper [Wed, 27 Jan 2016 20:14:23 +0000 (20:14 +0000)]
clang-format: [Java] Remove unnecessary line break after complex annotations

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

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

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

8 years agoClass Property: create accessors (class methods) for class property.
Manman Ren [Wed, 27 Jan 2016 20:10:32 +0000 (20:10 +0000)]
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

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

8 years agoClass Property: handle class properties.
Manman Ren [Wed, 27 Jan 2016 20:00:32 +0000 (20:00 +0000)]
Class Property: handle class properties.

At places where we handle instance properties, if necessary.

rdar://23891898

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

8 years agoARMv7k: select ABI based on v7k Arch rather than watchos OS.
Tim Northover [Wed, 27 Jan 2016 19:32:40 +0000 (19:32 +0000)]
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.

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

8 years agoEmit calls to objc_unsafeClaimAutoreleasedReturnValue when
John McCall [Wed, 27 Jan 2016 18:32:30 +0000 (18:32 +0000)]
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

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

8 years agoAdd backend dignostic printer for unsupported features
Oliver Stannard [Wed, 27 Jan 2016 17:30:28 +0000 (17:30 +0000)]
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

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

8 years agoAdding back in a test that I inadvertently removed in r258862
Chris Bieneman [Wed, 27 Jan 2016 15:51:56 +0000 (15:51 +0000)]
Adding back in a test that I inadvertently removed in r258862

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

8 years agoUpdate for LLVM change.
Benjamin Kramer [Wed, 27 Jan 2016 10:01:30 +0000 (10:01 +0000)]
Update for LLVM change.

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

8 years agoFix array index out of bounds
Daniel Marjamaki [Wed, 27 Jan 2016 07:33:50 +0000 (07:33 +0000)]
Fix array index out of bounds

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

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

8 years agoAdding a test for PR25717.
Yunzhong Gao [Wed, 27 Jan 2016 02:18:28 +0000 (02:18 +0000)]
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.

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

8 years ago[analyzer] ObjCDeallocChecker: Only operate on classes with retained properties.
Devin Coughlin [Wed, 27 Jan 2016 01:41:58 +0000 (01:41 +0000)]
[analyzer] ObjCDeallocChecker: Only operate on classes with retained properties.

Previously the ObjC Dealloc Checker only checked classes with ivars, not
retained properties, which caused three bugs:

- False positive warnings about a missing -dealloc method in classes with only
ivars.
- Missing warnings about a missing -dealloc method on classes with only
properties.
- Missing warnings about an over-released or under-released ivar associated with
a retained property in classes with only properties.

The fix is to check only classes with at least one retained synthesized
property.

This also exposed a bug when reporting an over-released or under-released
property that did not contain a synthesize statement. The checker tried to
associate the warning with an @synthesize statement that did not exist, which
caused an assertion failure in debug builds. The fix is to fall back to the
@property statement in this case.

A patch by David Kilzer!

Part of rdar://problem/6927496

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

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

8 years agoRevert "Change of UserLabelPrefix default value from "_" to """
James Y Knight [Wed, 27 Jan 2016 01:04:51 +0000 (01:04 +0000)]
Revert "Change of UserLabelPrefix default value from "_" to """

This reverts commit r258504.

This commit breaks (at least) sparc-rtems -- the OS (RTEMS) used to
override UserLabelPrefix to "", despite the arch (SPARC) having set it
to "_". Now, the OS doesn't override anymore, but the arch sets it to
"_", resulting in the wrong value. I expect this probably breaks other
OSes that overrode to "" before, as well. (Clearly we have some missing
test cases, here...)

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

8 years ago[analyzer] Body farm: Look for property ivar in shadowing readwrite property.
Devin Coughlin [Tue, 26 Jan 2016 23:58:48 +0000 (23:58 +0000)]
[analyzer] Body farm: Look for property ivar in shadowing readwrite property.

After r251874, readonly properties that are shadowed by a readwrite property
in a class extension no longer have an instance variable, which caused the body
farm to not synthesize getters. Now, if a readonly property does not have an
instance variable look for a shadowing property and try to get the instance
variable from there.

rdar://problem/24060091

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

8 years ago[CUDA] Implemented device-side support functions in <cmath>.
Artem Belevich [Tue, 26 Jan 2016 23:37:29 +0000 (23:37 +0000)]
[CUDA] Implemented device-side support functions in <cmath>.

CUDA expects math functions in std:: namespace to work on device side.
In order to make it work with clang without allowing device-side code
generation for functions w/o appropriate target attributes, this patch
provides device-side implementations for <cmath> functions. Most of
them call global-scope math functions provided by CUDA headers. In few
cases we use clang builtins.

Tested out-of tree by compiling and running thrust's unit_tests.
https://github.com/thrust/thrust/tree/master/testing

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

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