]> granicus.if.org Git - clang/log
clang
9 years agoclang-format: Break after "for (" less eagerly.
Daniel Jasper [Tue, 7 Jul 2015 16:09:39 +0000 (16:09 +0000)]
clang-format: Break after "for (" less eagerly.

Before:
  for (
      auto aaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
      aaaaaaaaaaaaaaaaaaaaaaaaaaa != bbbbbbbbbbbbbbbbbbbbbbb;
      ++aaaaaaaaaaaaaaaaaaaaaaaaaaa) {

After:
  for (auto aaaaaaaaaaaaaaaaaaaaaaaaaaa(
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
       aaaaaaaaaaaaaaaaaaaaaaaaaaa != bbbbbbbbbbbbbbbbbbbbbbb;
       ++aaaaaaaaaaaaaaaaaaaaaaaaaaa) {

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

9 years agoDon't put anonymous structs within anonymous unions.
Douglas Gregor [Tue, 7 Jul 2015 15:48:11 +0000 (15:48 +0000)]
Don't put anonymous structs within anonymous unions.

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

9 years agoFix first line comment format, NFC.
Yaron Keren [Tue, 7 Jul 2015 15:10:47 +0000 (15:10 +0000)]
Fix first line comment format, NFC.

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

9 years agoclang-format: Don't wrap before the ] of a lambda introducer.
Daniel Jasper [Tue, 7 Jul 2015 13:50:50 +0000 (13:50 +0000)]
clang-format: Don't wrap before the ] of a lambda introducer.

Before:
  return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa([=
  ](int iiiiiiiiiiii) {
    return aaaaaaaaaaaaaaaaaaaaaaa != aaaaaaaaaaaaaaaaaaaaaaa;
  });

After:
  return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa([=](
      int iiiiiiiiiiii) {
    return aaaaaaaaaaaaaaaaaaaaaaa != aaaaaaaaaaaaaaaaaaaaaaa;
  });

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

9 years agoSilence -Wparentheses warnings (and ran it through clang-format); NFC.
Aaron Ballman [Tue, 7 Jul 2015 13:25:57 +0000 (13:25 +0000)]
Silence -Wparentheses warnings (and ran it through clang-format); NFC.

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

9 years agoSilence a -Wcast-qual warning; NFC.
Aaron Ballman [Tue, 7 Jul 2015 13:22:55 +0000 (13:22 +0000)]
Silence a -Wcast-qual warning; NFC.

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

9 years agoSilence a -Wunused-variable warning; NFC.
Aaron Ballman [Tue, 7 Jul 2015 13:21:26 +0000 (13:21 +0000)]
Silence a -Wunused-variable warning; NFC.

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

9 years agoAppease MSVC 2013 a few more times, which was complaining about a syntax error with...
Aaron Ballman [Tue, 7 Jul 2015 13:19:10 +0000 (13:19 +0000)]
Appease MSVC 2013 a few more times, which was complaining about a syntax error with an unexpected close curly brace. For some reason, the range-based for loop requires curly braces to compile in MSVC.

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

9 years agoAppease MSVC 2013, which was complaining about a syntax error with an unexpected...
Aaron Ballman [Tue, 7 Jul 2015 12:54:02 +0000 (12:54 +0000)]
Appease MSVC 2013, which was complaining about a syntax error with an unexpected close curly brace. For some reason, the range-based for loop requires curly braces to compile in MSVC.

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

9 years agoChanging a use of alignof() into llvm::alignOf() for MSVC compatibility. This require...
Aaron Ballman [Tue, 7 Jul 2015 12:50:30 +0000 (12:50 +0000)]
Changing a use of alignof() into llvm::alignOf() for MSVC compatibility. This requires changing a static_assert into an assert, too.

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

9 years agoAdd a comment to explain how the decision to pass feature "+long-calls" is made.
Akira Hatanaka [Tue, 7 Jul 2015 08:28:42 +0000 (08:28 +0000)]
Add a comment to explain how the decision to pass feature "+long-calls" is made.

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

9 years ago[ARM] Pass subtarget feature "+long-calls" instead of passing backend option
Akira Hatanaka [Tue, 7 Jul 2015 06:42:05 +0000 (06:42 +0000)]
[ARM] Pass subtarget feature "+long-calls" instead of passing backend option
"-arm-long-calls".

This change allows using -mlong-calls/-mno-long-calls for LTO and enabling or
disabling long call on a per-function basis.

rdar://problem/21529937

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

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

9 years agoDon't rely on the use of non-POD types within unions.
Douglas Gregor [Tue, 7 Jul 2015 06:20:46 +0000 (06:20 +0000)]
Don't rely on the use of non-POD types within unions.

They aren't universally supported and we're not getting any benefit
from using them.

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

9 years agos/__nonnull/_Nonnull in a test for Objective-C __kindof.
Douglas Gregor [Tue, 7 Jul 2015 06:20:41 +0000 (06:20 +0000)]
s/__nonnull/_Nonnull in a test for Objective-C __kindof.

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

9 years ago[AST] Add a comment for ObjCMethodDecl::getSendResultType() function.
Douglas Gregor [Tue, 7 Jul 2015 06:20:39 +0000 (06:20 +0000)]
[AST] Add a comment for ObjCMethodDecl::getSendResultType() function.

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

9 years ago[libclang] Implement proper code-completion in an ObjC type parameter position.
Douglas Gregor [Tue, 7 Jul 2015 06:20:36 +0000 (06:20 +0000)]
[libclang] Implement proper code-completion in an ObjC type parameter position.

rdar://19670303

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

9 years ago[libclang] When inferring nonnull use the contextual keyword for the code-completion...
Douglas Gregor [Tue, 7 Jul 2015 06:20:31 +0000 (06:20 +0000)]
[libclang] When inferring nonnull use the contextual keyword for the code-completion results,
when appropriate.

rdar://20742295

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

9 years ago[libclang] Replace ObjC generic parameters when code-completing method implementations.
Douglas Gregor [Tue, 7 Jul 2015 06:20:27 +0000 (06:20 +0000)]
[libclang] Replace ObjC generic parameters when code-completing method implementations.

rdar://20643768

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

9 years ago[libclang] Fix code-completion of block parameters that are marked with nullability...
Douglas Gregor [Tue, 7 Jul 2015 06:20:22 +0000 (06:20 +0000)]
[libclang] Fix code-completion of block parameters that are marked with nullability specifier.

rdar://20755276

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

9 years ago[libclang] Replace ObjC generic parameters in code-completion results.
Douglas Gregor [Tue, 7 Jul 2015 06:20:19 +0000 (06:20 +0000)]
[libclang] Replace ObjC generic parameters in code-completion results.

rdar://19369529

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

9 years agoThe AST importer had a bug where it would enter into an infinite recursion
Douglas Gregor [Tue, 7 Jul 2015 06:20:12 +0000 (06:20 +0000)]
The AST importer had a bug where it would enter into an infinite recursion
when importing type parameter lists.  The reason is that type parameters
have their DeclContexts set to the interface that is parameterized with those
types, and the importer would follow that loop and blow the stack out.

I've changed the way this works so that the type parameters are only imported
after the interface that contains them has been registered via the Imported()
function.

This is tested by LLDB.

<rdar://problem/20315663>

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

9 years agoFix alignment check for ObjCObjectTypeLoc.
Douglas Gregor [Tue, 7 Jul 2015 04:23:51 +0000 (04:23 +0000)]
Fix alignment check for ObjCObjectTypeLoc.

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

9 years agoUse llvm::alignOf rather than alignof()
Douglas Gregor [Tue, 7 Jul 2015 04:06:31 +0000 (04:06 +0000)]
Use llvm::alignOf rather than alignof()

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

9 years agoFactor the simpleTransform() visitor so that it is not a local class.
Douglas Gregor [Tue, 7 Jul 2015 03:58:59 +0000 (03:58 +0000)]
Factor the simpleTransform() visitor so that it is not a local class.

Older versions of Clang cannot handle such local classes properly
rdar://problem/19386032.

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

9 years agoImplement variance for Objective-C type parameters.
Douglas Gregor [Tue, 7 Jul 2015 03:58:54 +0000 (03:58 +0000)]
Implement variance for Objective-C type parameters.

Introduce co- and contra-variance for Objective-C type parameters,
which allows us to express that (for example) an NSArray is covariant
in its type parameter. This means that NSArray<NSMutableString *> * is
a subtype of NSArray<NSString *> *, which is expected of the immutable
Foundation collections.

Type parameters can be annotated with __covariant or __contravariant
to make them co- or contra-variant, respectively. This feature can be
detected by __has_feature(objc_generics_variance). Implements
rdar://problem/20217490.

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

9 years agoImplement the Objective-C __kindof type qualifier.
Douglas Gregor [Tue, 7 Jul 2015 03:58:42 +0000 (03:58 +0000)]
Implement the Objective-C __kindof type qualifier.

The __kindof type qualifier can be applied to Objective-C object
(pointer) types to indicate id-like behavior, which includes implicit
"downcasting" of __kindof types to subclasses and id-like message-send
behavior. __kindof types provide better type bounds for substitutions
into unspecified generic types, which preserves more type information.

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

9 years agoWarn when an intended Objective-C specialization was actually a useless protocol...
Douglas Gregor [Tue, 7 Jul 2015 03:58:28 +0000 (03:58 +0000)]
Warn when an intended Objective-C specialization was actually a useless protocol qualification.

Warn in cases where one has provided redundant protocol qualification
that might be a typo for a specialization, e.g., NSArray<NSObject>,
which is pointless (NSArray declares that it conforms to NSObject) and
is likely to be a typo for NSArray<NSObject *>, i.e., an array of
NSObject pointers. This warning is very narrow, only applying when the
base type being qualified is parameterized, has the same number of
parameters as their are protocols listed, all of the names can also
refer to types (including Objective-C class types, of course), and at
least one of those types is an Objective-C class (making this a typo
for a missing '*'). The limitations are partly for performance reasons
(we don't want to do redundant name lookup unless we really need to),
and because we want the warning to apply in very limited cases to
limit false positives.

Part of rdar://problem/6294649.

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

9 years agoWarn when an Objective-C collection literal element is converted to an incompatible...
Douglas Gregor [Tue, 7 Jul 2015 03:58:22 +0000 (03:58 +0000)]
Warn when an Objective-C collection literal element is converted to an incompatible type.

Objective-C collection literals produce unspecialized
NSArray/NSDictionary objects that can then be implicitly converted to
specialized versions of these types. In such cases, check that the
elements in the collection are suitable for the specialized
collection. Part of rdar://problem/6294649.

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

9 years agoC++ support for Objective-C lightweight generics.
Douglas Gregor [Tue, 7 Jul 2015 03:58:14 +0000 (03:58 +0000)]
C++ support for Objective-C lightweight generics.

Teach C++'s tentative parsing to handle specializations of Objective-C
class types (e.g., NSArray<NSString *>) as well as Objective-C
protocol qualifiers (id<NSCopying>) by extending type-annotation
tokens to handle this case. As part of this, remove Objective-C
protocol qualifiers from the declaration specifiers, which never
really made sense: instead, provide Sema entry points to make them
part of the type annotation token. Among other things, this properly
diagnoses bogus types such as "<NSCopying> id" which should have been
written as "id <NSCopying>".

Implements template instantiation support for, e.g., NSArray<T>*
in C++. Note that parameterized classes are not templates in the C++
sense, so that cannot (for example) be used as a template argument for
a template template parameter. Part of rdar://problem/6294649.

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

9 years agoImprove the Objective-C common-type computation used by the ternary operator.
Douglas Gregor [Tue, 7 Jul 2015 03:58:01 +0000 (03:58 +0000)]
Improve the Objective-C common-type computation used by the ternary operator.

The Objective-C common-type computation had a few problems that
required a significant rework, including:
  - Quadradic behavior when finding the common base type; now it's
  linear.
  - Keeping around type arguments when computing the common type
  between a specialized and an unspecialized type
  - Introducing redundant protocol qualifiers.

Part of rdar://problem/6294649. Also fixes rdar://problem/19572837 by
addressing a longstanding bug in
ASTContext::CollectInheritedProtocols().

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

9 years agoSubstitute type arguments into uses of Objective-C interface members.
Douglas Gregor [Tue, 7 Jul 2015 03:57:53 +0000 (03:57 +0000)]
Substitute type arguments into uses of Objective-C interface members.

When messaging a method that was defined in an Objective-C class (or
category or extension thereof) that has type parameters, substitute
the type arguments for those type parameters. Similarly, substitute
into property accesses, instance variables, and other references.

This includes general infrastructure for substituting the type
arguments associated with an ObjCObject(Pointer)Type into a type
referenced within a particular context, handling all of the
substitutions required to deal with (e.g.) inheritance involving
parameterized classes. In cases where no type arguments are available
(e.g., because we're messaging via some unspecialized type, id, etc.),
we substitute in the type bounds for the type parameters instead.

Example:

  @interface NSSet<T : id<NSCopying>> : NSObject <NSCopying>
  - (T)firstObject;
  @end

  void f(NSSet<NSString *> *stringSet, NSSet *anySet) {
    [stringSet firstObject]; // produces NSString*
    [anySet firstObject]; // produces id<NSCopying> (the bound)
  }

When substituting for the type parameters given an unspecialized
context (i.e., no specific type arguments were given), substituting
the type bounds unconditionally produces type signatures that are too
strong compared to the pre-generics signatures. Instead, use the
following rule:

  - In covariant positions, such as method return types, replace type
    parameters with “id” or “Class” (the latter only when the type
    parameter bound is “Class” or qualified class, e.g,
    “Class<NSCopying>”)
  - In other positions (e.g., parameter types), replace type
    parameters with their type bounds.
  - When a specialized Objective-C object or object pointer type
    contains a type parameter in its type arguments (e.g.,
    NSArray<T>*, but not NSArray<NSString *> *), replace the entire
    object/object pointer type with its unspecialized version (e.g.,
    NSArray *).

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

9 years agoHandle Objective-C type arguments.
Douglas Gregor [Tue, 7 Jul 2015 03:57:35 +0000 (03:57 +0000)]
Handle Objective-C type arguments.

Objective-C type arguments can be provided in angle brackets following
an Objective-C interface type. Syntactically, this is the same
position as one would provide protocol qualifiers (e.g.,
id<NSCopying>), so parse both together and let Sema sort out the
ambiguous cases. This applies both when parsing types and when parsing
the superclass of an Objective-C class, which can now be a specialized
type (e.g., NSMutableArray<T> inherits from NSArray<T>).

Check Objective-C type arguments against the type parameters of the
corresponding class. Verify the length of the type argument list and
that each type argument satisfies the corresponding bound.

Specializations of parameterized Objective-C classes are represented
in the type system as distinct types. Both specialized types (e.g.,
NSArray<NSString *> *) and unspecialized types (NSArray *) are
represented, separately.

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

9 years agoParsing, semantic analysis, and AST for Objective-C type parameters.
Douglas Gregor [Tue, 7 Jul 2015 03:57:15 +0000 (03:57 +0000)]
Parsing, semantic analysis, and AST for Objective-C type parameters.

Produce type parameter declarations for Objective-C type parameters,
and attach lists of type parameters to Objective-C classes,
categories, forward declarations, and extensions as
appropriate. Perform semantic analysis of type bounds for type
parameters, both in isolation and across classes/categories/extensions
to ensure consistency.

Also handle (de-)serialization of Objective-C type parameter lists,
along with sundry other things one must do to add a new declaration to
Clang.

Note that Objective-C type parameters are typedef name declarations,
like typedefs and C++11 type aliases, in support of type erasure.

Part of rdar://problem/6294649.

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

9 years agoDebug info: Emit distinct __block_literal_generic types for blocks with
Adrian Prantl [Tue, 7 Jul 2015 00:49:35 +0000 (00:49 +0000)]
Debug info: Emit distinct __block_literal_generic types for blocks with
different function signatures. (Previously clang would emit all block
pointer types with the type of the first block pointer in the compile
unit.)

rdar://problem/21602473

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

9 years agoRevert "Revert 241171, 241187, 241199 (32-bit SEH)."
Reid Kleckner [Tue, 7 Jul 2015 00:36:30 +0000 (00:36 +0000)]
Revert "Revert 241171, 241187, 241199 (32-bit SEH)."

This reverts commit r241244, but restricts SEH support to Win64.

This way, Chromium builds will still fall back on TUs with SEH, and
Clang developers can work on this incrementally upstream while patching
this small predicate locally. It'll also make it easier to review small
fixes.

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

9 years agoRemember to mark the target attribute as documented and clean up the
Eric Christopher [Tue, 7 Jul 2015 00:01:55 +0000 (00:01 +0000)]
Remember to mark the target attribute as documented and clean up the
Subjects line to avoid redundancy.

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

9 years ago[Driver] Use llvm::Triple methods to handle -EL and -EB.
Benjamin Kramer [Mon, 6 Jul 2015 23:59:45 +0000 (23:59 +0000)]
[Driver] Use llvm::Triple methods to handle -EL and -EB.

Add a test for ppc64(le), which wasn't handled before.

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

9 years agoUpdate target attribute support for post-commit feedback.
Eric Christopher [Mon, 6 Jul 2015 23:52:01 +0000 (23:52 +0000)]
Update target attribute support for post-commit feedback.

Use const auto rather than duplicating the type name and fix the
error message when the attribute is applied to an incorrect entity.

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

9 years agoHandle arbitrary whitespace in the target attribute support.
Eric Christopher [Mon, 6 Jul 2015 23:51:59 +0000 (23:51 +0000)]
Handle arbitrary whitespace in the target attribute support.

This allows us to deal a bit more gracefully with inclusions done
by macros, token pasting, or just code layout/formatting.

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

9 years agoAdd some basic documentation for the __attribute__((target(""))) support.
Eric Christopher [Mon, 6 Jul 2015 23:51:56 +0000 (23:51 +0000)]
Add some basic documentation for the __attribute__((target(""))) support.

Describes the general syntax of how it's used with the unfortunate
usage of "subtarget features" and some examples from the x86 port
to help users.

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

9 years agoRefactor to avoid long if-condition.
Richard Smith [Mon, 6 Jul 2015 22:56:29 +0000 (22:56 +0000)]
Refactor to avoid long if-condition.

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

9 years agoDebug info: Don't emit a bogus location for the global block pointer type
Adrian Prantl [Mon, 6 Jul 2015 21:31:35 +0000 (21:31 +0000)]
Debug info: Don't emit a bogus location for the global block pointer type
(__block_literal_generic).

The arbitrary nature of the location confuses lldb and prevents type
uniquing.

rdar://problem/21602473

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

9 years agoSupport -pthread in mingw toolchain.
Yaron Keren [Mon, 6 Jul 2015 18:52:19 +0000 (18:52 +0000)]
Support -pthread in mingw toolchain.
"-pthread" appends -lpthread after the object files list passed to the linker.

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

9 years ago[Sema] Warn when shifting a negative value.
Davide Italiano [Mon, 6 Jul 2015 18:02:09 +0000 (18:02 +0000)]
[Sema] Warn when shifting a negative value.

Example:
 % ./clang -Wshift-negative-value emit.c
emit.c:3:14: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
  int a = -1 << 3;
          ~~ ^
1 warning generated.

PR: 24026
Differential Revision:  http://reviews.llvm.org/D10938
Reviewed by: rsmith

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

9 years agoUpdate testcase to reflect new behavior in DIBuilder.
Adrian Prantl [Mon, 6 Jul 2015 16:36:04 +0000 (16:36 +0000)]
Update testcase to reflect new behavior in DIBuilder.

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

9 years agoResubmit "Pass down the -flto option to the -cc1 job" (r239481)
Teresa Johnson [Mon, 6 Jul 2015 16:23:00 +0000 (16:23 +0000)]
Resubmit "Pass down the -flto option to the -cc1 job" (r239481)

The patch is the same except for the addition of a new test for the
issue that required reverting the dependent llvm commit.

--Original Commit Message--

Pass down the -flto option to the -cc1 job, and from there into the
CodeGenOptions and onto the PassManagerBuilder. This enables gating
the new EliminateAvailableExternally module pass on whether we are
preparing for LTO.

If we are preparing for LTO (e.g. a -flto -c compile), the new pass is not
included as we want to preserve available externally functions for possible
link time inlining.

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

9 years agoGrammar bug. NFC
Douglas Katzman [Mon, 6 Jul 2015 15:25:31 +0000 (15:25 +0000)]
Grammar bug. NFC

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

9 years agoclang-format: [JS] Properly reset parse state after parsing interface.
Daniel Jasper [Mon, 6 Jul 2015 14:26:04 +0000 (14:26 +0000)]
clang-format: [JS] Properly reset parse state after parsing interface.

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

9 years agoclang-format: [JS] Prevent confusing TypeScript parameters wraps.
Daniel Jasper [Mon, 6 Jul 2015 14:07:51 +0000 (14:07 +0000)]
clang-format: [JS] Prevent confusing TypeScript parameters wraps.

Before:
  aaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:
                     aaaaaaaaaaaaaaaaaa): aaaaaaaaaaaaaaaaaaaaaa {}

After:
  aaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
                     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa):
      aaaaaaaaaaaaaaaaaaaaaa {}

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

9 years agoclang-format: Fix __attribute__ being treated as decl name.
Daniel Jasper [Mon, 6 Jul 2015 11:30:34 +0000 (11:30 +0000)]
clang-format: Fix __attribute__ being treated as decl name.

__attribute__ was treated as the name of a function definition, with the
tokens in parentheses being the parameter list. This formats incorrectly
with AlwaysBreakAfterDefinitionReturnType. Fix it by treating
__attribute__ like decltype.

Patch by Strager Neds, thank you.

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

9 years agoReplace some const std::string & with llvm::StringRef or std::string
Yaron Keren [Mon, 6 Jul 2015 08:47:15 +0000 (08:47 +0000)]
Replace some const std::string & with llvm::StringRef or std::string
and std::move to avoid implicit std::string construction.

Patch by Eugene Kosov.

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

9 years agoTeach mingw toolchain the msys2 mingw-w64 distribution C++ dirs.
Yaron Keren [Mon, 6 Jul 2015 07:40:10 +0000 (07:40 +0000)]
Teach mingw toolchain the msys2 mingw-w64 distribution C++ dirs.

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

9 years ago[TableGen] Change a couple methods to return an ArrayRef instead of a const std:...
Craig Topper [Mon, 6 Jul 2015 06:23:06 +0000 (06:23 +0000)]
[TableGen] Change a couple methods to return an ArrayRef instead of a const std::vector reference. NFC

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

9 years ago[OPENMP 4.0] Codegen for 'omp cancel' directive.
Alexey Bataev [Mon, 6 Jul 2015 05:50:32 +0000 (05:50 +0000)]
[OPENMP 4.0] Codegen for 'omp cancel' directive.

Add the next codegen for 'omp cancel' directive:
if (__kmpc_cancel()) {
  __kmpc_cancel_barrier();
  <exit construct>;
}

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

9 years agoPR24030, PR24033: Consistently check whether a new declaration conflicts with
Richard Smith [Mon, 6 Jul 2015 04:43:58 +0000 (04:43 +0000)]
PR24030, PR24033: Consistently check whether a new declaration conflicts with
an existing using shadow declaration if they define entities of the same kind
in different namespaces.

We'd previously check this consistently if the using-declaration came after the
other declaration, but not if it came before.

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

9 years agoDR1909: Diagnose all invalid cases of a class member sharing its name with the class.
Richard Smith [Mon, 6 Jul 2015 01:45:27 +0000 (01:45 +0000)]
DR1909: Diagnose all invalid cases of a class member sharing its name with the class.

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

9 years agoWhen we see something that looks like a constructor with a return type, only issue...
Richard Smith [Mon, 6 Jul 2015 01:04:39 +0000 (01:04 +0000)]
When we see something that looks like a constructor with a return type, only issue one error, not two.

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

9 years agoMark clang/test/Modules/signal.m as REQUIRES:crash-recovery.
NAKAMURA Takumi [Sun, 5 Jul 2015 23:00:44 +0000 (23:00 +0000)]
Mark clang/test/Modules/signal.m as REQUIRES:crash-recovery.

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

9 years agoDocument problems when trying libclang tests on Windows 7.
Yaron Keren [Sun, 5 Jul 2015 17:53:00 +0000 (17:53 +0000)]
Document problems when trying libclang tests on Windows 7.

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

9 years agoAdd the missing return statements from revision 241399.
Nemanja Ivanovic [Sun, 5 Jul 2015 10:54:10 +0000 (10:54 +0000)]
Add the missing return statements from revision 241399.

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

9 years ago[CMake] clang-*.*: Prevent versioning if the buildhost is targeting for Win32.
NAKAMURA Takumi [Sun, 5 Jul 2015 10:16:24 +0000 (10:16 +0000)]
[CMake] clang-*.*: Prevent versioning if the buildhost is targeting for Win32.

CMake-2.8.12 is hardcoded to create symlinked clang.exe if the target property VERSION is present and the host is not Win32.
Then clang.exe-*.* is generated and clang.exe is symlinked to it.

  lrwxrwxrwx. 1 bb bb      13 Jul  5 18:04 clang.exe -> clang.exe-3.7
  -rwxr-x---. 1 bb bb  244763 Jul  5 18:04 clang++.exe
  -rwxr-x---. 1 bb bb  244763 Jul  5 18:04 clang.exe-3.7

It made me unhappy when built binaries were copied to the Windows target.

FIXME: Could we just remove the target property VERSION in add_llvm_executable() ?

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

9 years agoclang/test/CodeGen/builtins-ppc-vsx.c: Fix for -Asserts.
NAKAMURA Takumi [Sun, 5 Jul 2015 08:37:54 +0000 (08:37 +0000)]
clang/test/CodeGen/builtins-ppc-vsx.c: Fix for -Asserts.

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

9 years agoAdd missing builtins to altivec.h for ABI compliance (vol. 2)
Nemanja Ivanovic [Sun, 5 Jul 2015 06:40:52 +0000 (06:40 +0000)]
Add missing builtins to altivec.h for ABI compliance (vol. 2)

This patch corresponds to review:
http://reviews.llvm.org/D10875

The bulk of the second round of additions to altivec.h.
The following interfaces were added:
vector double vec_floor(vector double)
vector double vec_madd(vector double, vector double, vector double)
vector float vec_msub(vector float, vector float, vector float)
vector double vec_msub(vector double, vector double, vector double)
vector float vec_mul(vector float, vector float)
vector double vec_mul(vector double, vector double)
vector float vec_nmadd(vector float, vector float, vector float)
vector double vec_nmadd(vector double, vector double, vector double)
vector double vec_nmsub(vector double, vector double, vector double)
vector double vec_nor(vector double, vector double)
vector double vec_or(vector double, vector double)
vector float vec_rint(vector float)
vector double vec_rint(vector double)
vector float vec_nearbyint(vector float)
vector double vec_nearbyint(vector double)
vector float vec_sqrt(vector float)
vector double vec_sqrt(vector double)
vector double vec_rsqrte(vector double)
vector double vec_sel(vector double, vector double, vector unsigned long long)
vector double vec_sel(vector double, vector double, vector unsigned long long)
vector double vec_sub(vector double, vector double)
vector double vec_trunc(vector double)
vector double vec_xor(vector double, vector double)
vector double vec_xor(vector double, vector bool long long)
vector double vec_xor(vector bool long long, vector double)

New VSX paths for the following interfaces:
vector float vec_madd(vector float, vector float, vector float)
vector float vec_nmsub(vector float, vector float, vector float)
vector float vec_rsqrte(vector float)
vector float vec_trunc(vector float)
vector float vec_floor(vector float)

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

9 years agoclang-format: Add MacroBlock{Begin,End} options
Birunthan Mohanathas [Fri, 3 Jul 2015 17:25:16 +0000 (17:25 +0000)]
clang-format: Add MacroBlock{Begin,End} options

The MacroBlockBegin and MacroBlockEnd options make matching macro identifiers
behave like '{' and '}', respectively, in terms of indentation.

Mozilla code, for example, uses several macros that begin and end a scope.
Previously, Clang-Format removed the indentation resulting in:

    MACRO_BEGIN(...)
    MACRO_ENTRY(...)
    MACRO_ENTRY(...)
    MACRO_END

Now, using the options

    MacroBlockBegin: "^[A-Z_]+_BEGIN$"
    MacroBlockEnd: "^[A-Z_]+_END$"

will yield the expected result:

    MACRO_BEGIN(...)
      MACRO_ENTRY(...)
      MACRO_ENTRY(...)
    MACRO_END

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

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

9 years agoRevert "Refactored ARMTargetInfo in order to use the API of llvm/lib/Support/TargetPa...
Renato Golin [Fri, 3 Jul 2015 16:41:13 +0000 (16:41 +0000)]
Revert "Refactored ARMTargetInfo in order to use the API of llvm/lib/Support/TargetParser.cpp

This reverts commit r241343, as it was, again, breaking all ARM buildbots.

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

9 years agoStmtIterator: Put stmt and decl group pointer into a union.
Benjamin Kramer [Fri, 3 Jul 2015 15:12:36 +0000 (15:12 +0000)]
StmtIterator: Put stmt and decl group pointer into a union.

Reduce the size of StmtIterator without changing behavior.

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

9 years agoRewrite users of Stmt::child_begin/end into for-range loops.
Benjamin Kramer [Fri, 3 Jul 2015 15:12:24 +0000 (15:12 +0000)]
Rewrite users of Stmt::child_begin/end into for-range loops.

No functionality change intended.

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

9 years ago- Refactored ARMTargetInfo in order to use the API of llvm/lib/Support/TargetParser.cpp
Alexandros Lamprineas [Fri, 3 Jul 2015 11:57:23 +0000 (11:57 +0000)]
- Refactored ARMTargetInfo in order to use the API of llvm/lib/Support/TargetParser.cpp
  for extracting target specific information.
- Patch for commit 241267: ShouldUseInlineAtomic was set incorrectly when subArch was
  not specified, causing regressions.

Change-Id: Iabb35d59722f4972f1a3ab4365880add5bbcfdcc

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

9 years agoclang-format: [JS] Allow line breaks after TypeScript type colons.
Daniel Jasper [Fri, 3 Jul 2015 10:37:23 +0000 (10:37 +0000)]
clang-format: [JS] Allow line breaks after TypeScript type colons.

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

9 years agoclang-format: [Java/JS] Properly support instanceof and its precedence.
Daniel Jasper [Fri, 3 Jul 2015 10:12:53 +0000 (10:12 +0000)]
clang-format: [Java/JS] Properly support instanceof and its precedence.

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

9 years ago[OPENMP 4.0] Fixed codegen for 'cancellation point' construct.
Alexey Bataev [Fri, 3 Jul 2015 09:56:58 +0000 (09:56 +0000)]
[OPENMP 4.0] Fixed codegen for 'cancellation point' construct.

Generate the next code for 'cancellation point':
if (__kmpc_cancellationpoint()) {
  __kmpc_cancel_barrier();
  <exit construct>;
}

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

9 years agoRevert r241330. It compiled with Visual C++ 2013 and gcc 4.9.1 (mingw) but now fails...
Yaron Keren [Fri, 3 Jul 2015 09:30:33 +0000 (09:30 +0000)]
Revert r241330. It compiled with Visual C++ 2013 and gcc 4.9.1 (mingw) but now fails the bots.

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

9 years agoReplace some const std::string & with llvm::StringRef or std::string
Yaron Keren [Fri, 3 Jul 2015 09:16:20 +0000 (09:16 +0000)]
Replace some const std::string & with llvm::StringRef or std::string
and std::move to avoid implicit std::string construction.

Patch by Eugene Kosov.

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

9 years agoclang/test/CodeGenCXX/trap-fnattr.cpp: Tweak to match MS-mangled names.
NAKAMURA Takumi [Fri, 3 Jul 2015 08:21:27 +0000 (08:21 +0000)]
clang/test/CodeGenCXX/trap-fnattr.cpp: Tweak to match MS-mangled names.

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

9 years agoDriver: Replace a couple of out of date terms in the docs
Justin Bogner [Fri, 3 Jul 2015 08:03:43 +0000 (08:03 +0000)]
Driver: Replace a couple of out of date terms in the docs

The Job base class was removed in r241310, so replace a couple of
references to it with Command. Also change another use of Job with
Action, since that's the term used in the source.

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

9 years agoRevert r241319, investigating.
Yaron Keren [Fri, 3 Jul 2015 05:31:54 +0000 (05:31 +0000)]
Revert r241319, investigating.

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

9 years agoReplace some const std::string & with llvm::StringRef or std::string
Yaron Keren [Fri, 3 Jul 2015 05:09:59 +0000 (05:09 +0000)]
Replace some const std::string & with llvm::StringRef or std::string
and std::move to avoid implicit std::string construction.

Part 1/2.

Patch by Eugene Kosov.

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

9 years agoMake corrections to r241314.
Akira Hatanaka [Fri, 3 Jul 2015 01:05:19 +0000 (01:05 +0000)]
Make corrections to r241314.

The return type of a function follows the signext attribute.

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

9 years agoFix test case to appease buildbot.
Akira Hatanaka [Fri, 3 Jul 2015 00:50:30 +0000 (00:50 +0000)]
Fix test case to appease buildbot.

Test case trap-fnattr.cpp was failng on clang-ppc64-elf-linux2 because ppc64
sign-extends the i32 return value.

This is a follow-up to r241306.

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

9 years agoDriver: Remove the Job class. NFC
Justin Bogner [Thu, 2 Jul 2015 22:52:08 +0000 (22:52 +0000)]
Driver: Remove the Job class. NFC

We had a strange relationship here where we made a list of Jobs
inherit from a single Job, but there weren't actually any places where
this arbitrary nesting was used or needed.

Simplify all of this by removing Job entirely and updating all of the
users to either work with a JobList or a single Command.

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

9 years agoDriver: Don't use reserved names. NFC
Justin Bogner [Thu, 2 Jul 2015 22:52:04 +0000 (22:52 +0000)]
Driver: Don't use reserved names. NFC

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

9 years agoAttach attribute "trap-func-name" to call sites of llvm.trap and llvm.debugtrap.
Akira Hatanaka [Thu, 2 Jul 2015 22:15:41 +0000 (22:15 +0000)]
Attach attribute "trap-func-name" to call sites of llvm.trap and llvm.debugtrap.

This is needed to use clang's command line option "-ftrap-function" for LTO and
enable changing the trap function name on a per-call-site basis.

rdar://problem/21225723

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

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

9 years agoSwitch users of the 'for (StmtRange range = stmt->children(); range; ++range)‘ patter...
Benjamin Kramer [Thu, 2 Jul 2015 21:03:14 +0000 (21:03 +0000)]
Switch users of the 'for (StmtRange range = stmt->children(); range; ++range)‘ pattern to range for loops.

The pattern was born out of the lack of range-based for loops in C++98
and is somewhat obscure. No functionality change intended.

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

9 years ago[CodeGen] Use llvm::join to simplify string joining.
Benjamin Kramer [Thu, 2 Jul 2015 21:02:39 +0000 (21:02 +0000)]
[CodeGen] Use llvm::join to simplify string joining.

While there replace stable_sort of std::string with just sort, stability
is not necessary for "simple" value types. No functional change intended.

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

9 years agoInstrProf: Add a comment to clarify an argument
Justin Bogner [Thu, 2 Jul 2015 20:47:25 +0000 (20:47 +0000)]
InstrProf: Add a comment to clarify an argument

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

9 years agoThis patch adds support for the vector merge even word and vector merge odd word
Kit Barton [Thu, 2 Jul 2015 19:29:05 +0000 (19:29 +0000)]
This patch adds support for the vector merge even word and vector merge odd word
instructions introduced in POWER8.

These are the Clang-related changes for http://reviews.llvm.org/D10704

All builtins are added in altivec.h and guarded with the POWER8_VECTOR macro.

Phabricator review: http://reviews.llvm.org/D10736

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

9 years ago[Static Analyzer] No longer include the full path of the source file in the single...
Gabor Horvath [Thu, 2 Jul 2015 19:20:46 +0000 (19:20 +0000)]
[Static Analyzer] No longer include the full path of the source file in the single file tests' bug identifiers.

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

9 years ago[Sema] Range-loopify SemaTemplateInstantiateDecl.cpp. NFC.
Davide Italiano [Thu, 2 Jul 2015 19:20:11 +0000 (19:20 +0000)]
[Sema] Range-loopify SemaTemplateInstantiateDecl.cpp. NFC.

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

9 years agoRevert "Refactored ARMTargetInfo in order to use the API of llvm/lib/Support/TargetPa...
Rafael Espindola [Thu, 2 Jul 2015 15:14:10 +0000 (15:14 +0000)]
Revert "Refactored ARMTargetInfo in order to use the API of llvm/lib/Support/TargetParser.cpp for extracting target specific information."

This reverts commit r241267. Tests were failing on the bots.

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

9 years agoclang-format: [JS] Treat regex literals like string literals.
Daniel Jasper [Thu, 2 Jul 2015 15:00:44 +0000 (15:00 +0000)]
clang-format: [JS] Treat regex literals like string literals.

Using the token type "unknown" can interfere badly with
WhitespaceManager's way of handling multiline comments.

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

9 years agoRemove whitespace from start of line, NFC.
Yaron Keren [Thu, 2 Jul 2015 14:44:35 +0000 (14:44 +0000)]
Remove whitespace from start of line, NFC.

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

9 years agoRefactored ARMTargetInfo in order to use the API of llvm/lib/Support/TargetParser.cpp
Alexandros Lamprineas [Thu, 2 Jul 2015 14:21:40 +0000 (14:21 +0000)]
Refactored ARMTargetInfo in order to use the API of llvm/lib/Support/TargetParser.cpp
for extracting target specific information.

Change-Id: Ia0b83ecdb8d9223f9c4ef38dd9206969f78e53f3

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

9 years agoclang-format: [JS] Skip comments when applying the regex-literal heuristic
Daniel Jasper [Thu, 2 Jul 2015 14:14:04 +0000 (14:14 +0000)]
clang-format: [JS] Skip comments when applying the regex-literal heuristic

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

9 years agoWhen testing for anyOf(), the test should not be for an exact type match for all...
Aaron Ballman [Thu, 2 Jul 2015 14:02:41 +0000 (14:02 +0000)]
When testing for anyOf(), the test should not be for an exact type match for all members of the set. Instead, test that all members are convertible to the common type.

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

9 years agoclang-format: [JS] Fix bug in regex literal parsing.
Daniel Jasper [Thu, 2 Jul 2015 14:01:34 +0000 (14:01 +0000)]
clang-format: [JS] Fix bug in regex literal parsing.

The lexer wasn't properly reset leading to unexpected deletions.

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

9 years agotest commit
Alexandros Lamprineas [Thu, 2 Jul 2015 13:21:34 +0000 (13:21 +0000)]
test commit

Change-Id: Ibaa2e1115544ddfa491335b81226819fd9cc04b4

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

9 years agoclang-format: [JS] Support regex literals at the start of a file.
Daniel Jasper [Thu, 2 Jul 2015 13:20:45 +0000 (13:20 +0000)]
clang-format: [JS] Support regex literals at the start of a file.

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

9 years ago[Modules] Be consistent about finding a module for framework headers
Ben Langmuir [Thu, 2 Jul 2015 13:19:48 +0000 (13:19 +0000)]
[Modules] Be consistent about finding a module for framework headers

We use findModuleForHeader() in several places, but in header search we
were not calling it when a framework module didn't show up with the
expected name, which would then lead to unexpected non-modular includes.
Now we will find the module unconditionally for frameworks.  For regular
frameworks, we use the spelling of the module name from the module map
file, and for inferred ones we use the canonical directory name.

In the future we might want to lock down framework modules sufficiently
that these name mismatches cannot happen.

rdar://problem/20465870

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

9 years agoclang-format: [JS] Fix character counting in template strings.
Daniel Jasper [Thu, 2 Jul 2015 13:08:28 +0000 (13:08 +0000)]
clang-format: [JS] Fix character counting in template strings.

Some counts were off, we don't need to take the leading newlines of the
first ` into account and some tests were just wrong.

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

9 years agoImplement an AST matcher for C++ exception catch handlers that can catch any exceptio...
Aaron Ballman [Thu, 2 Jul 2015 12:53:22 +0000 (12:53 +0000)]
Implement an AST matcher for C++ exception catch handlers that can catch any exception type (...).

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