]> granicus.if.org Git - clang/log
clang
9 years agoclang-format: Fix bug with comments between non-trival parameters.
Daniel Jasper [Tue, 7 Oct 2014 14:45:34 +0000 (14:45 +0000)]
clang-format: Fix bug with comments between non-trival parameters.

Before:
  SomeFunction(a, a,
               // comment
                      b + x);

After:
  SomeFunction(a, a,
               // comment
               b + x);

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

9 years agoAllow dllexport alias to base destructors.
Rafael Espindola [Tue, 7 Oct 2014 13:34:42 +0000 (13:34 +0000)]
Allow dllexport alias to base destructors.

We used to avoid these, but it looks like we did so just because we were
not handling dllexport alias correctly.

Dario Domizioli fixed that, so allow these aliases.

Based on a patch by Dario Domizioli!

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

9 years agoclang-format: Add documentation about disabling formatting.
Daniel Jasper [Tue, 7 Oct 2014 12:15:15 +0000 (12:15 +0000)]
clang-format: Add documentation about disabling formatting.

Patch by Marek Kurdej, thanks!

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

9 years ago[OPENMP] 'omp teams' directive basic support.
Alexey Bataev [Tue, 7 Oct 2014 10:13:33 +0000 (10:13 +0000)]
[OPENMP] 'omp teams' directive basic support.
Includes parsing and semantic analysis for 'omp teams' directive support from OpenMP 4.0. Adds additional analysis to 'omp target' directive with 'omp teams' directive.

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

9 years ago[OPENMP] Small refactoring of EmitOMPSimdLoop helper routine.
Alexander Musman [Tue, 7 Oct 2014 08:57:09 +0000 (08:57 +0000)]
[OPENMP] Small refactoring of EmitOMPSimdLoop helper routine.
No functional changes intended.
Renamed EmitOMPSimdLoop to EmitOMPInnerLoop, I plan to re-use
it to emit inner loop in the future patches for CodeGen of the
worksharing loop directives (omp for, omp for simd).

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

9 years agodriver: Map closed standard file descriptors to /dev/null
David Majnemer [Mon, 6 Oct 2014 23:52:23 +0000 (23:52 +0000)]
driver: Map closed standard file descriptors to /dev/null

Utilize Process::FixupStandardFileDescriptors, introduced in r219170, to
guard against files from being treated as one of the standard file
descriptors.

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

9 years agoObjective-C SDK modernizer. Patch to support modernization
Fariborz Jahanian [Mon, 6 Oct 2014 23:50:37 +0000 (23:50 +0000)]
Objective-C SDK modernizer. Patch to support modernization
to NS_ENUM/NS_OPTION macros when typedef names are other
than NSInteger/NSUInteger (int8_t, etc.).
rdar://18532199

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

9 years agoUpdate title of the ReleaseNodes doc.
Eli Bendersky [Mon, 6 Oct 2014 22:45:17 +0000 (22:45 +0000)]
Update title of the ReleaseNodes doc.

It was still "3.5 (In-Progress)" - should be 3.6

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

9 years ago[PATCH][Power] Fix (and deprecate) vec_lvsl and vec_lvsr for little endian
Bill Schmidt [Mon, 6 Oct 2014 19:02:20 +0000 (19:02 +0000)]
[PATCH][Power] Fix (and deprecate) vec_lvsl and vec_lvsr for little endian

The use of the vec_lvsl and vec_lvsr interfaces are discouraged for
little endian targets since Power8 hardware is a minimum requirement,
and Power8 provides reasonable performance for unaligned vector loads
and stores.  Up till now we have not provided "correct" (i.e., big-
endian-compatible) code generation for these interfaces, as to do so
produces poorly performing code.  However, this has become the source
of too many questions.

With this patch, LLVM will now produce compatible code for these
interfaces, but will also produce a deprecation warning message for
PPC64LE when one of them is used.  This should make the porting direction
clearer to programmers.  A similar patch has recently been committed to
GCC.

This patch includes a test for the warning message.  There is a companion
patch that adds two unit tests to projects/test-suite.

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

9 years agoRemove cases that are now handled by the parent class implementation.
Rafael Espindola [Mon, 6 Oct 2014 17:45:47 +0000 (17:45 +0000)]
Remove cases that are now handled by the parent class implementation.

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

9 years agoTurn on the integrated assembler by default for ppc64 and
Eric Christopher [Mon, 6 Oct 2014 17:33:18 +0000 (17:33 +0000)]
Turn on the integrated assembler by default for ppc64 and
ppc64le.

Reviewed by Hal Finkel and Bill Schmidt.

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

9 years agoPatch to wrap up '_' as separator in version numbers
Fariborz Jahanian [Mon, 6 Oct 2014 16:46:02 +0000 (16:46 +0000)]
Patch to wrap up '_' as separator in version numbers
in availability attribute by preserving this info.
in VersionTuple and using it in pretty printing of attributes
and yet using '.' as separator when diagnosing unavailable
message calls. rdar://18490958

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

9 years agoclang-format: If in doubt, assume '+' is a binary operator.
Daniel Jasper [Mon, 6 Oct 2014 13:16:43 +0000 (13:16 +0000)]
clang-format: If in doubt, assume '+' is a binary operator.

Before:
  #define LENGTH(x, y) (x) - (y)+1

After:
  #define LENGTH(x, y) (x) - (y) + 1

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

9 years agoFix bug in DynTypedMatcher::constructVariadic() that would cause false negatives.
Samuel Benzaquen [Mon, 6 Oct 2014 13:14:30 +0000 (13:14 +0000)]
Fix bug in DynTypedMatcher::constructVariadic() that would cause false negatives.

