]> granicus.if.org Git - clang/log
clang
9 years agoclang-format: More eagerly wrap trailing return types.
Daniel Jasper [Fri, 5 Jun 2015 13:18:09 +0000 (13:18 +0000)]
clang-format: More eagerly wrap trailing return types.

Before:
  template <typename T>
  auto aaaaaaaaaaaaaaaaaaaaaa(T t) -> decltype(eaaaaaaaaaaaaaaa<T>(t.a)
                                                   .aaaaaaaa());

After:
  template <typename T>
  auto aaaaaaaaaaaaaaaaaaaaaa(T t)
      -> decltype(eaaaaaaaaaaaaaaa<T>(t.a).aaaaaaaa());

Also add a test case for a difficult template parsing case I stumbled accross.
Needs fixing.

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

9 years agoC++ 11 rangify for loop.
Yaron Keren [Fri, 5 Jun 2015 09:40:53 +0000 (09:40 +0000)]
C++ 11 rangify for loop.

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

9 years agoclang-format: [JS] Let fat arrows have 'Assignment' precedence.
Daniel Jasper [Fri, 5 Jun 2015 08:25:37 +0000 (08:25 +0000)]
clang-format: [JS] Let fat arrows have 'Assignment' precedence.

This is a more correct representation than using "Equality" introduced
in r238942 which was a quick fix to solve an actual regression.

According to the typescript spec, arrows behave like "low-precedence"
assignments.

Before:
  var a = a.aaaaaaa((a: a) => aaaaaaaaaaaaaaaaaaaaa(bbbbbbbbb) &&
                    aaaaaaaaaaaaaaaaaaaaa(bbbbbbb));
After:
  var a = a.aaaaaaa((a: a) => aaaaaaaaaaaaaaaaaaaaa(bbbbbbbbb) &&
                              aaaaaaaaaaaaaaaaaaaaa(bbbbbbb));

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

9 years ago[Concepts] lex keywords: concept and requires
Hubert Tong [Fri, 5 Jun 2015 01:10:24 +0000 (01:10 +0000)]
[Concepts] lex keywords: concept and requires

Summary:
This patch enables lexing of `concept` and `requires` as keywords.
Further changes which add messages for future keyword compat are to
follow.

Test Plan:
Testing of C++14 + Concepts TS mode is added to
`test/Lexer/keywords_test.cpp`, which expects that the new keywords are
enabled under said mode.

Reviewers: faisalv, fraggamuffin, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

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

9 years agoRemove unused defaulted argument `IncludeTextualHeaders`.
Sean Silva [Thu, 4 Jun 2015 23:38:11 +0000 (23:38 +0000)]
Remove unused defaulted argument `IncludeTextualHeaders`.

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

9 years agoTest commit access.
Hubert Tong [Thu, 4 Jun 2015 22:53:21 +0000 (22:53 +0000)]
Test commit access.

Fixes trailing whitespace in lib/Sema/JumpDiagnostics.cpp.

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

9 years agoSimplify ARMTargetParser::parseArch(ARMTargetParser::getCanonical()), following r239099
Artyom Skrobov [Thu, 4 Jun 2015 21:31:41 +0000 (21:31 +0000)]
Simplify ARMTargetParser::parseArch(ARMTargetParser::getCanonical()), following r239099

Reviewers: rengolin

Reviewed By: rengolin

Subscribers: cfe-commits

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

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

9 years agoFix terrible python goof in clang-format.py which broke my vim
Chandler Carruth [Thu, 4 Jun 2015 21:23:07 +0000 (21:23 +0000)]
Fix terrible python goof in clang-format.py which broke my vim
integration.

Nothing is more important in life than clang-format integration with
vim. ;]

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

9 years ago[CodeGen] Add testcase for r239002.
Ahmed Bougacha [Thu, 4 Jun 2015 20:58:49 +0000 (20:58 +0000)]
[CodeGen] Add testcase for r239002.

Just realized I forgot to add it when committing.

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

9 years ago[PowerPC] This revision adds 68 of the missing "Predefined Functions for Vector Progr...
Bill Seurer [Thu, 4 Jun 2015 18:45:44 +0000 (18:45 +0000)]
[PowerPC] This revision adds 68 of the missing "Predefined Functions for Vector Programming" from appendix A of the OpenPOWER ABI for Linux Supplement document.

I also added tests for the new functions and updated another test that was looking for specific line numbers in error messages from altivec.h.

https://llvm.org/bugs/show_bug.cgi?id=23679

http://reviews.llvm.org/D10131

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

9 years agoC++11 rangify for loop.
Yaron Keren [Thu, 4 Jun 2015 18:33:04 +0000 (18:33 +0000)]
C++11 rangify for loop.

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

9 years agoAllow case-insensitive values for -mcpu for ARM
Gabor Ballabas [Thu, 4 Jun 2015 17:56:32 +0000 (17:56 +0000)]
Allow case-insensitive values for -mcpu for ARM

