]> granicus.if.org Git - clang/log
clang
8 years agoAdd back the ABITest makefiles
Chris Bieneman [Wed, 3 Feb 2016 17:16:01 +0000 (17:16 +0000)]
Add back the ABITest makefiles

These files are standalone and not integrated with CMake, so we probably want them.

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

8 years ago[OpenMP] Parsing + sema for target parallel for directive.
Arpith Chacko Jacob [Wed, 3 Feb 2016 15:46:42 +0000 (15:46 +0000)]
[OpenMP] Parsing + sema for target parallel for directive.

Summary:
This patch adds parsing + sema for the target parallel for directive along with testcases.

Reviewers: ABataev

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

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

8 years agoMinor cleanup to remove casts and improve some const correctness. NFC.
Aaron Ballman [Wed, 3 Feb 2016 15:20:51 +0000 (15:20 +0000)]
Minor cleanup to remove casts and improve some const correctness. NFC.

Patch by Alexander Riccio.

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

8 years ago[OpenCL] Adding reserved operator logical xor for OpenCL
Anastasia Stulova [Wed, 3 Feb 2016 15:17:14 +0000 (15:17 +0000)]
[OpenCL] Adding reserved operator logical xor for OpenCL

This patch adds the reserved operator ^^ when compiling for OpenCL (spec v1.1 s6.3.g),
which results in a more meaningful error message.

Patch by Neil Hickey!

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

M    test/SemaOpenCL/unsupported.cl
M    include/clang/Basic/TokenKinds.def
M    include/clang/Basic/DiagnosticParseKinds.td
M    lib/Basic/OperatorPrecedence.cpp
M    lib/Lex/Lexer.cpp
M    lib/Parse/ParseExpr.cpp

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

8 years agoProvide match function to look over an entire TU again.
Daniel Jasper [Wed, 3 Feb 2016 14:29:55 +0000 (14:29 +0000)]
Provide match function to look over an entire TU again.

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

8 years agoForgot to remove file in previous commit.
Yury Gribov [Wed, 3 Feb 2016 13:36:31 +0000 (13:36 +0000)]
Forgot to remove file in previous commit.

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

8 years ago[analyzer] AnalysisConsumer: print fully-qualified function name while displaying...
Yury Gribov [Wed, 3 Feb 2016 13:35:33 +0000 (13:35 +0000)]
[analyzer] AnalysisConsumer: print fully-qualified function name while displaying progress

-analyzer-display progress option prints only function names which may be ambiguous. This patch forces AnalysisConsumer to print fully-qualified function names.
Patch by Alex Sidorin!

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

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

8 years ago-inline-asm][X86] Add ability to use AVX512 in MS inline asm
Marina Yatsina [Wed, 3 Feb 2016 11:32:08 +0000 (11:32 +0000)]
-inline-asm][X86] Add ability to use AVX512 in MS inline asm

Defined the new AVX512 registers in clang inline asm.
Fixed a bug in the MC subtarget info creation during the parsing of MS asm statement - now it receives the actual CPU and target features information.

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

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

8 years agoReduce initial Sema memory consumption by 400KB. By Elisavet Sakellari.
Axel Naumann [Wed, 3 Feb 2016 10:45:22 +0000 (10:45 +0000)]
Reduce initial Sema memory consumption by 400KB. By Elisavet Sakellari.

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

8 years agoclang-format: [JS/TypeScript] Support "enum" as an optional property name, too.
Daniel Jasper [Wed, 3 Feb 2016 05:33:44 +0000 (05:33 +0000)]
clang-format: [JS/TypeScript] Support "enum" as an optional property name, too.

Before:
  enum?: string
  [];

After:
  enum?: string[];

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

8 years agoMake CF constant string decl visible to name lookup to fix module errors
Ben Langmuir [Wed, 3 Feb 2016 03:26:19 +0000 (03:26 +0000)]
Make CF constant string decl visible to name lookup to fix module errors

The return type of the __builtin___*StringMakeConstantString functions
is a pointer to a struct, so we need that struct to be visible to name
lookup so that we will correctly merge multiple declarations of that
type if they come from different modules.

Incidentally, to make this visible to name lookup we need to rename the
type to __NSConstantString, since the real NSConstantString is an
Objective-C interface type.  This shouldn't affect anyone outside the
compiler since users of the constant string builtins cast the result
immediately to CFStringRef.