Summary:
DynTypedMatcher::constructVariadic() where the restrict kind of the
different matchers are not related causes the matcher to have a "None"
restrict kind. This causes false negatives for anyOf and eachOf.
Change the logic to get a common ancestor if there is one.
Also added regression tests that fail without the fix.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

9 years agoUsing an explicit cast to work around MSVC 2013 not picking the conversion operator...
Aaron Ballman [Mon, 6 Oct 2014 12:42:31 +0000 (12:42 +0000)]
Using an explicit cast to work around MSVC 2013 not picking the conversion operator as expected. NFC, should fix the MSVC build bots.

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

9 years ago[OPENMP] Fix target triple of a test, which uses __int128 type
Alexander Musman [Mon, 6 Oct 2014 11:36:48 +0000 (11:36 +0000)]
[OPENMP] Fix target triple of a test, which uses __int128 type

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

9 years ago[OPENMP] Limit the loop counters to 64 bits for the worksharing loops
Alexander Musman [Mon, 6 Oct 2014 11:16:29 +0000 (11:16 +0000)]
[OPENMP] Limit the loop counters to 64 bits for the worksharing loops

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

9 years agoAdd FIXME/notes to the future.
David Blaikie [Mon, 6 Oct 2014 05:52:27 +0000 (05:52 +0000)]
Add FIXME/notes to the future.

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

9 years agoDebugInfo: Don't include implicit special members in the list of class members
David Blaikie [Mon, 6 Oct 2014 05:18:55 +0000 (05:18 +0000)]
DebugInfo: Don't include implicit special members in the list of class members

By leaving these members out of the member list, we avoid them being
emitted into type unit definitions - while still allowing the
definition/declaration to be injected into the compile unit as expected.

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

9 years agoDebugInfo: Don't include member function template specializations in the list of...
David Blaikie [Mon, 6 Oct 2014 05:06:54 +0000 (05:06 +0000)]
DebugInfo: Don't include member function template specializations in the list of class members

By leaving these members out of the member list, we avoid them being
emitted into type unit definitions - while still allowing the
definition/declaration to be injected into the compile unit as expected.

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

9 years agoMS ABI: Make comment more accurate
David Majnemer [Sun, 5 Oct 2014 06:44:55 +0000 (06:44 +0000)]
MS ABI: Make comment more accurate

The ABI for function-scope statics changed in VS "14", not MSVC 2013.

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

9 years agoMS ABI: Use '1' (instead of '0') relative scope discriminators
David Majnemer [Sun, 5 Oct 2014 06:44:53 +0000 (06:44 +0000)]
MS ABI: Use '1' (instead of '0') relative scope discriminators

This changes the scope discriminator's behavior to start at '1' instead
of '0'.  Symbol table diffing, for ABI compatibility testing, kept
finding these as false positives.

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

9 years agoMS ABI: Implement thread_local for global variables
David Majnemer [Sun, 5 Oct 2014 05:05:40 +0000 (05:05 +0000)]
MS ABI: Implement thread_local for global variables

Summary:
This add support for the C++11 feature, thread_local global variables.
The ABI Clang implements is an improvement of the MSVC ABI.  Sadly,
further improvements could be made but not without sacrificing ABI
compatibility.

The feature is implemented as follows:
- All thread_local initialization routines are pointed to from the
  .CRT$XDU section.
- All non-weak thread_local variables have their initialization routines
  call from a single function instead of getting their own .CRT$XDU
  section entry.  This is done to open up optimization opportunities to
  the compiler.
- All weak thread_local variables have their own .CRT$XDU section entry.
  This entry is in a COMDAT with the global variable it is initializing;
  this ensures that we will initialize the global exactly once.
- Destructors are registered in the initialization function using
  __tlregdtor.

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

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

9 years agoReturn a reference instead of vector copy for parentmap queries.
Benjamin Kramer [Sat, 4 Oct 2014 17:01:26 +0000 (17:01 +0000)]
Return a reference instead of vector copy for parentmap queries.

The map is immutable until the whole ASTContext dies. While there
movify a couple of copies in ASTMatchFinder away. NFC.

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

9 years agoEmit @llvm.assume for non-parameter lvalue align_value-attribute loads
Hal Finkel [Sat, 4 Oct 2014 15:26:49 +0000 (15:26 +0000)]
Emit @llvm.assume for non-parameter lvalue align_value-attribute loads

We already add the align parameter attribute for function parameters that have
the align_value attribute (or those with a typedef type having that attribute),
which is an important special case, but does not handle pointers with value
alignment assumptions that come into scope in any other way. To handle the
general case, emit an @llvm.assume-based alignment assumption whenever we load
the pointer-typed lvalue of an align_value-attributed variable (except for
function parameters, which we already deal with at entry).

I'll also note that this is more general than Intel's described support in:
  https://software.intel.com/en-us/articles/data-alignment-to-assist-vectorization
which states that the compiler inserts __assume_aligned directives in response
to align_value-attributed variables only for function parameters and for the
initializers of local variables. I think that we can make the optimizer deal
with this more-general scheme (which could lead to a lot of calls to
@llvm.assume inside of loop bodies, for example), but if not, I'll rework this
to be less aggressive.

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

9 years ago-ms-extensions: Allow __super in return stements.
Nikola Smiljanic [Sat, 4 Oct 2014 10:17:57 +0000 (10:17 +0000)]
-ms-extensions: Allow __super in return stements.

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