GCC allows case-insensitive values for -mcpu, -march and -mtune options.
This patch implements the same behaviour for the -mcpu option.

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

9 years ago[SPARC] Fix multiarch path detection for sparc and sparcv9.
James Y Knight [Thu, 4 Jun 2015 15:36:30 +0000 (15:36 +0000)]
[SPARC] Fix multiarch path detection for sparc and sparcv9.

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

9 years ago[SPARC] Fix types of size_t, intptr_t, and ptrdiff_t on Linux.
James Y Knight [Thu, 4 Jun 2015 15:36:29 +0000 (15:36 +0000)]
[SPARC] Fix types of size_t, intptr_t, and ptrdiff_t on Linux.

They should be 'int' instead of 'long int' everywhere else except
NetBSD too, from what I gather in GCC's spec files. So, optimistically
changing it for everyone else, too.

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

9 years agoRemove extraneous qualifiers due to "using namespace". NFC
Douglas Katzman [Thu, 4 Jun 2015 14:40:44 +0000 (14:40 +0000)]
Remove extraneous qualifiers due to "using namespace". NFC

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

9 years agoUse the appropriate PIE level for OpenBSD/sparc.
Brad Smith [Thu, 4 Jun 2015 08:45:23 +0000 (08:45 +0000)]
Use the appropriate PIE level for OpenBSD/sparc.

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

9 years agoFix fragile source-col-map.c test-case.
James Y Knight [Thu, 4 Jun 2015 04:15:33 +0000 (04:15 +0000)]
Fix fragile source-col-map.c test-case.

The test passing was dependent upon your source tree being checked out
in a directory with a long enough path, to cause the diagnostics to
wrap at the expected locations.

Use stdin instead, so that the error messages consistently use
<stdin> as the filename, and get wrapped consistently.

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

9 years ago[CodeGen][NEON] Emit constants for "immediate" intrinsic arguments.
Ahmed Bougacha [Thu, 4 Jun 2015 01:43:41 +0000 (01:43 +0000)]
[CodeGen][NEON] Emit constants for "immediate" intrinsic arguments.

On ARM/AArch64, we currently always use EmitScalarExpr for the immediate
builtin arguments, instead of directly emitting the constant. When the
overflow sanitizer is enabled, this generates overflow intrinsics
instead of constants, breaking assumptions in various places.

Instead, use the knowledge of "immediates" to directly emit a constant:
- teach the tablegen backend to emit the "immediate" modifiers
- use those modifiers in the NEON CodeGen, on ARM and AArch64.

Fixes PR23517.

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

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

9 years agoDriver: Don't crash when generating crash reports for *-header inputs
Justin Bogner [Thu, 4 Jun 2015 00:30:22 +0000 (00:30 +0000)]
Driver: Don't crash when generating crash reports for *-header inputs

If we crash while handling headers, the crash report mechanism
currently tries to make a string out of a null pointer when it tries
to make up a file extension.

Map *-header input types to reasonable extensions to avoid this.

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

9 years ago[analyzer]Test commit fixing 80-column violation in comment. NFC.
Devin Coughlin [Thu, 4 Jun 2015 00:18:10 +0000 (00:18 +0000)]
[analyzer]Test commit fixing 80-column violation in comment. NFC.

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

9 years agoSave getArch() in a local var instead of calling it 20 times, etc.
Douglas Katzman [Thu, 4 Jun 2015 00:15:00 +0000 (00:15 +0000)]
Save getArch() in a local var instead of calling it 20 times, etc.

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

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

9 years agoChange big 'if' statement into a switch. NFC
Douglas Katzman [Wed, 3 Jun 2015 19:40:30 +0000 (19:40 +0000)]
Change big 'if' statement into a switch. NFC

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

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

9 years ago[Hexagon] Reapply 238773 after fix to LLVM.
Colin LeMahieu [Wed, 3 Jun 2015 17:34:22 +0000 (17:34 +0000)]
[Hexagon] Reapply 238773 after fix to LLVM.

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

9 years agoclang-format: [JS] Let fat arrows have 'Equality' precedence.
Daniel Jasper [Wed, 3 Jun 2015 17:08:40 +0000 (17:08 +0000)]
clang-format: [JS] Let fat arrows have 'Equality' precedence.

This fixes a regression in literal formatting:

Before:
  aaaaaaaaaaaaa = {
    aaaaaaaaaaaaaaaaaaaaaaaaaaaa: (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
                                   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) =>
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
  };

After:
  var aaaaaaaaaaaaaaaaaaaa = {
    aaaaaaaaaaaaaaaaaaaaaaaaaaaa:
        (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
         aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) =>
                aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
  };

Also apply no-else-after-return policy.

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

9 years agoFix misleading comment. NFC
Douglas Katzman [Wed, 3 Jun 2015 16:56:50 +0000 (16:56 +0000)]
Fix misleading comment. NFC

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

9 years ago[utils] Improvements to check_cfc.py to work better with some build systems.
Russell Gallop [Wed, 3 Jun 2015 15:09:13 +0000 (15:09 +0000)]
[utils] Improvements to check_cfc.py to work better with some build systems.

