[complex] Teach the other two binary operators on complex numbers (==
and !=) to support mixed complex and real operand types.

This requires removing an assert from SemaChecking, and adding support
both to the constant evaluator and the code generator to synthesize the
imaginary part when needed. This seemed somewhat cleaner than having
just the comparison operators force real-to-complex conversions.

I've added test cases for these operations. I'm really terrified that
there were *no* tests in-tree which exercised this.

This turned up when trying to build R after my change to the complex
type lowering.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219570 91177308-0d34-0410-b5e6-96231b3b80d8
Suppress a warning about an unused variable in NDEBUG builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219571 91177308-0d34-0410-b5e6-96231b3b80d8
clang/test/Driver: Some tests don't REQUIRE asserts any more. Remove them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219580 91177308-0d34-0410-b5e6-96231b3b80d8
CodeGen: Strip qualifiers from qualified array types in catches

While we ran getUnqualifiedType over the catch type,
it isn't enough for array types.  Use getUnqualifiedArrayType instead.

This fixes PR21252.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219582 91177308-0d34-0410-b5e6-96231b3b80d8
Allow constant expressions in pragma loop hints.

Previously loop hints such as #pragma loop vectorize_width(#) required a constant. This patch allows a constant expression to be used as well. Such as a non-type template parameter or an expression (2 * c + 1).

Reviewed by Richard Smith


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219589 91177308-0d34-0410-b5e6-96231b3b80d8
Fixed a problem in r19589.

Several systems failed to compile the array allocation of the TokenArray.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219590 91177308-0d34-0410-b5e6-96231b3b80d8
[Modules] Make header standalone. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219591 91177308-0d34-0410-b5e6-96231b3b80d8
PredefinedExpr deserialization test in dependent context.
For commit r219561 - Fix deserialization of PredefinedExpr in dependent context.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219594 91177308-0d34-0410-b5e6-96231b3b80d8
[OPENMP] Codegen for 'if' clause in 'parallel' directive.
Adds codegen for 'if' clause. Currently only for 'if' clause used with the 'parallel' directive.
If condition evaluates to true, the code executes parallel version of the code by calling __kmpc_fork_call(loc, 1, microtask, captured_struct/*context*/), where loc - debug location, 1 - number of additional parameters after "microtask" argument, microtask - is outlined finction for the code associated with the 'parallel' directive, captured_struct - list of variables captured in this outlined function.
If condition evaluates to false, the code executes serial version of the code by executing the following code:

global_thread_id.addr = alloca i32
store i32 global_thread_id, global_thread_id.addr
zero.addr = alloca i32
store i32 0, zero.addr
kmpc_serialized_parallel(loc, global_thread_id);
microtask(global_thread_id.addr, zero.addr, captured_struct/*context*/);
kmpc_end_serialized_parallel(loc, global_thread_id);

Where loc - debug location, global_thread_id - global thread id, returned by __kmpc_global_thread_num() call or passed as a first parameter in microtask() call, global_thread_id.addr - address of the variable, where stored global_thread_id value, zero.addr - implicit bound thread id (should be set to 0 for serial call), microtask() and captured_struct are the same as in parallel call.

Also this patch checks if the condition is constant and if it is constant it evaluates its value and then generates either parallel version of the code (if the condition evaluates to true), or the serial version of the code (if the condition evaluates to false).
Differential Revision: http://reviews.llvm.org/D4716


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219597 91177308-0d34-0410-b5e6-96231b3b80d8
Fix test OpenMP/parallel_if_codegen.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219598 91177308-0d34-0410-b5e6-96231b3b80d8
[OPENMP] Codegen for 'num_threads' clause in 'parallel' directive.
This patch generates call to "kmpc_push_num_threads(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_threads);" library function before calling "kmpc_fork_call" each time there is an associated "num_threads" clause in the "omp parallel" directive.
Differential Revision: http://reviews.llvm.org/D5145


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219599 91177308-0d34-0410-b5e6-96231b3b80d8
Fix incompatibility issue in /OpenMP/parallel_num_threads_codegen.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219601 91177308-0d34-0410-b5e6-96231b3b80d8
[AArch64] Add workaround for Cortex-A53 erratum (835769)

Some early revisions of the Cortex-A53 have an erratum (835769) whereby it is
possible for a 64-bit multiply-accumulate instruction in AArch64 state to
generate an incorrect result.  The details are quite complex and hard to
determine statically, since branches in the code may exist in some
circumstances, but all cases end with a memory (load, store, or prefetch)
instruction followed immediately by the multiply-accumulate operation.

The safest work-around for this issue is to make the compiler avoid emitting
multiply-accumulate instructions immediately after memory instructions and the
simplest way to do this is to insert a NOP.

This patch implements clang options to enable this workaround in the backend.

The work-around code generation is not enabled by default.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219604 91177308-0d34-0410-b5e6-96231b3b80d8
Adds support for the Cortex-A17 processor to Clang

Patch by Matthew Wahab.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219607 91177308-0d34-0410-b5e6-96231b3b80d8
[AArch64] Fixup test from A53 erratum patch after buildbot failures

Don't include stdint.h directly, instead typedef int64_t which is all we need.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219608 91177308-0d34-0410-b5e6-96231b3b80d8
More OpenMP test case compatibility fixes

Allow "signext" in a couple of more places in recently
added test cases to fix failures on SystemZ.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219615 91177308-0d34-0410-b5e6-96231b3b80d8
Relinquish ownership of MS-style inline assembly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219619 91177308-0d34-0410-b5e6-96231b3b80d8
Fix bug in DynTypedMatcher::constructVariadic() that would cause false negatives.

Summary:
Change r219118 fixed the bug for anyOf and eachOf, but it is still
present for unless.
The variadic wrapper doesn't have enough information to know how to
restrict the type. Different operators handle restrict failures in
different ways.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219622 91177308-0d34-0410-b5e6-96231b3b80d8
Fix order of evaluation bug in DynTypedMatcher::constructVariadic().

Fix order of evaluation bug in DynTypedMatcher::constructVariadic().
If it evaluates right-to-left, the vector gets moved before we read the
kind from it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219624 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Check all 'nonnull' attributes, not just the first one.

Patch by Daniel Fahlgren!

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