9 years agoMS ABI: Disallow dllimported/exported variables from having TLS
David Majnemer [Sat, 4 Oct 2014 06:51:54 +0000 (06:51 +0000)]
MS ABI: Disallow dllimported/exported variables from having TLS

Windows TLS relies on indexing through a tls_index in order to get at
the DLL's thread local variables.  However, this index is not exported
along with the variable: it is assumed that all accesses to thread local
variables are inside the same module which created the variable in the
first place.

While there are several implementation techniques we could adopt to fix
this (notably, the Itanium ABI gets this for free), it is not worth the
heroics.

Instead, let's just ban this combination.  We could revisit this in the
future if we need to.

This fixes PR21111.

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

9 years agoSema: Simplify checkAttributesAfterMerging
David Majnemer [Sat, 4 Oct 2014 06:16:45 +0000 (06:16 +0000)]
Sema: Simplify checkAttributesAfterMerging

Use getDLLAttr to factor out some common dllimport/dllexport code.

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

9 years agoPR20991: ::decltype is not valid.
Richard Smith [Sat, 4 Oct 2014 01:57:39 +0000 (01:57 +0000)]
PR20991: ::decltype is not valid.

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

9 years agoRemove stray enum keywords. MSVC sees this as a redeclaration at global scope.
Benjamin Kramer [Fri, 3 Oct 2014 22:20:30 +0000 (22:20 +0000)]
Remove stray enum keywords. MSVC sees this as a redeclaration at global scope.

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

9 years agotest: Disable standard system includes in %clang_cc1
Justin Bogner [Fri, 3 Oct 2014 22:18:49 +0000 (22:18 +0000)]
test: Disable standard system includes in %clang_cc1

This adds -nostdsysteminc to the %clang_cc1 expansion, which should
make it harder to accidentally write tests that depend on headers in
/usr/include. It also updates a few tests that use -isysroot <x> and a
darwin triple to omit the triple and use -isystem <x>/usr/include
instead, making them a little bit more general.

Incidentally, this fixes a test failure I'm seeing on darwin in
Modules/stddef.c, that happens because my system finds a stddef.h in
/usr/include.

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

9 years agoSuppress defined-but-unused warnings
Jingyue Wu [Fri, 3 Oct 2014 22:16:40 +0000 (22:16 +0000)]
Suppress defined-but-unused warnings

by adding a fake use

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

9 years agoCFE Knob for: Add a thread-model knob for lowering atomics on baremetal & single...
Jonathan Roelofs [Fri, 3 Oct 2014 21:57:44 +0000 (21:57 +0000)]
CFE Knob for: Add a thread-model knob for lowering atomics on baremetal & single threaded systems

http://reviews.llvm.org/D4985

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