Recognise options to output dependency files and don't perform checks.
Report input file name when reporting a check failure so it is more obvious in large build logs.

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

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

9 years ago[utils] Add exact check to check_cfc.py dash_s_no_change.
Russell Gallop [Wed, 3 Jun 2015 14:33:57 +0000 (14:33 +0000)]
[utils] Add exact check to check_cfc.py dash_s_no_change.

Files compiled with -via-file-asm should be byte for byte identical. This
change improves the checking on dash_s_no_change to detect non-code
differences. If there is a difference, the check goes on to compare code and
debug to try and be more informative.

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

9 years agominor test fix
Asaf Badouh [Wed, 3 Jun 2015 13:42:46 +0000 (13:42 +0000)]
minor test fix

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

9 years agoAllow replacements created from token ranges to specify language options.
Manuel Klimek [Wed, 3 Jun 2015 13:10:41 +0000 (13:10 +0000)]
Allow replacements created from token ranges to specify language options.

The default language options will lead to incorrect replacements in C++
code, for example when trying to replace nested name specifiers ending
in "::".

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

9 years agoAppend CXXDefaultInitExpr's wrapped expression to the CFG when visiting a constructor...
Enrico Pertoso [Wed, 3 Jun 2015 10:12:40 +0000 (10:12 +0000)]
Append CXXDefaultInitExpr's wrapped expression to the CFG when visiting a constructor initializer

Summary:
This patch is part of http://llvm-reviews.chandlerc.com/D2181.

In-class initializers are appended to the CFG when CFGBuilder::addInitializer is called.

Reviewers: jordan_rose, rsmith

Reviewed By: jordan_rose

Subscribers: cfe-commits, klimek

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

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

9 years agoFix typo in cross-compilation docs: "-fpu" -> "-mfpu"
Vladimir Sukharev [Wed, 3 Jun 2015 10:11:42 +0000 (10:11 +0000)]
Fix typo in cross-compilation docs: "-fpu" -> "-mfpu"

Reviewers: rengolin

Subscribers: cfe-commits

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

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

9 years agoclang-format: Properly reset BreakBeforeParameter when wrapping
Daniel Jasper [Wed, 3 Jun 2015 09:26:03 +0000 (09:26 +0000)]
clang-format: Properly reset BreakBeforeParameter when wrapping
operators to the new line.

Before:
  LOG_IF(aaa == //
         bbb)
      << a
      << b;

After:
  LOG_IF(aaa == //
         bbb)
      << a << b;

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

9 years agoFixes a typo in a comment.
Enrico Pertoso [Wed, 3 Jun 2015 09:10:58 +0000 (09:10 +0000)]
Fixes a typo in a comment.

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

9 years agoclang-format: [JS] More aggressively keep array literals on one line.
Daniel Jasper [Wed, 3 Jun 2015 08:57:36 +0000 (08:57 +0000)]
clang-format: [JS] More aggressively keep array literals on one line.

Before:
  var aaaaa: List<SomeThing> = [
    new SomeThingAAAAAAAAAAAA(),
    new SomeThingBBBBBBBBB()
  ];

After:
  var aaaaa: List<SomeThing> =
      [new SomeThingAAAAAAAAAAAA(), new SomeThingBBBBBBBBB()];

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

9 years agoclang-format: [JS] Fix bug in type colon detection.
Daniel Jasper [Wed, 3 Jun 2015 08:43:18 +0000 (08:43 +0000)]
clang-format: [JS] Fix bug in type colon detection.

Before, this couldn't be formatted at all:
  class X {
    subs = {
      'b': {
        'c': 1,
      },
    };
  }

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

9 years agoRevert "add the -mrecip driver flag and process its options (2nd try)"
Rafael Espindola [Wed, 3 Jun 2015 05:44:28 +0000 (05:44 +0000)]
Revert "add the -mrecip driver flag and process its options (2nd try)"

This reverts commit r238851.

It depends on a llvm commit that was reverted.

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

9 years ago[Sema] Make the atomic builtins more efficient by reducing volatility
David Majnemer [Wed, 3 Jun 2015 00:26:35 +0000 (00:26 +0000)]
[Sema] Make the atomic builtins more efficient by reducing volatility

The parameter types and return type do not need to be volatile just
because the pointer type's pointee type is volatile qualified.  This is
an unnecessary pessimization.

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

9 years agoFix typo in tutorial.
Douglas Katzman [Tue, 2 Jun 2015 22:40:27 +0000 (22:40 +0000)]
Fix typo in tutorial.

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

9 years ago[MSVC Compatibility] Permit static_cast from void-ptr to function-ptr
David Majnemer [Tue, 2 Jun 2015 22:15:12 +0000 (22:15 +0000)]
[MSVC Compatibility] Permit static_cast from void-ptr to function-ptr

The MSVC 2013 and 2015 implementation of std::atomic is specialized for
pointer types.  The member functions are implemented using a static_cast
from void-ptr to function-ptr which is not allowed in the standard.
Permit this conversion if -fms-compatibility is present.