Since this struct type is otherwise implicitly created by the AST
context and cannot access namelookup, we make this a predefined type
and initialize it in Sema.

Note: this issue of builtins that refer to types not visible to name
lookup technically also affects other builtins (e.g. objc_msgSendSuper),
but in all other cases the builtin is a library builtin and the issue
goes away if you include the library that defines the types it uses,
unlike for these constant string builtins.

rdar://problem/24425801

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

8 years agoFix miscompile and rejects-valids when disambiguating after an ambiguous
Richard Smith [Wed, 3 Feb 2016 02:58:20 +0000 (02:58 +0000)]
Fix miscompile and rejects-valids when disambiguating after an ambiguous
C-style-cast to function/array type or parenthesized function-style cast/array
indexing.

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

8 years agoFix typo in OpenCL type mangling. This is still bogus (we should either use the
Richard Smith [Wed, 3 Feb 2016 01:43:59 +0000 (01:43 +0000)]
Fix typo in OpenCL type mangling. This is still bogus (we should either use the
actual source name of the typedef or a vendor mangling) but at least it stands
a chance of demangling now.

We would also benefit from some test coverage of this (OpenCL +
__attribute__((overloadable)) is probably required to reach this).

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

8 years agoFix Itanium RTTI emission so that we emit fundamental type information into the
Richard Smith [Wed, 3 Feb 2016 01:32:42 +0000 (01:32 +0000)]
Fix Itanium RTTI emission so that we emit fundamental type information into the
C++ ABI library for the same set of types for which we expect the C++ ABI
library to provide the RTTI.

Specifically:
 1) __int128 and unsigned __int128 are now emitted into the ABI library. We
    always expected them to be there but never actually made sure to emit them.
 2) Do not expect OpenCL builtin types to have type info in the C++ ABI library.
    Neither libc++abi nor libstdc++ puts them there when built with either GCC
    or Clang.

This matches GCC's behavior.

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

8 years agoPR24989: Stop trying to use the C++11 rules for lambda return type inference in
Richard Smith [Tue, 2 Feb 2016 23:58:56 +0000 (23:58 +0000)]
PR24989: Stop trying to use the C++11 rules for lambda return type inference in
C++14 generic lambdas. It conflicts with the C++14 return type deduction
mechanism, and results in us failing to actually deduce the lambda's return
type in some cases.

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

8 years agoFix rejects-valid when forming a pointer-to-member with 'decltype(expr)::*'.
Richard Smith [Tue, 2 Feb 2016 23:34:49 +0000 (23:34 +0000)]
Fix rejects-valid when forming a pointer-to-member with 'decltype(expr)::*'.

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

8 years agoWork around build failure due to GCC 4.8.1 bug. We don't completely understand
Richard Smith [Tue, 2 Feb 2016 23:11:49 +0000 (23:11 +0000)]
Work around build failure due to GCC 4.8.1 bug. We don't completely understand
the details of the bug, but avoiding overloading llvm::cast with another
function template sidesteps it.

See gcc.gnu.org/PR58022 for details of the bug, and llvm.org/PR26362 for more
backgound on how it manifested in Clang. Patch by Igor Sugak!

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

8 years ago[CUDA] Do not allow dynamic initialization of global device side variables.
Artem Belevich [Tue, 2 Feb 2016 22:29:48 +0000 (22:29 +0000)]
[CUDA] Do not allow dynamic initialization of global device side variables.

In general CUDA does not allow dynamic initialization of
global device-side variables. One exception is that CUDA allows
records with empty constructors as described in section E2.2.1 of
CUDA 7.5 Programming guide.

This patch applies initializer checks for all device-side variables.
Empty constructors are accepted, but no code is generated for them.

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

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

8 years agoObjCXX: fix a crash during typo correction.
Manman Ren [Tue, 2 Feb 2016 22:23:03 +0000 (22:23 +0000)]
ObjCXX: fix a crash during typo correction.

For ObjCXX, we can create a CastExpr with Kind being CK_UserDefinedConversion
and SubExpr being BlockExpr. Specifically one can return BlockExpr from
BuildCXXMemberCallExpr and the result can be used to build a CastExpr.

Fix the assumption in CastExpr::getSubExprAsWritten that SubExpr can only
be CXXMemberCallExpr.

rdar://problem/24364077

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

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