Implement DR1460: fix handling of default initializers in unions; don't allow
more than one such initializer in a union, make mem-initializers override
default initializers for other union members, handle anonymous unions with
anonymous struct members better. Fix a couple of semi-related bugs exposed by
the tests for same.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196892 91177308-0d34-0410-b5e6-96231b3b80d8
Regenerate DR status page.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196893 91177308-0d34-0410-b5e6-96231b3b80d8
Support GNU style rule to put a space before opening parenthesis.

Summary:
The rule from the GNU style states:
"We find it easier to read a program when it has spaces before the open-parentheses and after the commas."

http://www.gnu.org/prep/standards/standards.html#index-spaces-before-open_002dparen

This patch makes clang-format adds an option to put spaces before almost all open parentheses, except the cases, where different behavior is dictated by the style rules or language syntax:
  * preprocessor:
    ** function-like macro definitions can't have a space between the macro name and the parenthesis;
    ** `#if defined(...)` can have a space, but it seems, that it's more frequently used without a space in GCC, for example;
  * never add spaces after unary operators;
  * adding spaces between two opening parentheses is controlled with the `SpacesInParentheses` option;
  * never add spaces between `[` and `(` (there's no option yet).

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D2326

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196901 91177308-0d34-0410-b5e6-96231b3b80d8
Trivial change: added 'using clang::format::FormatStyle;'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196903 91177308-0d34-0410-b5e6-96231b3b80d8
Allow predefined styles to define different options for different languages.

Summary:
Allow predefined styles to define different options for different
languages so that one can run:
  clang-format -style=google file1.cpp file2.js

or use a single .clang-format file with "BasedOnStyle: Google" for both c++ and
JS files.

Added Google style for JavaScript with "BreakBeforeTernaryOperators" set to
false.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D2364

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196909 91177308-0d34-0410-b5e6-96231b3b80d8
[mips][msa] Correct sld and sldi builtins.

Summary: The result register of these instructions is also the first operand.

Reviewers: jacksprat, dsanders

Reviewed By: dsanders

Differential Revision: http://llvm-reviews.chandlerc.com/D2362
Differential Revision: http://llvm-reviews.chandlerc.com/D2363



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196910 91177308-0d34-0410-b5e6-96231b3b80d8
Darwin: update clang test to new iOS default version (5.0)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196913 91177308-0d34-0410-b5e6-96231b3b80d8
Add ObjCARCOpts to LINK_COMPONENTS.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196915 91177308-0d34-0410-b5e6-96231b3b80d8
[CMake] Update target_link_libraries() and LLVM_LINK_COMPONENTS for each CMakeLists.txt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196916 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format-diff.py: Support -regex filter and more filename extensions

Add support for more filename extensions based on the list in the clang
plus JavaScript.

Also adds a -regex option so users can override defaults if they have unusual
file extensions or want to format everything in the diff.

Keeping with tradition the flag is modelled on Unix conventions, this time
matching the semantics of find(1).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196917 91177308-0d34-0410-b5e6-96231b3b80d8
[AArch64] Refactor the Neon vector/scalar floating-point convert implementation.
Specifically, reuse the ARM intrinsics when possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196927 91177308-0d34-0410-b5e6-96231b3b80d8
Early attempts to format in GNU style.

Summary:
This still misses a few important features, so there's no mention of
this style in the help message, but a few style rules are implemented.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D2371

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196928 91177308-0d34-0410-b5e6-96231b3b80d8
Remove IndentBlocks, which sneaked winto the previous commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196929 91177308-0d34-0410-b5e6-96231b3b80d8
[AArch64] Refactor the Neon vector/scalar floating-point convert intrinsics so
that they use float/double rather than the vector equivalents when appropriate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196931 91177308-0d34-0410-b5e6-96231b3b80d8
Objective-C. Provide fixit's for objc_bride_related
attributed CF to ObjC type conversions.
// rdar://15499111


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196935 91177308-0d34-0410-b5e6-96231b3b80d8
[AArch64] Refactor the redundant code in the EmitAArch64ScalarBuiltinExpr()
function.  No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196936 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Extend IdenticalExprChecker to check ternary operator results.

Warn if both result expressions of a ternary operator (? :) are the same.
Because only one of them will be executed, this warning will fire even if
the expressions have side effects.

Patch by Anders Rönnholm and Per Viberg!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196937 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Misc. tidying in IdenticalExprChecker.

Some things I missed when this first went in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196938 91177308-0d34-0410-b5e6-96231b3b80d8
Update clang MS inline asm tests for r196939

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196940 91177308-0d34-0410-b5e6-96231b3b80d8
[AST] In ObjCInterfaceDecl::isDesignatedInitializer(), use getMethod() instead of lookupMethod().

lookupMethod also goes through categories, which we don't need there.

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