This fixes PR23733.

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

9 years agoCorrect DriverInternals.rst: ccc-print-options is gone.
Douglas Katzman [Tue, 2 Jun 2015 22:06:32 +0000 (22:06 +0000)]
Correct DriverInternals.rst: ccc-print-options is gone.

Was removed in svn r189802.

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

9 years agoclang-format: [JS] Always add space after fat arrow.
Daniel Jasper [Tue, 2 Jun 2015 22:06:07 +0000 (22:06 +0000)]
clang-format: [JS] Always add space after fat arrow.

Before:
  return () =>[];

After:
  return () => [];

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

9 years agoclang-format: [JS] Array literal detection fix #4.
Daniel Jasper [Tue, 2 Jun 2015 21:57:51 +0000 (21:57 +0000)]
clang-format: [JS] Array literal detection fix #4.

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

9 years ago[x86-64 ABI] Fix for PR23082: an assertion failure when passing/returning a wrapper...
Andrea Di Biagio [Tue, 2 Jun 2015 19:34:40 +0000 (19:34 +0000)]
[x86-64 ABI] Fix for PR23082: an assertion failure when passing/returning a wrapper union in a full YMM register.

This patch fixes an assertion failure in method
'X86_64ABIInfo::GetByteVectorType'.

Method 'GetByteVectorType' (in TargetInfo.cpp) is responsible
for mapping a QualType 'Ty' (for an argument or return value) to an LLVM IR
type that, according to the ABI, must be passed in a XMM/YMM vector register.

When selecting the IR vector type, method 'GetByteVectorType' always tries to
choose the "best" IR vector type for the 'Ty' in input. In particular, if Ty
is a wrapper structure, it keeps unwrapping it until it finds a vector type VTy.
That VTy is the "preferred IR type".

However, function 'isSingleElementStructure' (used to unwrap structures) does
not know how to look through union types. So, before this patch, if Ty was in
a nest of wrapper structures with at least two union types, we would have
triggered an assertion failure (added at revision 230971).

With this patch, if method 'GetByteVectorType' fails to find the preferred
vector type, we just return a valid (although potentially 'less friendly')
vector type based on the type size. So, rather than asserting on an 'unexpected'
'Ty' in input, we conservatively return vector type <2 x double> if Ty is 16
bytes, or <4 x double> if Ty is 32 bytes.

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

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

9 years agoadd missing dependency for CodeGen lib
Sanjay Patel [Tue, 2 Jun 2015 18:02:13 +0000 (18:02 +0000)]
add missing dependency for CodeGen lib

This looks to be exposed on some bots by r238851.

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

9 years agoadd the -mrecip driver flag and process its options (2nd try)
Sanjay Patel [Tue, 2 Jun 2015 16:55:12 +0000 (16:55 +0000)]
add the -mrecip driver flag and process its options (2nd try)

The first try to land this (r238055) was reverted due to bot failures
caused by the LLVM part of the patch. That was hopefully fixed by r238788,
and the LLVM patch was resubmitted at r238842.

This is the front-end counterpart to D8982.

The -mrecip option interface is based on maintaining compatibility with gcc:
https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/i386-and-x86-64-Options.html#index-mrecip_003dopt-1627
https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/RS_002f6000-and-PowerPC-Options.html#index-mrecip-2289

...while adding more functionality (allowing users to specify the number of refinement steps for each
estimate type).

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

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

9 years agoclang-format: Don't try to detect C++ lambdas in other languages.
Daniel Jasper [Tue, 2 Jun 2015 15:31:37 +0000 (15:31 +0000)]
clang-format: Don't try to detect C++ lambdas in other languages.

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

9 years agoclang-format: [JS] Fix incorrect line length calculation.
Daniel Jasper [Tue, 2 Jun 2015 15:14:21 +0000 (15:14 +0000)]
clang-format: [JS] Fix incorrect line length calculation.

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

9 years agoclang-format: [JS] Array literal detection fix #3.
Daniel Jasper [Tue, 2 Jun 2015 15:04:29 +0000 (15:04 +0000)]
clang-format: [JS] Array literal detection fix #3.

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

9 years agoclang-format: [JS] Fix another regression when detecting array literals.
Daniel Jasper [Tue, 2 Jun 2015 14:20:08 +0000 (14:20 +0000)]
clang-format: [JS] Fix another regression when detecting array literals.

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

9 years agoclang-format: [JS] Fix regression of detecting array literals.
Daniel Jasper [Tue, 2 Jun 2015 13:56:43 +0000 (13:56 +0000)]
clang-format: [JS] Fix regression of detecting array literals.

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

9 years agoMake vim also output a helpful message in some error cases.
Manuel Klimek [Tue, 2 Jun 2015 12:01:50 +0000 (12:01 +0000)]
Make vim also output a helpful message in some error cases.

When clang-format encounters a syntax error, it will not format that
line; we're now using the same mechanism we're already using in emacs to
show a helpful error message to the user.

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