9 years ago[analyzer] Refactor and cleanup IsCompleteType
Anna Zaks [Fri, 3 Oct 2014 21:49:03 +0000 (21:49 +0000)]
[analyzer] Refactor and cleanup IsCompleteType
There are three copies of IsCompleteType(...) functions in CSA and all
of them are incomplete (I experienced  crashes in some CSA's test cases).
I have replaced these function calls with Type::isIncompleteType() calls.

A patch by Aleksei Sidorin!

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

9 years ago[analyzer] Make Malloc Checker track memory allocated by if_nameindex
Anna Zaks [Fri, 3 Oct 2014 21:48:59 +0000 (21:48 +0000)]
[analyzer] Make Malloc Checker track memory allocated by if_nameindex

The MallocChecker does currently not track the memory allocated by
if_nameindex. That memory is dynamically allocated and should be freed
by calling if_freenameindex. The attached patch teaches the checker
about these functions.

Memory allocated by if_nameindex is treated as a separate allocation
"family". That way the checker can verify it is freed by the correct
function.

A patch by Daniel Fahlgren!

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

9 years ago[analyzer] Make CStringChecker correctly calculate return value of mempcpy
Anna Zaks [Fri, 3 Oct 2014 21:48:54 +0000 (21:48 +0000)]
[analyzer] Make CStringChecker correctly calculate return value of mempcpy

The return value of mempcpy is only correct when the destination type is
one byte in size. This patch casts the argument to a char* so the
calculation is also correct for structs, ints etc.

A patch by Daniel Fahlgren!

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

9 years agoInitialize MCObjectFileInfo when parsing ms-style asm.
Benjamin Kramer [Fri, 3 Oct 2014 21:48:23 +0000 (21:48 +0000)]
Initialize MCObjectFileInfo when parsing ms-style asm.

Otherwise we're left with an half-initialized bag of variables that may or may
not explode later on. Should bring the MSVC buildbot back to life.

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

9 years agoObjective-C. Assortment of improvements pretty printing
Fariborz Jahanian [Fri, 3 Oct 2014 20:05:33 +0000 (20:05 +0000)]
Objective-C. Assortment of improvements pretty printing
objective-C declarations, including printing of availability
attributes on methods.

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

9 years agoRevert "Revert "DI: LLVM schema change: fold constants into string""
Duncan P. N. Exon Smith [Fri, 3 Oct 2014 20:01:52 +0000 (20:01 +0000)]
Revert "Revert "DI: LLVM schema change: fold constants into string""

This reverts commit r218917, effectively reapplying r218913.  Original
commit message follows.

--

Update debug info testcases for an LLVM metadata schema change to fold
metadata constant operands into a single `MDString`.

Part of PR17891.

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

9 years agoASTUnit: Replace out parameter with return value, we have NRVO for this.
Benjamin Kramer [Fri, 3 Oct 2014 18:52:54 +0000 (18:52 +0000)]
ASTUnit: Replace out parameter with return value, we have NRVO for this.

And elide the copy when pushing the return value into a vector. NFC.

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

9 years agoFormat: ArrayRefize some implicit copies away.
Benjamin Kramer [Fri, 3 Oct 2014 18:52:48 +0000 (18:52 +0000)]
Format: ArrayRefize some implicit copies away.

NFC.

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

9 years agoAdd getOpenMPSimdDefaultAlignment for PowerPC
Hal Finkel [Fri, 3 Oct 2014 17:45:20 +0000 (17:45 +0000)]
Add getOpenMPSimdDefaultAlignment for PowerPC

When the aligned clause of an OpenMP simd pragma is not provided with an
explicit alignment, a target-dependent default must be used. This adds such a
default of PPC targets.

This will become slightly more complicated when BG/Q support is added (because
then it will depend on the type). For now, 16 is a correct value for all
systems, and covers Altivec and VSX vectors.

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

9 years agoAdd comment about separators must match in
Fariborz Jahanian [Fri, 3 Oct 2014 17:21:12 +0000 (17:21 +0000)]
Add comment about separators must match in
version numbers.

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

9 years agoconstexpr evaluation for __builtin_assume_aligned
Hal Finkel [Fri, 3 Oct 2014 17:18:37 +0000 (17:18 +0000)]
constexpr evaluation for __builtin_assume_aligned

Richard noted in the review of r217349 that extra handling of
__builtin_assume_aligned inside of the expression evaluator was needed. He was
right, and this should address the concerns raised, namely:

 1. The offset argument to __builtin_assume_aligned can have side effects, and
    we need to make sure that all arguments are properly evaluated.

 2. If the alignment assumption does not hold, that introduces undefined
    behavior, and undefined behavior cannot appear inside a constexpr.

and hopefully the diagnostics produced are detailed enough to explain what is
going on.

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

9 years ago[sphinx clean up] Fix warning introduced by r218957
Dan Liew [Fri, 3 Oct 2014 12:36:20 +0000 (12:36 +0000)]
[sphinx clean up] Fix warning introduced by r218957

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

9 years agoRevert changes in r218863, r218864
Asiri Rathnayake [Fri, 3 Oct 2014 09:11:41 +0000 (09:11 +0000)]
Revert changes in r218863, r218864

Summary: The changes introduced in the above two commits are giving
a rough time to one of the build bots. Reverting the changes for the
moment so that the bot can go green again.

Change-Id: Id19f6cb2a8bc292631fac2262268927563d820c2

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

9 years agoRevert r218925 - "Patch to warn if 'override' is missing"
Alexander Potapenko [Fri, 3 Oct 2014 09:02:53 +0000 (09:02 +0000)]
Revert r218925 - "Patch to warn if 'override' is missing"

This CL has caused bootstrap failures on Linux and OSX buildbots running with -Werror.

Example report from http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/13183/steps/bootstrap%20clang/logs/stdio:

================================================================
[ 91%] Building CXX object tools/clang/tools/diagtool/CMakeFiles/diagtool.dir/ShowEnabledWarnings.cpp.o
In file included from /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp:20:
In file included from /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/SIISelLowering.h:19:
/home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/SIInstrInfo.h:71:8: error: 'getLdStBaseRegImmOfs' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
  bool getLdStBaseRegImmOfs(MachineInstr *LdSt,
       ^
/home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/include/llvm/Target/TargetInstrInfo.h:815:16: note: overridden virtual function is here
  virtual bool getLdStBaseRegImmOfs(MachineInstr *LdSt,
               ^
================================================================

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

9 years agoMS ABI: Move test from virtual-inheritance to single-inheritance
David Majnemer [Fri, 3 Oct 2014 08:03:23 +0000 (08:03 +0000)]
MS ABI: Move test from virtual-inheritance to single-inheritance

The test didn't actually use virtual inheritance.

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

9 years agoMS ABI: Add a vftable test for pure virtual methods
David Majnemer [Fri, 3 Oct 2014 07:54:12 +0000 (07:54 +0000)]
MS ABI: Add a vftable test for pure virtual methods

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

9 years agoMS ABI: Clean up test to not use dllexport, check vftable entries
David Majnemer [Fri, 3 Oct 2014 07:48:27 +0000 (07:48 +0000)]
MS ABI: Clean up test to not use dllexport, check vftable entries

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

9 years agoMS ABI: Add an additional test for empty structs in C
David Majnemer [Fri, 3 Oct 2014 07:41:09 +0000 (07:41 +0000)]
MS ABI: Add an additional test for empty structs in C

Empty structs in C differ from those in C++.
- C++ requires that empty types have size 1; alignment requirements may
  increase the size of the struct.
- The C implementation doesn't let empty structs have a size under 4
  bytes.  Again, alignment requirements may increase the struct's size.

Add a test to stress these differences.

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

9 years agoMake test/CodeGen/atomic-ops.c free-standing
Hal Finkel [Fri, 3 Oct 2014 05:04:49 +0000 (05:04 +0000)]
Make test/CodeGen/atomic-ops.c free-standing

This test includes stdint.h (via stdatomic.h), which might include system
headers (and that might not work, depending on the system configuration).
Attempting to fix llvm-clang-lld-x86_64-debian-fast.

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

9 years agoMake test/Sema/atomic-ops.c free-standing
Hal Finkel [Fri, 3 Oct 2014 04:46:48 +0000 (04:46 +0000)]
Make test/Sema/atomic-ops.c free-standing

This test includes stdint.h, which might include system headers (and that might
not work, depending on the system configuration). Attempting to fix
llvm-clang-lld-x86_64-debian-fast.

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

9 years agoRevert useless part of r217349
Hal Finkel [Fri, 3 Oct 2014 04:46:46 +0000 (04:46 +0000)]
Revert useless part of r217349

Adding handling of __builtin_assume_aligned to IntExprEvaluator does not make
sense because __builtin_assume_aligned returns a pointer (not an integer).
Thanks to Richard for figuring out why this was not doing anything.

I'll add this back in a better place (PointerExprEvaluator perhaps).

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

9 years agoAdd an implementation of C11's stdatomic.h
Hal Finkel [Fri, 3 Oct 2014 04:29:40 +0000 (04:29 +0000)]
Add an implementation of C11's stdatomic.h

Adds a Clang-specific implementation of C11's stdatomic.h header. On systems,
such as FreeBSD, where a stdatomic.h header is already provided, we defer to
that header instead (using our __has_include_next technology). Otherwise, we
provide an implementation in terms of our __c11_atomic_* intrinsics (that were
created for this purpose).

C11 7.1.4p1 requires function declarations for atomic_thread_fence,
atomic_signal_fence, atomic_flag_test_and_set,
atomic_flag_test_and_set_explicit, and atomic_flag_clear, and requires that
they have external linkage. Accordingly, we provide these declarations, but if
a user elides the shadowing macros and uses them, then they must have a libc
(or similar) that actually provides definitions.

atomic_flag is implemented using _Bool as the underlying type. This is
consistent with the implementation provided by FreeBSD and also GCC 4.9 (at
least when __GCC_ATOMIC_TEST_AND_SET_TRUEVAL == 1).

Patch by Richard Smith (rebased and slightly edited by me -- Richard said I
should drive at this point).

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

9 years agoDriver: Update clang-interpreter example for r218938
Justin Bogner [Fri, 3 Oct 2014 01:08:27 +0000 (01:08 +0000)]
Driver: Update clang-interpreter example for r218938

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

9 years agoDriver: Use pointee_iterator rather than iterating over unique_ptrs
Justin Bogner [Fri, 3 Oct 2014 01:04:53 +0000 (01:04 +0000)]
Driver: Use pointee_iterator rather than iterating over unique_ptrs

There's probably never a good reason to iterate over unique_ptrs. This
lets us use range-for and say Job.foo instead of (*it)->foo in a few
places.

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

9 years agoFix interaction of max_align_t and modules.
Richard Smith [Fri, 3 Oct 2014 00:31:35 +0000 (00:31 +0000)]
Fix interaction of max_align_t and modules.

When building with modules enabled, we were defining max_align_t as a typedef
for a different anonymous struct type each time it was included, resulting in
an error if <stddef.h> is not covered by a module map and is included more than
once in the same modules-enabled compilation of C11 or C++11 code.

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

9 years agoPatch to warn if 'override' is missing
Fariborz Jahanian [Thu, 2 Oct 2014 23:13:51 +0000 (23:13 +0000)]
Patch to warn if 'override' is missing
for an overriding method if class has at least one
'override' specified on one of its methods.
Reviewed by Doug Gregor. rdar://18295240
(I have already checked in all llvm files with missing 'override'
 methods and Bob Wilson has fixed a TableGen of FastISel so
 no warnings are expected from build of llvm after this patch.
 I have already verified this).

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

9 years agoRevert "DI: LLVM schema change: fold constants into string"
Duncan P. N. Exon Smith [Thu, 2 Oct 2014 22:15:09 +0000 (22:15 +0000)]
Revert "DI: LLVM schema change: fold constants into string"

This reverts commit r218913 while I investigate some bots.

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

9 years agoDI: LLVM schema change: fold constants into string
Duncan P. N. Exon Smith [Thu, 2 Oct 2014 21:56:07 +0000 (21:56 +0000)]
DI: LLVM schema change: fold constants into string

Update debug info testcases for an LLVM metadata schema change to fold
metadata constant operands into a single `MDString`.

Part of PR17891.

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

9 years agoReflowing some comments, NFC.
Aaron Ballman [Thu, 2 Oct 2014 21:41:27 +0000 (21:41 +0000)]
Reflowing some comments, NFC.

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

9 years agoInitial support for the align_value attribute
Hal Finkel [Thu, 2 Oct 2014 21:21:25 +0000 (21:21 +0000)]
Initial support for the align_value attribute

This adds support for the align_value attribute. This attribute is supported by
Intel's compiler (versions 14.0+), and several of my HPC users have requested
support in Clang. It specifies an alignment assumption on the values to which a
pointer points, and is used by numerical libraries to encourage efficient
generation of vector code.

Of course, we already have an aligned attribute that can specify enhanced
alignment for a type, so why is this additional attribute important? The
problem is that if you want to specify that an input array of T is, say,
64-byte aligned, you could try this:

  typedef double aligned_double attribute((aligned(64)));
  void foo(aligned_double *P) {
    double x = P[0]; // This is fine.
    double y = P[1]; // What alignment did those doubles have again?
  }

the access here to P[1] causes problems. P was specified as a pointer to type
aligned_double, and any object of type aligned_double must be 64-byte aligned.
But if P[0] is 64-byte aligned, then P[1] cannot be, and this access causes
undefined behavior. Getting round this problem requires a lot of awkward
casting and hand-unrolling of loops, all of which is bad.

With the align_value attribute, we can accomplish what we'd like in a well
defined way:

  typedef double *aligned_double_ptr attribute((align_value(64)));
  void foo(aligned_double_ptr P) {
    double x = P[0]; // This is fine.
    double y = P[1]; // This is fine too.
  }

This attribute does not create a new type (and so it not part of the type
system), and so will only "propagate" through templates, auto, etc. by
optimizer deduction after inlining. This seems consistent with Intel's
implementation (thanks to Alexey for confirming the various Intel-compiler
behaviors).

As a final note, I would have chosen to call this aligned_value, not
align_value, for better naming consistency with the aligned attribute, but I
think it would be more useful to users to adopt Intel's name.

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

9 years agoAdd __sync_fetch_and_nand (again)
Hal Finkel [Thu, 2 Oct 2014 20:53:50 +0000 (20:53 +0000)]
Add __sync_fetch_and_nand (again)

Prior to GCC 4.4, __sync_fetch_and_nand was implemented as:

  { tmp = *ptr; *ptr = ~tmp & value; return tmp; }

but this was changed in GCC 4.4 to be:

  { tmp = *ptr; *ptr = ~(tmp & value); return tmp; }

in response to this change, support for sync_fetch_and_nand (and
sync_nand_and_fetch) was removed in r99522 in order to avoid miscompiling code
depending on the old semantics. However, at this point:

  1. Many years have passed, and the amount of code relying on the old
     semantics is likely smaller.

  2. Through the work of many contributors, all LLVM backends have been updated
     such that "atomicrmw nand" provides the newer GCC 4.4+ semantics (this process
     was complete July of 2014 (added to the release notes in r212635).

  3. The lack of this intrinsic is now a needless impediment to porting codes
     from GCC to Clang (I've now seen several examples of this).

It is true, however, that we still set GNUC_MINOR to 2 (corresponding to GCC
4.2). To compensate for this, and to address the original concern regarding
code relying on the old semantics, I've added a warning that specifically
details the fact that the semantics have changed and that we provide the newer
semantics.

Fixes PR8842.

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

9 years agoDiagnose mixed use of '_' and '.' as version
Fariborz Jahanian [Thu, 2 Oct 2014 17:57:26 +0000 (17:57 +0000)]
Diagnose mixed use of '_' and '.' as version
separators in my previous patch.

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

9 years ago[x32/NaCl] Check if method pointers straddle an eightbyte to classify Hi
Jan Wen Voung [Thu, 2 Oct 2014 16:56:57 +0000 (16:56 +0000)]
[x32/NaCl] Check if method pointers straddle an eightbyte to classify Hi

Summary:
Currently, with struct my_struct { int x; method_ptr y; };
a call to foo(my_struct s) may end up dropping the last 4 bytes
of the method pointer for x86_64 NaCl and x32.

When checking Has64BitPointers, also check if the method pointer
straddles an eightbyte boundary and classify Hi as well as Lo if needed.

Test Plan: test/CodeGenCXX/x86_64-arguments-nacl-x32.cpp

Reviewers: dschuff, pavel.v.chupin

Subscribers: jfb

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

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

9 years agoReapply "InstrProf: Update for the LLVM API change in r218879"
Justin Bogner [Thu, 2 Oct 2014 16:44:01 +0000 (16:44 +0000)]
Reapply "InstrProf: Update for the LLVM API change in r218879"

Reapplying now that r218887 is in.

This reverts commit r218882, reapplying r218880.

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

9 years agoPatch to accept '_' in addition to '.' as version
Fariborz Jahanian [Thu, 2 Oct 2014 16:39:45 +0000 (16:39 +0000)]
Patch to accept '_' in addition to '.' as version
number separator in "availability" attribute.
rdar://18490958

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

9 years agoRevert "InstrProf: Update for the LLVM API change in r218879"
Justin Bogner [Thu, 2 Oct 2014 16:15:37 +0000 (16:15 +0000)]
Revert "InstrProf: Update for the LLVM API change in r218879"

r218879 has been reverted for now, this needs to go to match.

This reverts commit r218880.

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

9 years agoInstrProf: Update for the LLVM API change in r218879
Justin Bogner [Thu, 2 Oct 2014 16:04:18 +0000 (16:04 +0000)]
InstrProf: Update for the LLVM API change in r218879

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

9 years agoEmit lifetime.start / lifetime.end markers for unnamed temporary objects.
Arnaud A. de Grandmaison [Thu, 2 Oct 2014 12:19:51 +0000 (12:19 +0000)]
Emit lifetime.start / lifetime.end markers for unnamed temporary objects.

This will give more information to the optimizers so that they can reuse stack slots
and reduce stack usage.

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

9 years agoFix a broken test case.
Asiri Rathnayake [Thu, 2 Oct 2014 10:45:58 +0000 (10:45 +0000)]
Fix a broken test case.

Summary: Commit r218863 broke this test case. This patch fixes it
by updating the expected output line. Should've been updated with
the original patch but for some reason it didn't fail during my
local make check.

Change-Id: I89ed28b37f67c34d1a5d28a3e47ae33d9a82a98f

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

9 years ago[ARM] Handle conflicts between -mfpu and -mfloat-abi options.
Asiri Rathnayake [Thu, 2 Oct 2014 09:56:07 +0000 (09:56 +0000)]
[ARM] Handle conflicts between -mfpu and -mfloat-abi options.

Summary: This patch implements warnings/downgradable errors for
invalid -mfpu, -mfloat-abi option combinations (e.g. -mfpu=none
-mfloat-abi=hard).

Change-Id: I94fa664e1bc0b5855ad835abd7a50a3e0395632d

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

9 years agoReduce the PR20399 test case.
David Blaikie [Wed, 1 Oct 2014 23:16:30 +0000 (23:16 +0000)]
Reduce the PR20399 test case.

I couldn't get something /really/ obvious, and I imagine Richard Smith
might be able to provide some text explaining the sequence of steps
that's demonstrated by these files - but at least it's a bit simpler
now.

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

9 years agoTest case for my r218780 patch.
Fariborz Jahanian [Wed, 1 Oct 2014 21:33:22 +0000 (21:33 +0000)]
Test case for my r218780 patch.
Suggested by Richard Smith.
rdar://18508589.

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

9 years agoFix trailing commas in AMD define.
Joerg Sonnenberger [Wed, 1 Oct 2014 21:22:17 +0000 (21:22 +0000)]
Fix trailing commas in AMD define.

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

9 years agoAdd the various signature macros.
Joerg Sonnenberger [Wed, 1 Oct 2014 21:21:42 +0000 (21:21 +0000)]
Add the various signature macros.

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

9 years agoRename bit_RDRAND to bit_RDRND to match GCC's version of this header.
Joerg Sonnenberger [Wed, 1 Oct 2014 21:21:16 +0000 (21:21 +0000)]
Rename bit_RDRAND to bit_RDRND to match GCC's version of this header.

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

9 years agoObjective-C Modernizer. Patch to remove dangling space
Fariborz Jahanian [Wed, 1 Oct 2014 20:46:32 +0000 (20:46 +0000)]
Objective-C Modernizer. Patch to remove dangling space
before the semicolon wahen modernizing to use
NS_ENUM/NS_OPTIONS macros. rdar://18498539

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

9 years agoDIBuilder: Encapsulate DIExpression's element type
Duncan P. N. Exon Smith [Wed, 1 Oct 2014 20:26:18 +0000 (20:26 +0000)]
DIBuilder: Encapsulate DIExpression's element type

Update for corresponding LLVM API change for
`DIBuilder::createExpression()`.

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

9 years agoUpdate CGDebugInfo to the updated API in LLVM.
Adrian Prantl [Wed, 1 Oct 2014 18:55:34 +0000 (18:55 +0000)]
Update CGDebugInfo to the updated API in LLVM.
Complex address expressions are no longer part of DIVariable, but
rather an extra argument to the debug intrinsics.

http://reviews.llvm.org/D4919
rdar://problem/17994491

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

9 years agoReverting r218777 while investigating buildbot breakage.
Adrian Prantl [Wed, 1 Oct 2014 18:10:14 +0000 (18:10 +0000)]
Reverting r218777 while investigating buildbot breakage.
"Update CGDebugInfo to the updated API in LLVM."

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

9 years agoc++ error recovery. Build a valid AST when trying
Fariborz Jahanian [Wed, 1 Oct 2014 18:03:51 +0000 (18:03 +0000)]
c++ error recovery. Build a valid AST when trying
to recover from parse error parsing the default
argument. Patch prevents crash after spewing 100s
of errors caused by someone who forgot to compile in c++11
mode. So no test. rdar://18508589

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

9 years agoDo not use delegated constructors.
Samuel Benzaquen [Wed, 1 Oct 2014 17:58:42 +0000 (17:58 +0000)]
Do not use delegated constructors.

Do not use delegated constructors.
It is not supported on all platforms yet.
Fixes build broken by r218769.

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

9 years agoUpdate CGDebugInfo to the updated API in LLVM.
Adrian Prantl [Wed, 1 Oct 2014 17:55:09 +0000 (17:55 +0000)]
Update CGDebugInfo to the updated API in LLVM.
Complex address expressions are no longer part of DIVariable, but
rather an extra argument to the debug intrinsics.

http://reviews.llvm.org/D4919
rdar://problem/17994491

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

9 years agoAdds 'override' to overriding methods. NFC.
Fariborz Jahanian [Wed, 1 Oct 2014 16:56:40 +0000 (16:56 +0000)]
Adds 'override' to overriding methods. NFC.
These were uncoveredby my yet undelivered patch.

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

9 years agoRefactor Matcher<T> and DynTypedMatcher to reduce overhead of casts.
Samuel Benzaquen [Wed, 1 Oct 2014 15:08:07 +0000 (15:08 +0000)]
Refactor Matcher<T> and DynTypedMatcher to reduce overhead of casts.

Summary:
This change introduces DynMatcherInterface and changes the internal
representation of DynTypedMatcher and Matcher<T> to use a generic
interface instead.
It removes unnecessary indirections and virtual function calls when
converting matchers by implicit and dynamic casts.
DynTypedMatcher now remembers the stricter type in the chain of casts
and checks it before calling into DynMatcherInterface.
This change improves our clang-tidy related benchmark by ~14%.
Also, it opens the door for more optimizations of this kind that are
coming in future changes.

As a side effect of removing these template instantiations, it also
speeds up compilation of Dynamic/Registry.cpp by ~17% and reduces the
number of
symbols generated by ~30%.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

9 years ago[ARM] Add support for Cortex-M7, FPv5-SP and FPv5-DP
Oliver Stannard [Wed, 1 Oct 2014 09:03:02 +0000 (09:03 +0000)]
[ARM] Add support for Cortex-M7, FPv5-SP and FPv5-DP

The Cortex-M7 has 3 options for its FPU: none, FPv5-SP-D16 and
FPv5-DP-D16. FPv5 has the same instructions as FP-ARMv8, so it can be
modeled using the same target feature, and all double-precision
operations are already disabled by the fp-only-sp target features.

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

9 years ago[OPENMP] Loop collapsing and codegen for 'omp simd' directive.
Alexander Musman [Wed, 1 Oct 2014 06:03:56 +0000 (06:03 +0000)]
[OPENMP] Loop collapsing and codegen for 'omp simd' directive.

This patch implements collapsing of the loops (in particular, in
presense of clause 'collapse'). It calculates number of iterations N
and expressions nesessary to calculate the nested loops counters
values based on new iteration variable (that goes from 0 to N-1)
in Sema. It also adds Codegen for 'omp simd', which uses
(and tests) this feature.

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

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

9 years agoImprove -Wuninitialized warnings for fields that are record types.
Richard Trieu [Wed, 1 Oct 2014 03:44:58 +0000 (03:44 +0000)]
Improve -Wuninitialized warnings for fields that are record types.

Get the record handling code from SelfReferenceChecker into
UninitializedFieldVisitor as well as copying the testcases.

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

9 years agoInstrProf: Avoid repeated linear searches in a hot path
Justin Bogner [Wed, 1 Oct 2014 03:33:52 +0000 (03:33 +0000)]
InstrProf: Avoid repeated linear searches in a hot path

When generating coverage regions, we were doing a linear search
through the existing regions in order to try to merge related ones.
Most of the time this would find what it was looking for in a small
number of steps and it wasn't a big deal, but in cases with many
regions and few mergeable ones this leads to an absurd compile time
regression.

This changes the coverage mapping logic to do a single sort and then
merge as we go, which is a bit simpler and about 100 times faster.
I've also added FIXMEs on a couple of behaviours that seem a little
suspect, while keeping them behaving as they were - I'll look into
these soon.

The test changes here are mostly tedious reorganization, because the
ordering of regions we output has become slightly (but not completely)
more consistent from the almost completely arbitrary ordering we got
before.

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

9 years agoInstrProf: Hide SourceMappingRegion's internals (NFC)
Justin Bogner [Wed, 1 Oct 2014 03:33:49 +0000 (03:33 +0000)]
InstrProf: Hide SourceMappingRegion's internals (NFC)

This struct has some members that are accessed directly and others
that need accessors, but it's all just public. This is confusing, so
I've changed it to a class and made more members private.

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

9 years agoUpdate uninitialized tests to ensure that field initialization has the
Richard Trieu [Tue, 30 Sep 2014 23:46:05 +0000 (23:46 +0000)]
Update uninitialized tests to ensure that field initialization has the
same coverage as the global checker.

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

9 years agoEnable both C and C++ modules with -fmodules, by switching -fcxx-modules to
Richard Smith [Tue, 30 Sep 2014 23:10:19 +0000 (23:10 +0000)]
Enable both C and C++ modules with -fmodules, by switching -fcxx-modules to
being on by default. -fno-cxx-modules can still be used to enable C modules but
not C++ modules, but C++ modules is not significantly less stable than C
modules any more.

Also remove some of the scare words from the modules documentation. We're
certainly not going to remove modules support (though we might change the
interface), and it works well enough to bootstrap and build lots of
non-trivial code.

Note that this does not represent a commitment to the current interface nor
implementation, and we still intend to follow whatever direction the C and C++
committees take regarding modules support.

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

9 years agoUpdate -Wuninitialized to be stricter on CK_NoOp casts.
Richard Trieu [Tue, 30 Sep 2014 23:04:37 +0000 (23:04 +0000)]
Update -Wuninitialized to be stricter on CK_NoOp casts.

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

9 years agoInstrProf: Remove an unused member (NFC)
Justin Bogner [Tue, 30 Sep 2014 20:21:50 +0000 (20:21 +0000)]
InstrProf: Remove an unused member (NFC)

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

9 years agoAvoid a crash after loading an #undef'd macro in code completion
Ben Langmuir [Tue, 30 Sep 2014 20:00:18 +0000 (20:00 +0000)]
Avoid a crash after loading an #undef'd macro in code completion

In code-completion, don't assume there is a MacroInfo for everything,
since we aren't serializing the def corresponding to a later #undef in
the same module.  Also setup the HadMacro bit correctly for undefs to
avoid an assertion failure.

rdar://18416901

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

9 years agoclang-format: [JS] Support AllowShortFunctionsOnASingleLine.
Daniel Jasper [Tue, 30 Sep 2014 17:57:06 +0000 (17:57 +0000)]
clang-format: [JS] Support AllowShortFunctionsOnASingleLine.

Specifically, this also counts for stuff like (with style "inline"):
  var x = function() {
    return 1;
  };

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

9 years agoCUDA: mark the target of implicit intrinsics properly
Eli Bendersky [Tue, 30 Sep 2014 17:38:34 +0000 (17:38 +0000)]
CUDA: mark the target of implicit intrinsics properly

r218624 implemented target inference for implicit special members. However,
other entities can be implicit - for example intrinsics. These can not have
inference running on them, so they should be marked host device as before. This
is the safest and most flexible setting, since by construction these functions
don't invoke anything, and we'd like them to be invokable from both host and
device code. LLVM's intrinsics definitions (where these intrinsics come from in
the case of CUDA/NVPTX) have no notion of target, so both host and device
intrinsics can be supported this way.

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

9 years agoMake sure aggregates are properly alligned on MSP430.
Job Noorman [Tue, 30 Sep 2014 11:19:13 +0000 (11:19 +0000)]
Make sure aggregates are properly alligned on MSP430.

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