9 years agoRemove error message when using the fallback style.
Manuel Klimek [Tue, 2 Jun 2015 11:52:15 +0000 (11:52 +0000)]
Remove error message when using the fallback style.

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

9 years ago[Basic] Transition getEnvironmentVersion from getOSVersion for android
David Majnemer [Mon, 1 Jun 2015 23:38:25 +0000 (23:38 +0000)]
[Basic] Transition getEnvironmentVersion from getOSVersion for android

'android' occupies the environment component of the triple.  Let's use
getEnvironmentVersion to extract it instead of getOSVersion.

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

9 years agoReplace a few std::string& with StringRef. NFC.
Rafael Espindola [Mon, 1 Jun 2015 20:00:16 +0000 (20:00 +0000)]
Replace a few std::string& with StringRef. NFC.

Patch by Косов Евгений!

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

9 years agoRevert "[Hexagon] Test passes for hexagon target now that the backend correctly gener...
Rafael Espindola [Mon, 1 Jun 2015 19:46:36 +0000 (19:46 +0000)]
Revert "[Hexagon] Test passes for hexagon target now that the backend correctly generates relocations."

This reverts commit r238754.

It depends on r238748, which was reverted.

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

9 years agoFix PR21945: Crash in constant evaluator.
Jonathan Roelofs [Mon, 1 Jun 2015 16:23:08 +0000 (16:23 +0000)]
Fix PR21945: Crash in constant evaluator.

Patch by Косов Евгений!

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

9 years ago[Hexagon] Test passes for hexagon target now that the backend correctly generates...
Colin LeMahieu [Mon, 1 Jun 2015 15:47:46 +0000 (15:47 +0000)]
[Hexagon] Test passes for hexagon target now that the backend correctly generates relocations.

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

9 years agoclang-format: [JS] Making arrow function wrapping more consistent.
Daniel Jasper [Mon, 1 Jun 2015 09:56:32 +0000 (09:56 +0000)]
clang-format: [JS] Making arrow function wrapping more consistent.

Before:
  someFunction(() =>
               {
                 doSomething();  // break
               })
      .doSomethingElse(  // break
          );

After:
  someFunction(() => {
    doSomething();  // break
  })
      .doSomethingElse(  // break
          );

This is still bad, but at least it is consistent with what we do for other
function literals. Added corresponding tests.

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

9 years ago[MS ABI] Be a little more defensive wrt vector types
David Majnemer [Mon, 1 Jun 2015 07:41:37 +0000 (07:41 +0000)]
[MS ABI] Be a little more defensive wrt vector types

We probably shouldn't say that all appropriately sized vector types are
intel vector types (i.e. __m128, etc.) as they don't exist for all
architectures.  While this is largely academic, it'd save some debugging
if we supported such a platform.

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

9 years ago[Format] Move UnwrappedLines instead of copying.
Benjamin Kramer [Sun, 31 May 2015 11:18:05 +0000 (11:18 +0000)]
[Format] Move UnwrappedLines instead of copying.

No functional change intended.

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

9 years agoclang-format: NFC. Cleanup after r237895.
Daniel Jasper [Sun, 31 May 2015 08:51:54 +0000 (08:51 +0000)]
clang-format: NFC. Cleanup after r237895.

Specifically adhere to LLVM Coding Standards (no 'else' after
return/break/continue) and remove yet another implementation of
paren counting. We already have enough of those in the
UnwrappedLineParser.

No functional changes intended.

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

9 years agoclang-format: [JS] Fix line breaks in computed property names.
Daniel Jasper [Sun, 31 May 2015 08:40:37 +0000 (08:40 +0000)]
clang-format: [JS] Fix line breaks in computed property names.

Before:
  let foo = {
    [someLongKeyHere]: 1,
    someOtherLongKeyHere: 2, [keyLongEnoughToWrap]: 3,
    lastLongKey: 4
  };

After:
  let foo = {
    [someLongKeyHere]: 1,
    someOtherLongKeyHere: 2,
    [keyLongEnoughToWrap]: 3,
    lastLongKey: 4
  };

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

9 years agoubsan: Check for null pointers given to certain builtins, such
Nuno Lopes [Sat, 30 May 2015 16:11:40 +0000 (16:11 +0000)]
ubsan: Check for null pointers given to certain builtins, such
as memcpy, memset, memmove, and bzero.

Reviewed by: Richard Smith

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

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

9 years ago[CodeGen] Indirect fields can initialize a union
David Majnemer [Sat, 30 May 2015 09:12:07 +0000 (09:12 +0000)]
[CodeGen] Indirect fields can initialize a union

The first named data member is the field used to default initialize the
union.  An IndirectFieldDecl can introduce the first named data member
of a union.

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

9 years agoFix 80-column violations.
Eric Christopher [Fri, 29 May 2015 23:09:49 +0000 (23:09 +0000)]
Fix 80-column violations.

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

9 years agoclang/CMakeLists.txt: s/LLVM_INSTALL_PACKAGE_DIR/CLANG_INSTALL_PACKAGE_DIR/ for the...
NAKAMURA Takumi [Fri, 29 May 2015 22:58:05 +0000 (22:58 +0000)]
clang/CMakeLists.txt: s/LLVM_INSTALL_PACKAGE_DIR/CLANG_INSTALL_PACKAGE_DIR/ for the standalone configuration.

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

9 years ago[Sema] Promote compound assignment exprs. with fp16 LHS and int. RHS.
Ahmed Bougacha [Fri, 29 May 2015 22:54:57 +0000 (22:54 +0000)]
[Sema] Promote compound assignment exprs. with fp16 LHS and int. RHS.

We catch most of the various other __fp16 implicit conversions to
float, but not this one:

  __fp16 a;
  int i;
  ...
  a += i;

For which we used to generate something 'fun' like:

  %conv = sitofp i32 %i to float
  %1 = tail call i16 @llvm.convert.to.fp16.f32(float %conv)
  %add = add i16 %0, %1

Instead, when we have an __fp16 LHS and an integer RHS, we should
use float as the result type.

While there, add a bunch of missing tests for mixed
__fp16/integer expressions.

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

9 years agoARM: fix ACLE predefine for iOS's "-arch armv7s".
Tim Northover [Fri, 29 May 2015 21:28:25 +0000 (21:28 +0000)]
ARM: fix ACLE predefine for iOS's "-arch armv7s".

We were getting "#define __ARM_ARCH_7 -S__ 1" which is really not a good idea.

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

9 years agoReplace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types
Benjamin Kramer [Fri, 29 May 2015 19:42:19 +0000 (19:42 +0000)]
Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types

If the type isn't trivially moveable emplace can skip a potentially
expensive move. It also saves a couple of characters.

Call sites were found with the ASTMatcher + some semi-automated cleanup.

memberCallExpr(
    argumentCountIs(1), callee(methodDecl(hasName("push_back"))),
    on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))),
    hasArgument(0, bindTemporaryExpr(
                       hasType(recordDecl(hasNonTrivialDestructor())),
                       has(constructExpr()))),
    unless(isInTemplateInstantiation()))

No functional change intended.

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

9 years ago[CMake] Bug 19462 - Use the INSTALL(EXPORT ...) to export CMake definitions
Chris Bieneman [Fri, 29 May 2015 18:36:20 +0000 (18:36 +0000)]
[CMake] Bug 19462 - Use the INSTALL(EXPORT ...) to export CMake definitions

Summary: This patch moves all the clang library targets into a ClangTargets export list, and installs it using the CMake install(EXPORT...) command.

Reviewers: rnk

Reviewed By: rnk

Subscribers: cfe-commits

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

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

9 years ago[ARM] Adjust -march checking
John Brawn [Fri, 29 May 2015 13:10:44 +0000 (13:10 +0000)]
[ARM] Adjust -march checking

getCanonicalArchName can return an empty string for an architecture
that is well-formed but meaningless. Use parseArch to determine if
it's actually valid or not.

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

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

9 years agoFix assertion on C++ attributes in fillAttributedTypeLoc
Alexander Musman [Fri, 29 May 2015 11:24:32 +0000 (11:24 +0000)]
Fix assertion on C++ attributes in fillAttributedTypeLoc
this fixes http://llvm.org/PR17424
fillAttributedTypeLoc() function is only called with AttributeLists of either
DeclarationChunk (which is used for each type in a declarator being parsed) or
DeclSpec (which captures information about declaration specifiers).
As C++11 attributes actually appertain to declarators, they are moved straight
to the declarator’s attr list in distributeFunctionTypeAttrFromDeclSpec()
function.
'Put them wherever you like' semantics is not supported for C++11 attributes
(but is allowed for GNU attributes, for example). So when we meet an attribute
while parsing the declaration, we cannot be sure if it appertains to either
DeclarationChunk or DeclSpec.

This investigation correlates with the history of changes of SemaType.cpp:
• Asserts in fillAttributedTypeLoc() were added on 3 Mar 2011 in r126986
(http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-
        20110228/039638.html);
• Distributing C++11 attrs to the declarator was added on 14 Jan 2013
in r172504 (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-
        20130114/071830.html).
Considering all written above I changed asserts in fillAttributedTypeLoc()
to nullptr checks.

This fixes PR17424 and related assertion on
[[gnu::fastcall]] void __stdcall foo();

Author: Alexey Frolov

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

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

9 years agoRefactor MacroInfo so macro arguments can be iterated with range-based for loops.
Daniel Marjamaki [Fri, 29 May 2015 09:15:24 +0000 (09:15 +0000)]
Refactor MacroInfo so macro arguments can be iterated with range-based for loops.

No functional change intended.

Patch by Sebastian Edman!

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

9 years agoRun clang-format on MacroInfo.h
Daniel Marjamaki [Fri, 29 May 2015 08:26:48 +0000 (08:26 +0000)]
Run clang-format on MacroInfo.h

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

9 years agoclang-format: [JS] Support ES6 computed property names.
Daniel Jasper [Fri, 29 May 2015 06:19:49 +0000 (06:19 +0000)]
clang-format: [JS] Support ES6 computed property names.

Before:
  var x = {
        [a]: 1,
    b: 2
  };

After:
  var x = {
    [a]: 1,
    b: 2
  };

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

9 years agoNFC: tab => spaces
Jingyue Wu [Fri, 29 May 2015 05:43:03 +0000 (05:43 +0000)]
NFC: tab => spaces

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

9 years agowip: Remove some unused functions
Justin Bogner [Fri, 29 May 2015 02:42:14 +0000 (02:42 +0000)]
wip: Remove some unused functions

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

9 years agoRemove dead code.
Richard Smith [Thu, 28 May 2015 23:38:53 +0000 (23:38 +0000)]
Remove dead code.

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

9 years agoAST: Fix printing GNU old-style field designators
Justin Bogner [Thu, 28 May 2015 22:19:36 +0000 (22:19 +0000)]
AST: Fix printing GNU old-style field designators

Allows StmtPrinter to print old style field designators in
initializers, fixing an issue where we would print the following
invalid code:

  struct A a = {b: = 3, .c = 4};

Patch by Nick Sumner. Thanks!

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

9 years agoImprove user documentation on profiling.
Diego Novillo [Thu, 28 May 2015 21:30:04 +0000 (21:30 +0000)]
Improve user documentation on profiling.

This clarifies the relationship between instrumentation and sampling based PGO,
code coverage analysis and the different formats supported by sample
profiling.

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

9 years ago[omp] Loosen the driver test enough so that overriding the defaults
Chandler Carruth [Thu, 28 May 2015 21:20:14 +0000 (21:20 +0000)]
[omp] Loosen the driver test enough so that overriding the defaults
works well for folks.

This isn't terribly clean (sadly) but after chatting with both Eric and
Richard, nothing cleaner really emerged. The clean way of doing this is
a *lot* of work for extremely little benefit here.

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

9 years ago[omp] Fix a typo in a comment and a line I forgot to clang-format that
Chandler Carruth [Thu, 28 May 2015 21:10:31 +0000 (21:10 +0000)]
[omp] Fix a typo in a comment and a line I forgot to clang-format that
Justin pointed out in post-commit review.

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

9 years ago[Format] Skip creating temporary std::strings when filling another string.
Benjamin Kramer [Thu, 28 May 2015 19:55:49 +0000 (19:55 +0000)]
[Format] Skip creating temporary std::strings when filling another string.

No functional change intended.

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

9 years ago[CodeGen] Update a test-case affected by folding IntToPtr/PtrToInt into Loads
David Majnemer [Thu, 28 May 2015 18:51:36 +0000 (18:51 +0000)]
[CodeGen] Update a test-case affected by folding IntToPtr/PtrToInt into Loads

Folding IntToPtr or PtrToInt into Loads, due to r238452,
perturbs the mips-varargs test-case.

Patch by Philip Pfaffe!

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

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

9 years agoGet the dll storage class right for structors of classes exported/imported via explic...
Hans Wennborg [Thu, 28 May 2015 17:44:56 +0000 (17:44 +0000)]
Get the dll storage class right for structors of classes exported/imported via explicit instantiation (PR23667)

This is a follow-up to r238266. It turned out structors are codegened through a different path,
and didn't get the storage class set in EmitGlobalFunctionDefinition.

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

9 years ago[ARM] Be less specific about the error message expected.
Ranjeet Singh [Thu, 28 May 2015 15:55:34 +0000 (15:55 +0000)]
[ARM] Be less specific about the error message expected.

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

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

9 years ago[ARMTargetParser] FIXME MachO arch names. NFC
Renato Golin [Thu, 28 May 2015 15:49:28 +0000 (15:49 +0000)]
[ARMTargetParser] FIXME MachO arch names. NFC

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

9 years ago[ARMTargetParser] FIXME on getLLVMArchSuffixForARM. NFC
Renato Golin [Thu, 28 May 2015 15:05:53 +0000 (15:05 +0000)]
[ARMTargetParser] FIXME on getLLVMArchSuffixForARM. NFC

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

9 years ago[ARMTargetParser] Removing string parsing from getCPUDefineSuffix. NFC.
Renato Golin [Thu, 28 May 2015 12:11:11 +0000 (12:11 +0000)]
[ARMTargetParser] Removing string parsing from getCPUDefineSuffix. NFC.

Yet another FIXME from ARMTargetParser.

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

9 years agoFix PPC failure. Adjust CHECK pattern.
Diego Novillo [Thu, 28 May 2015 11:25:52 +0000 (11:25 +0000)]
Fix PPC failure. Adjust CHECK pattern.

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

9 years agoclang-format: Lower binding strengths created by the [] created by ObjC
Daniel Jasper [Thu, 28 May 2015 07:21:50 +0000 (07:21 +0000)]
clang-format: Lower binding strengths created by the [] created by ObjC
method expressions and array literals. They should not bind stronger
than regular parentheses or the braces of braced lists.

Specific test case in JavaScript:
Before:
  var aaaaa: List<
      SomeThing> = [new SomeThingAAAAAAAAAAAA(), new SomeThingBBBBBBBBB()];

After:
  var aaaaa: List<SomeThing> = [
    new SomeThingAAAAAAAAAAAA(),
    new SomeThingBBBBBBBBB()
  ];

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

9 years ago[Basic] Define __declspec for cygwin
David Majnemer [Thu, 28 May 2015 04:36:18 +0000 (04:36 +0000)]
[Basic] Define __declspec for cygwin

Cygwin (and MinGW) targets define __declspec to __attribute__ unless
-fms-extensions is specified.  It turns out that cygwin headers rely on
the existence of this macro.

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

9 years ago[omp] Re-work Clang's handling of -fopenmp and undo r237769.
Chandler Carruth [Thu, 28 May 2015 01:52:38 +0000 (01:52 +0000)]
[omp] Re-work Clang's handling of -fopenmp and undo r237769.

This isn't an actual revert of r237769, it just restores the behavior of
the Clang driver prior to it while completely re-implementing how that
behavior works.

This also re-does the work of making the default OpenMP runtime
selectable at CMake (or configure) time to work in the way all of our
other such hooks do (config.h, configure and cmake hooks, etc.).

I've re-implemented how we manage the '-fopenmp' flagset in an important
way. Now, the "default" hook just makes '-fopenmp' equivalent to
'-fopenmp=<default>' rather than a separate special beast. Also, there
is an '-fno-openmp' flag which does the obvious thing. Also, the code is
shared between all the places to select a known OpenMP runtime and act
on it.

Finally, and most significantly, I've taught the driver to inspect the
selected runtime when choosing whether to propagate the '-fopenmp' flag
to the frontend in the CC1 commandline. Without this, it isn't possible
to use Clang with libgomp, even if you were happy with the serial,
boring way in which it worked previously (ignoring all #pragmas but
linking in the library to satisfy direct calls into the runtime).

While I'm here, I've gone ahead and sketched out a path for the future
name of LLVM's OpenMP runtime (libomp) and the legacy support for its
current name (libiomp5) in what seems a more reasonable way.

To re-enable LLVM's OpenMP runtime (which I think should wait until the
normal getting started instructions are a reasonable way for falks to
check out, build, and install Clang with the runtime) all that needs to
change is the default string in the CMakeLists.txt and configure.ac
file. No code changes necessary.

I also added a test for the driver's behavior around OpenMP since it was
*completely missing* previously. Makes it unsurprising that we got it
wrong.

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

9 years agoAdded doxygen comments for the intrinsics.
Ekaterina Romanova [Thu, 28 May 2015 01:25:25 +0000 (01:25 +0000)]
Added doxygen comments for the intrinsics.

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

9 years agoUpdate -Winvalid-noreturn to handle destructors better.
Richard Trieu [Thu, 28 May 2015 00:14:02 +0000 (00:14 +0000)]
Update -Winvalid-noreturn to handle destructors better.

When checking if a function is noreturn, consider a codepath to be noreturn if
the path destroys a class and the class destructor, base class destructors, or
member field destructors are marked noreturn.

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

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

9 years agoSet function entry counts with -fprofile-instr-use.
Diego Novillo [Wed, 27 May 2015 21:58:42 +0000 (21:58 +0000)]
Set function entry counts with -fprofile-instr-use.

This generates function entry counts from instrumentation profiles.

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

9 years agoIt appears these exports are needed, as wmmintrin.h includes them.
John Thompson [Wed, 27 May 2015 18:26:41 +0000 (18:26 +0000)]
It appears these exports are needed, as wmmintrin.h includes them.

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

9 years agoARMTargetParser FIXME getCPUProfile A/R/M
Renato Golin [Wed, 27 May 2015 14:15:12 +0000 (14:15 +0000)]
ARMTargetParser FIXME getCPUProfile A/R/M

This is the last of the easy ones.

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

9 years agoARMTargetParser FIXME: ARMv8 detection for hdiv
Renato Golin [Wed, 27 May 2015 13:33:00 +0000 (13:33 +0000)]
ARMTargetParser FIXME: ARMv8 detection for hdiv

Avoiding ugly combination of string parsing in the front-end. We still
need to move away from CPU parsing at all, but that's for a different
commit.

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

9 years agoclang-format: [JS] Fix incorrect detection of ternary expressions.
Daniel Jasper [Wed, 27 May 2015 05:37:40 +0000 (05:37 +0000)]
clang-format: [JS] Fix incorrect detection of ternary expressions.

A definintion like this could not be formatted at all:
  constructor({aa}: {
    aa?: string,
    aaaaaaaa?: string,
    aaaaaaaaaaaaaaa?: boolean,
    aaaaaa?: List<string>
  }) {
  }

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