]> granicus.if.org Git - clang/log
clang
9 years ago[Objective-C Sema] patch to introduce IndependentClass
Fariborz Jahanian [Thu, 16 Apr 2015 18:38:44 +0000 (18:38 +0000)]
[Objective-C Sema] patch to introduce IndependentClass
attribute to be placed on Objective-C pointer typedef
to make them strong enough so on their "new" method
family no attempt is made to override these
types. rdar://20255473

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

9 years agoDebugInfo: Update for LLVM API change in DIBuilder (r235111)
Duncan P. N. Exon Smith [Thu, 16 Apr 2015 16:36:45 +0000 (16:36 +0000)]
DebugInfo: Update for LLVM API change in DIBuilder (r235111)

LLVM r235111 changed the `DIBuilder` API to stop using `DIDescriptor`
and its subclasses.  Rolled into this was some tightening up of types:

  - Scopes: `DIDescriptor` => `MDScope*`.
  - Generic debug nodes: `DIDescriptor` => `DebugNode*`.
  - Subroutine types: `DICompositeType` => `MDSubroutineType*`.
  - Composite types: `DICompositeType` => `MDCompositeType*`.

Note that `DIDescriptor` wraps `MDNode`, and `DICompositeType` wraps
`MDCompositeTypeBase`.

It's this new type strictness that requires changes here.

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

9 years ago[AArch64] Add v8.1a architecture
Vladimir Sukharev [Thu, 16 Apr 2015 15:53:09 +0000 (15:53 +0000)]
[AArch64] Add v8.1a architecture

Add support for AArch64 v8.1 architecture. Briefly it is described on http://community.arm.com/groups/processors/blog/2014/12/02/the-armv8-a-architecture-and-its-ongoing-development

Reviewers: jmolloy

Subscribers: cfe-commits

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

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

9 years ago[OPENMP] Fix for checking of data-sharing attributes for canonical var decls only.
Alexey Bataev [Thu, 16 Apr 2015 13:49:42 +0000 (13:49 +0000)]
[OPENMP] Fix for checking of data-sharing attributes for canonical var decls only.

Currently checks for active data-sharing attributes for variables are performed for found var decls. Instead these checks must be performed for canonical decls of these variables to avoid possible troubles with with the differently qualified re-declarations of the same variable, for example:
namespace A { int x; }
namespace B { using A::x; }
Both A::x and B::x actually reference the same object A::x and this fact must be taken into account during data-sharing attributes analysis.

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

9 years agoclang-format: add an option for fallback style in vimrc
Daniel Jasper [Thu, 16 Apr 2015 08:26:37 +0000 (08:26 +0000)]
clang-format: add an option for fallback style in vimrc

With this patch, clang-format.py will search and use existing .clang-format
file if there is one and fallback to the specific format style if
not. It should cover the projects which don't have .clang-format
files in their source. As the option fallback-style is available in
clang 3.5 or later, it is safe to use.

Patch by "Chilledheart" (http://reviews.llvm.org/D8489).

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

9 years agoclang-format: [JS] handle comments in template strings.
Daniel Jasper [Thu, 16 Apr 2015 08:20:51 +0000 (08:20 +0000)]
clang-format: [JS] handle comments in template strings.

Patch by Martin Probst. Thank you.

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

9 years agoclang-format: Undo r214508. It was essentially always removing the
Daniel Jasper [Thu, 16 Apr 2015 07:02:19 +0000 (07:02 +0000)]
clang-format: Undo r214508. It was essentially always removing the
space where we already had the flag ObjCSpaceBeforeProtocolList to
control it. I don't know what I was thinking.

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

9 years ago[OPENMP] Codegen for 'copyin' clause in 'parallel' directive.
Alexey Bataev [Thu, 16 Apr 2015 05:39:01 +0000 (05:39 +0000)]
[OPENMP] Codegen for 'copyin' clause in 'parallel' directive.

Emits the following code for the clause at the beginning of the outlined function for implicit threads:

if (<not a master thread>) {
  ...
  <thread local copy of var> = <master thread local copy of var>;
  ...
}
<sync point>;
Checking for a non-master thread is performed by comparing of the address of the thread local variable with the address of the master's variable. Master thread always uses original variables, so you always know the address of the variable in the master thread.
Differential Revision: http://reviews.llvm.org/D9026

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

9 years ago[OPENMP] Codegen for 'lastprivate' clause in 'for' directive.
Alexey Bataev [Thu, 16 Apr 2015 04:54:05 +0000 (04:54 +0000)]
[OPENMP] Codegen for 'lastprivate' clause in 'for' directive.

#pragma omp for lastprivate(<var>)
for (i = a; i < b; ++b)
  <BODY>;

This construct is translated into something like:

  <last_iter> = alloca i32
  <lastprivate_var> = alloca <type>
  <last_iter> = 0
  ; No initializer for simple variables or a default constructor is called for objects.
  ; For arrays perform element by element initialization by the call of the default constructor.
  ...
  OMP_FOR_START(...,<last_iter>, ..); sets <last_iter> to 1 if this is the last iteration.
  <BODY>
  ...
  OMP_FOR_END
  if (<last_iter> != 0) {
    <var> = <lastprivate_var> ; Update original variable with the lastprivate value.
  }
  call __kmpc_cancel_barrier() ; an implicit barrier to avoid possible data race.

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

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

9 years agoDebugInfo: Prepare for DIDescriptor to be gutted in LLVM
Duncan P. N. Exon Smith [Thu, 16 Apr 2015 01:53:23 +0000 (01:53 +0000)]
DebugInfo: Prepare for DIDescriptor to be gutted in LLVM

All the API is about to be dropped from `DIDescriptor` in LLVM, so stop
using it.

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

9 years agoDebugInfo: Prepare for DIScope to be gutted in LLVM
Duncan P. N. Exon Smith [Thu, 16 Apr 2015 01:36:36 +0000 (01:36 +0000)]
DebugInfo: Prepare for DIScope to be gutted in LLVM

An upcoming LLVM commit will gut `DIScope`, so just use `MDScope*`
directly.

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

9 years agoDebugInfo: Prepare for DIType to be gutted
Duncan P. N. Exon Smith [Thu, 16 Apr 2015 01:00:56 +0000 (01:00 +0000)]
DebugInfo: Prepare for DIType to be gutted

`DIType` and its subclasses are about to be gutted in LLVM.  Prepare for
that by treating these like the raw pointers they wrap.

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

9 years agoDebugInfo: Prepare for LLVM change removing DIType::isValid()
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 23:48:50 +0000 (23:48 +0000)]
DebugInfo: Prepare for LLVM change removing DIType::isValid()

This is being replaced with a null check.

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

9 years agoComment parsing: fix an assertion failure on a verbatim block terminated with "**/"
Dmitri Gribenko [Wed, 15 Apr 2015 23:45:43 +0000 (23:45 +0000)]
Comment parsing: fix an assertion failure on a verbatim block terminated with "**/"

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

9 years agoDebugInfo: Prepare for LLVM gutting DICompileUnit/DIFile
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 23:19:15 +0000 (23:19 +0000)]
DebugInfo: Prepare for LLVM gutting DICompileUnit/DIFile

An upcoming LLVM commit will gut `DICompileUnit` and `DIFile`, so start
treating them more like pointers.

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

9 years agoDon't crash when a selectany symbol would get common linkage
Nico Weber [Wed, 15 Apr 2015 23:04:24 +0000 (23:04 +0000)]
Don't crash when a selectany symbol would get common linkage

Things can't both be in comdats and have common linkage, so never give things
in comdats common linkage. Common linkage is only used in .c files, and the
only thing that can trigger a comdat in c is selectany from what I can tell.
Fixes PR23243.

Also address an over-the-shoulder review comment from rnk by moving the
hasAttr<SelectAnyAttr>() in Decl.cpp around a bit. It only makes a minor
difference for selectany on global variables, so it goes well with the rest of
this patch.

http://reviews.llvm.org/D9042

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

9 years agoFix for PR20402 in -Wconsumed.
DeLesley Hutchins [Wed, 15 Apr 2015 22:32:44 +0000 (22:32 +0000)]
Fix for PR20402 in -Wconsumed.
https://llvm.org/bugs/show_bug.cgi?id=20402
Patch by Chris Wailes.

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

9 years agoCreate a frontend flag to disable CUDA cross-target call checks
Eli Bendersky [Wed, 15 Apr 2015 22:27:06 +0000 (22:27 +0000)]
Create a frontend flag to disable CUDA cross-target call checks

For CUDA source, Sema checks that the targets of call expressions make sense
(e.g. a host function can't call a device function).

Adding a flag that lets us skip this check. Motivation: for source-to-source
translation tools that have to accept code that's not strictly kosher CUDA but
is still accepted by nvcc. The source-to-source translation tool can then fix
the code and leave calls that are semantically valid for the actual compilation
stage.

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

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

9 years agoclang-format a line containing nothing but a "{". No behavior change.
Nico Weber [Wed, 15 Apr 2015 21:53:00 +0000 (21:53 +0000)]
clang-format a line containing nothing but a "{". No behavior change.

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

9 years agoMake __declspec(selectany) turn variable declartions into definitions.
Nico Weber [Wed, 15 Apr 2015 21:50:06 +0000 (21:50 +0000)]
Make __declspec(selectany) turn variable declartions into definitions.

Fixes PR23242.

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

9 years agoDebugInfo: Pass DebugLocs when creating intrinsics
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 21:18:30 +0000 (21:18 +0000)]
DebugInfo: Pass DebugLocs when creating intrinsics

Update for LLVM API change r235041 that makes `DIBuilder` require a
`DebugLoc` to create a debug info intrinsic.

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

9 years agoFix docs typo in FunctionTemplateSpecializationInfo
Jonathan Roelofs [Wed, 15 Apr 2015 20:47:22 +0000 (20:47 +0000)]
Fix docs typo in FunctionTemplateSpecializationInfo

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

9 years ago[Objective-C Sema]This patch fixes the warning when clang issues
Fariborz Jahanian [Wed, 15 Apr 2015 17:26:21 +0000 (17:26 +0000)]
[Objective-C Sema]This patch fixes the warning when clang issues
"multiple methods named '<selector>' found" warning by noting
the method that is actualy used. It also cleans up and refactors
code in this area and selects a method that matches actual arguments
in case of receiver being a forward class object.
rdar://19265430

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

9 years agoclang-cl: support -fsyntax-only (PR23197)
Hans Wennborg [Wed, 15 Apr 2015 10:02:21 +0000 (10:02 +0000)]
clang-cl: support -fsyntax-only (PR23197)

This might help running Clang tooling (which appends this option)
with clang-cl command-lines.

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

9 years agoChanged test to not brake ARM buildbots, NFC.
Alexey Bataev [Wed, 15 Apr 2015 09:52:50 +0000 (09:52 +0000)]
Changed test to not brake ARM buildbots, NFC.

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

9 years agoRevert "[CodeGen] Fix crash with duplicated mangled name."
Renato Golin [Wed, 15 Apr 2015 08:44:40 +0000 (08:44 +0000)]
Revert "[CodeGen] Fix crash with duplicated mangled name."

This reverts commit r234767, as it was breaking all ARM buildbots for two days and the
assert is not in the code, making it difficult to spot the error, which would keep the
bots red for a few more days. New errors were silently introduced because of this bug,
and we don't want this to escalate.

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

9 years agoclang-format: Determine "in" as a keyword in ObjC for loops more precisely
Daniel Jasper [Wed, 15 Apr 2015 07:26:18 +0000 (07:26 +0000)]
clang-format: Determine "in" as a keyword in ObjC for loops more precisely

Before:
  for (int i = 0; i < in [a]; ++i) ..

After:
  for (int i = 0; i < in[a]; ++i) ..

Also do some related cleanups.

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

9 years ago[OPENMP] Codegen for 'firstprivate' clause in 'for' directive.
Alexey Bataev [Wed, 15 Apr 2015 04:52:20 +0000 (04:52 +0000)]
[OPENMP] Codegen for 'firstprivate' clause in 'for' directive.

Adds proper codegen for 'firstprivate' clause in for directive. Initially codegen for 'firstprivate' clause was implemented for 'parallel' directive only.
Also this patch emits sync point only after initialization of firstprivate variables, not all private variables. This sync point is not required for privates, lastprivates etc., only for initialization of firstprivate variables.
Differential Revision: http://reviews.llvm.org/D8660

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

9 years agoUse concrete type instead of auto in for-loop. No functionality change.
Richard Trieu [Wed, 15 Apr 2015 03:48:48 +0000 (03:48 +0000)]
Use concrete type instead of auto in for-loop.  No functionality change.

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

9 years agouselistorder: Remove dead include
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 03:04:45 +0000 (03:04 +0000)]
uselistorder: Remove dead include

Forgot to remove the include in r234970

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

9 years agouselistorder: -mllvm -preserve-ll-use-list-order => -emit-llvm-uselists
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 02:45:28 +0000 (02:45 +0000)]
uselistorder: -mllvm -preserve-ll-use-list-order => -emit-llvm-uselists

Follow up to r234962, start respecting `-emit-llvm-uselists even for
LLVM assembly.  Note that the driver never passes this flag; this is
just a interface convenience/consistency for those using `-cc1`
directly.  This required LLVM r234969 (and predecessors).

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

9 years agoChange range-based for-loops to be -Wrange-loop-analysis clean.
Richard Trieu [Wed, 15 Apr 2015 01:21:42 +0000 (01:21 +0000)]
Change range-based for-loops to be -Wrange-loop-analysis clean.
No functionality change.

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

9 years agouselistorder: -mllvm -preserve-bc-use-list-order => -emit-llvm-uselists
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 01:16:18 +0000 (01:16 +0000)]
uselistorder: -mllvm -preserve-bc-use-list-order => -emit-llvm-uselists

Stop relying on `cl::opt` to pass along the driver's decision to
preserve use-lists.  Create a new `-cc1` option called
`-emit-llvm-uselists` that does the right thing (when -emit-llvm-bc).
Note that despite its generic name, it *doesn't* do the right thing when
-emit-llvm (LLVM assembly) yet.  I'll hook that up soon.

This doesn't really change the behaviour of the driver.  The default is
still to preserve use-lists for `clang -emit-llvm` and `clang
-save-temps`, and nothing else.  But it stops relying on global state
(and also is a nicer interface for hackers using `clang -cc1`).

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

9 years agoMove the logic to avoid double global emission from Sema to CodeGen
Reid Kleckner [Wed, 15 Apr 2015 01:08:06 +0000 (01:08 +0000)]
Move the logic to avoid double global emission from Sema to CodeGen

Reverts the code changes from r234675 but keeps the test case.

We were already maintaining a DenseMap of globals with dynamic
initializers anyway.

Fixes the test case from PR23234.

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

9 years agouselistorder: Update for LLVM API change in r234959
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 00:36:14 +0000 (00:36 +0000)]
uselistorder: Update for LLVM API change in r234959

Now that `addBitcodeWriterPass()` requires an explicit bit to preserve
use-list order, send it in from `clang`.  It looks like I'll be able to
push this up to the `-cc1` options.

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

9 years agoReland r234613 (and follow-ups 234614, 234616, 234618)
Reid Kleckner [Tue, 14 Apr 2015 20:59:00 +0000 (20:59 +0000)]
Reland r234613 (and follow-ups 234614, 234616, 234618)

The frameescape intrinsic cannot be inlined, so I fixed the inliner in
r234937. This should address PR23216.

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

9 years agoIR: Change clang to set -preserve-bc-uselistorder
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 18:30:13 +0000 (18:30 +0000)]
IR: Change clang to set -preserve-bc-uselistorder

Change `clang` to set `-preserve-bc-uselistorder` for the driver options
`-emit-llvm` and `-save-temps`.  The former is useful for reproducing
results from `clang` in `opt` or `llc`, while the latter prevents
`-save-temps` from affecting the output.  This is part of PR5680.

`-preserve-bc-uselistorder=true` is currently on by default, but a
follow-up commit in LLVM will reverse it.

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

9 years ago[SemaCXX patch] Patch to fix a crash when a 'delete' constructor
Fariborz Jahanian [Tue, 14 Apr 2015 17:21:58 +0000 (17:21 +0000)]
[SemaCXX patch] Patch to fix a crash when a 'delete' constructor
is being accessed. Reviewed by Richard Smith.
rdar://20281011

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

9 years agoUse raw_pwrite_stream in clang.
Rafael Espindola [Tue, 14 Apr 2015 15:15:49 +0000 (15:15 +0000)]
Use raw_pwrite_stream in clang.

This is a small improvement to -emit-pth and allows llvm to start requiring it.

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

9 years agoR600: Add GCC reg names
Tom Stellard [Tue, 14 Apr 2015 14:36:56 +0000 (14:36 +0000)]
R600: Add GCC reg names

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

9 years ago[analyzer] This implements potential undefbehavior.ZeroAllocDereference checker.
Anton Yartsev [Tue, 14 Apr 2015 14:18:04 +0000 (14:18 +0000)]
[analyzer] This implements potential undefbehavior.ZeroAllocDereference checker.

TODO: support realloc(). Currently it is not possible due to the present realloc() handling. Currently RegionState is not being attached to realloc() in case of a zero Size argument.

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

9 years ago[Mips] Generate warning for invalid '-mnan' and '-march' combinations
Petar Jovanovic [Tue, 14 Apr 2015 12:49:08 +0000 (12:49 +0000)]
[Mips] Generate warning for invalid '-mnan' and '-march' combinations

This patch generates a warning for invalid combination of '-mnan' and
'-march' options, it properly sets NaN encoding for a given '-march',
and it passes a proper NaN encoding to the assembler.

Patch by Vladimir Radosavljevic.

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

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

9 years agoRemove useless statement.
Nikola Smiljanic [Tue, 14 Apr 2015 12:33:33 +0000 (12:33 +0000)]
Remove useless statement.

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

9 years ago[OPENMP] Fixed codegen for arrays in 'copyprivate' clause.
Alexey Bataev [Tue, 14 Apr 2015 05:11:24 +0000 (05:11 +0000)]
[OPENMP] Fixed codegen for arrays in 'copyprivate' clause.

Fixed a bug with codegen of variables with array types specified in 'copyprivate' clause of 'single' directive.
Differential Revision: http://reviews.llvm.org/D8914

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

9 years ago[OPENMP] Initial codegen for 'parallel sections' directive.
Alexey Bataev [Tue, 14 Apr 2015 03:29:22 +0000 (03:29 +0000)]
[OPENMP] Initial codegen for 'parallel sections' directive.

Emits code for outlined 'parallel' directive with the implicitly inlined 'sections' directive:

...
call __kmpc_fork_call(..., outlined_function, ...);
...

define internal void outlined_function(...) {
    <code for implicit sections directive>;
}
Differential Revision: http://reviews.llvm.org/D8997

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

9 years agoDebugInfo: Prepare for DISubprogram/DILexicalBlock* to be gutted
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 03:24:14 +0000 (03:24 +0000)]
DebugInfo: Prepare for DISubprogram/DILexicalBlock* to be gutted

An upcoming LLVM commit will remove this API, so stop using it.  Just
access the raw pointers using `operator->()`.

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

9 years agoAdd new warning -Wrange-loop-analysis to warn on copies during loops.
Richard Trieu [Mon, 13 Apr 2015 22:08:55 +0000 (22:08 +0000)]
Add new warning -Wrange-loop-analysis to warn on copies during loops.

-Wrange-loop-analysis is a subgroup of -Wloop-analysis and will warn when
a range-based for-loop makes copies of the elements in the range.  If possible,
suggest the proper type to prevent copies, or the non-reference to help
distinguish copy versus non-copy forms.  Existing warnings in -Wloop-analysis
are moved to -Wfor-loop-analysis, also a subgroup of -Wloop-analysis.

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

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

9 years agoRevert r234613 (and follow-ups 234614, 234616, 234618), it caused PR23216.
Nico Weber [Mon, 13 Apr 2015 20:04:22 +0000 (20:04 +0000)]
Revert r234613 (and follow-ups 234614, 234616, 234618), it caused PR23216.

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

9 years agoRevert r234786, it contained a bunch of stuff I did not mean to commit.
Nico Weber [Mon, 13 Apr 2015 20:03:03 +0000 (20:03 +0000)]
Revert r234786, it contained a bunch of stuff I did not mean to commit.

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

9 years agoRevert r234613 (and follow-ups 234614, 234616, 234618), it caused PR23216.
Nico Weber [Mon, 13 Apr 2015 20:01:20 +0000 (20:01 +0000)]
Revert r234613 (and follow-ups 234614, 234616, 234618), it caused PR23216.

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

9 years ago[CodeGen] Fix crash with duplicated mangled name.
Argyrios Kyrtzidis [Mon, 13 Apr 2015 17:40:46 +0000 (17:40 +0000)]
[CodeGen] Fix crash with duplicated mangled name.

Patch by Yunzhong Gao!

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

9 years ago[libclang] Add functions to get information about fields.
Argyrios Kyrtzidis [Mon, 13 Apr 2015 16:55:04 +0000 (16:55 +0000)]
[libclang] Add functions to get information about fields.

Patch by Loïc Jaquemet!

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

9 years agoclang-format: [JS] Support index signature types.
Daniel Jasper [Mon, 13 Apr 2015 15:03:30 +0000 (15:03 +0000)]
clang-format: [JS] Support index signature types.

Patch by Martin Probst.

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

9 years agoclang-format: [JS] support optionality markers in JS types.
Daniel Jasper [Mon, 13 Apr 2015 15:01:40 +0000 (15:01 +0000)]
clang-format: [JS] support optionality markers in JS types.

Patch by Martin Probst. Thank you.

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

9 years agoclang-format: [JS] Allow periods and commata in class declarations.
Daniel Jasper [Mon, 13 Apr 2015 14:56:54 +0000 (14:56 +0000)]
clang-format: [JS] Allow periods and commata in class declarations.

Patch by Martin Probst. Thank you.

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

9 years agoInstrProf: Simplify getStmtCount by using an Optional
Justin Bogner [Mon, 13 Apr 2015 12:23:19 +0000 (12:23 +0000)]
InstrProf: Simplify getStmtCount by using an Optional

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

9 years agoBring r234620 back now that llvm is fixed.
Rafael Espindola [Mon, 13 Apr 2015 11:14:39 +0000 (11:14 +0000)]
Bring r234620 back now that llvm is fixed.

LLVM can now detect if a fd is seekable on windows.

Original commit message:

Actually check if lseek works instead of using a filename based heuristic.

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

9 years agoReformat.
NAKAMURA Takumi [Mon, 13 Apr 2015 08:43:40 +0000 (08:43 +0000)]
Reformat.

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

9 years agoRevert r234620 and others, "Actually check if lseek works instead of using a filename...
NAKAMURA Takumi [Mon, 13 Apr 2015 08:43:31 +0000 (08:43 +0000)]
Revert r234620 and others, "Actually check if lseek works instead of using a filename based heuristic." It was affected by r234615, which was reverted in r234721.

  r234620, "Actually check if lseek works instead of using a filename based heuristic."
  r234621, "Testcase for the previous commit."
  r234718, "Suppress clang/test/PCH/emit-pth.c on win32, for now while investigating."

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

9 years ago[OPENMP] Initial codegen for 'parallel for' directive.
Alexey Bataev [Mon, 13 Apr 2015 05:28:11 +0000 (05:28 +0000)]
[OPENMP] Initial codegen for 'parallel for' directive.

Allows generation of combined 'parallel for' directive that represents 'parallel' region with internal implicit 'for' worksharing region.
Differential Revision: http://reviews.llvm.org/D8631

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

9 years agoSuppress clang/test/PCH/emit-pth.c on win32, for now while investigating.
NAKAMURA Takumi [Mon, 13 Apr 2015 00:30:23 +0000 (00:30 +0000)]
Suppress clang/test/PCH/emit-pth.c on win32, for now while investigating.

MSVCRT's _lseek(SEEK_CUR) doesn't return -1 for raw_ostream::SupportSeeking.

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

9 years agoclang-cl: Expose -f[no-]diagnostics-color
Hans Wennborg [Sun, 12 Apr 2015 07:12:19 +0000 (07:12 +0000)]
clang-cl: Expose -f[no-]diagnostics-color

If we have -f[no-]color-diagnostics, we might as well have these
too.

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

9 years agoRevert r234581, it might have caused a few miscompiles in Chromium.
Nico Weber [Sat, 11 Apr 2015 23:51:38 +0000 (23:51 +0000)]
Revert r234581, it might have caused a few miscompiles in Chromium.

If the revert helps, I'll get a repro this Monday.  Else I'll put the change
back in.

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

9 years agoDebugInfo: Switch from replaceAllUsesWith() to replaceTemporary()
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 19:05:04 +0000 (19:05 +0000)]
DebugInfo: Switch from replaceAllUsesWith() to replaceTemporary()

Stop using `DIDescriptor`'s wrapper around
`MDNode::replaceAllUsesWith()` (which is going away).  The new home for
this logic is `DIBuilder::replaceTemporary()`, added in LLVM r234695.

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

9 years agoRemove empty non-virtual destructors or mark them =default when non-public
Benjamin Kramer [Sat, 11 Apr 2015 15:58:30 +0000 (15:58 +0000)]
Remove empty non-virtual destructors or mark them =default when non-public

These add no value but can make a class non-trivially copyable. NFC.

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

9 years agoclang/test/CodeGenCXX/static-data-member-single-emission.cpp: Tweak for MS mangler.
NAKAMURA Takumi [Sat, 11 Apr 2015 14:57:11 +0000 (14:57 +0000)]
clang/test/CodeGenCXX/static-data-member-single-emission.cpp: Tweak for MS mangler.

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

9 years agoclang-cl: support -fno-color-diagnostics (PR23109)
Hans Wennborg [Sat, 11 Apr 2015 12:27:56 +0000 (12:27 +0000)]
clang-cl: support -fno-color-diagnostics (PR23109)

Patch by Bernard Solomon, tests by me.

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

9 years agoclang-cl: support -fmacro-backtrace-limit
Hans Wennborg [Sat, 11 Apr 2015 11:44:44 +0000 (11:44 +0000)]
clang-cl: support -fmacro-backtrace-limit

Also fix the test for "core options" to actually fail
in case an option isn't supported.

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

9 years agoAdd Clang support for -mdirect-move on PPC
Nemanja Ivanovic [Sat, 11 Apr 2015 10:43:36 +0000 (10:43 +0000)]
Add Clang support for -mdirect-move on PPC

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

This just adds a front end option to let the back end know the target has PPC
direct move instructions.

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

9 years agoUse 'override/final' instead of 'virtual' for overridden methods
Alexander Kornienko [Sat, 11 Apr 2015 02:00:23 +0000 (02:00 +0000)]
Use 'override/final' instead of 'virtual' for overridden methods

Summary:
The patch is generated using clang-tidy misc-use-override check.

This command was used:

  tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
    -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: klimek, cfe-commits

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

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

9 years agoImprove the error message for assigning to read-only variables.
Richard Trieu [Sat, 11 Apr 2015 01:53:13 +0000 (01:53 +0000)]
Improve the error message for assigning to read-only variables.

Previously, many error messages would simply be "read-only variable is not
assignable"  This change provides more information about why the variable is
not assignable, as well as note to where the const is located.

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

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

9 years agoOnly notify consumers about static data members of class templates once
Reid Kleckner [Sat, 11 Apr 2015 01:25:36 +0000 (01:25 +0000)]
Only notify consumers about static data members of class templates once

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

9 years ago[Driver] Properly support -mglobal-merge using explicit options.
Ahmed Bougacha [Sat, 11 Apr 2015 00:10:44 +0000 (00:10 +0000)]
[Driver] Properly support -mglobal-merge using explicit options.

Follow-up to r234666.  With this, the -m[no-]global-merge options
have the expected behavior. Previously, -mglobal-merge was ignored,
and there was no way of enabling the optimization.

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

9 years agoNaCl ARM: fix assembler float abi flags
Derek Schuff [Fri, 10 Apr 2015 23:07:19 +0000 (23:07 +0000)]
NaCl ARM: fix assembler float abi flags

Summary:
tools::arm::getARMFloatABI() was falling back to guessing soft-float because
it wasn't seeing the GNUEABIHF environment from ComputeEffectivClangTriple
when it was called from gnutools::Assemble::ConstructJob.

Fix by using the effective clang triple in gnutools::Assemble, which now
matches the -triple flag used by cc1 and ClangAs jobs.

Reviewers: jvoung

Subscribers: rengolin, jfb, aemerson, cfe-commits

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

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

9 years agoWorkaround a performance issue with modules + PCH
Ben Langmuir [Fri, 10 Apr 2015 22:25:42 +0000 (22:25 +0000)]
Workaround a performance issue with modules + PCH

More fallout from r228234; when looking up an identifier in a PCH that
imports the Cocoa module on Darwin, it was taking 2 to 5 seconds
because we were hammering the MapVector::erase() function, which is
O(n).  For now, just clear() the contained SmallVector to get back to
0.25 - 0.5 seconds.  This is probably not the long-term fix, because
without modules or without PCH the performance is more like 0.02
seconds.

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

9 years ago[Objective-C Sema] Fixes a typo which did not allow
Fariborz Jahanian [Fri, 10 Apr 2015 22:07:47 +0000 (22:07 +0000)]
[Objective-C Sema] Fixes a typo which did not allow
bridge casting to super class of object's bridge type.
rdar://18311183

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

9 years ago[tblgen] Use StringRef::trim
Benjamin Kramer [Fri, 10 Apr 2015 21:37:21 +0000 (21:37 +0000)]
[tblgen] Use StringRef::trim

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

9 years agoCreate the correct profiling symbol on NetBSD.
Joerg Sonnenberger [Fri, 10 Apr 2015 21:02:53 +0000 (21:02 +0000)]
Create the correct profiling symbol on NetBSD.

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

9 years agoCreate correct platform-specific target for NetBSD PPC64LE.
Joerg Sonnenberger [Fri, 10 Apr 2015 20:53:48 +0000 (20:53 +0000)]
Create correct platform-specific target for NetBSD PPC64LE.

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

9 years agoDon't eagerly typo-correct to a keyword if the next token is a right paren.
Kaelyn Takata [Fri, 10 Apr 2015 19:16:46 +0000 (19:16 +0000)]
Don't eagerly typo-correct to a keyword if the next token is a right paren.

Take advantage of the delayed typo no longer being eagerly corrected to
a keyword to filter out keyword corrections (and other things like
unresolved & overloaded expressions, which have placeholder types) when
correcting typos inside of a decltype().

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

9 years agoTestcase for the previous commit.
Rafael Espindola [Fri, 10 Apr 2015 18:18:17 +0000 (18:18 +0000)]
Testcase for the previous commit.

Sorry, fogot to "git add" the previous time.

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

9 years agoActually check if lseek works instead of using a filename based heuristic.
Rafael Espindola [Fri, 10 Apr 2015 18:16:30 +0000 (18:16 +0000)]
Actually check if lseek works instead of using a filename based heuristic.

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

9 years ago[SEH] Add test for inline functions using SEH helpers
Reid Kleckner [Fri, 10 Apr 2015 18:07:38 +0000 (18:07 +0000)]
[SEH] Add test for inline functions using SEH helpers

Such helpers should always be comdat with the parent function and have
internal linkage.

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

9 years agoReally fix exceptions-seh-finally.c
Reid Kleckner [Fri, 10 Apr 2015 17:53:39 +0000 (17:53 +0000)]
Really fix exceptions-seh-finally.c

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

9 years agoTry to fix exceptions-seh-finally.c
Reid Kleckner [Fri, 10 Apr 2015 17:45:23 +0000 (17:45 +0000)]
Try to fix exceptions-seh-finally.c

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

9 years ago[SEH] Re-land r234532, but use internal linkage for all SEH helpers
Reid Kleckner [Fri, 10 Apr 2015 17:34:52 +0000 (17:34 +0000)]
[SEH] Re-land r234532, but use internal linkage for all SEH helpers

Even though these symbols are in a comdat group, the Microsoft linker
really wants them to have internal linkage.

I'm planning to tweak the mangling in a follow-up change. This is a
straight revert with a 1-line fix.

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

9 years ago[Frontend] Close open file handles before renaming output files
Reid Kleckner [Fri, 10 Apr 2015 17:27:58 +0000 (17:27 +0000)]
[Frontend] Close open file handles before renaming output files

The placement of the 'delete' call that was removed in the unique_ptr
migration in r234597 was not an accident. The raw_ostream has to be
destroyed before you do the rename on Windows, otherwise you get
ERROR_ACCESS_DENIED. We can still use unique_ptr, we just need to do a
manual reset().

Also, range-for-loop-ify this code.

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

9 years agoDon't rely on implicit CallSite construction.
Benjamin Kramer [Fri, 10 Apr 2015 14:49:31 +0000 (14:49 +0000)]
Don't rely on implicit CallSite construction.

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

9 years agoTry to make MSVC happy.
Rafael Espindola [Fri, 10 Apr 2015 14:37:39 +0000 (14:37 +0000)]
Try to make MSVC happy.

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

9 years agoReturn std::unique_ptr to avoid a release and recreate.
Rafael Espindola [Fri, 10 Apr 2015 14:30:43 +0000 (14:30 +0000)]
Return std::unique_ptr to avoid a release and recreate.

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

9 years agoUse a std::unique_ptr to make it easier to see who owns the stream.
Rafael Espindola [Fri, 10 Apr 2015 14:11:52 +0000 (14:11 +0000)]
Use a std::unique_ptr to make it easier to see who owns the stream.

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

9 years agoReturn a pointer instead of having a pointer outparam and a bool return.
Rafael Espindola [Fri, 10 Apr 2015 13:14:31 +0000 (13:14 +0000)]
Return a pointer instead of having a pointer outparam and a bool return.

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

9 years agoInitializing an uninitialized data member; should be NFC.
Aaron Ballman [Fri, 10 Apr 2015 13:05:04 +0000 (13:05 +0000)]
Initializing an uninitialized data member; should be NFC.

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

9 years agoReturn a pointer instead of having a pointer outparam and a bool return.
Rafael Espindola [Fri, 10 Apr 2015 12:54:53 +0000 (12:54 +0000)]
Return a pointer instead of having a pointer outparam and a bool return.

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

9 years agoReduce dyn_cast<> to isa<> or cast<> where possible. Clang edition.
Benjamin Kramer [Fri, 10 Apr 2015 11:37:55 +0000 (11:37 +0000)]
Reduce dyn_cast<> to isa<> or cast<> where possible. Clang edition.

No functional change intended.

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

9 years ago[OPENMP] Codegen for 'reduction' clause in 'parallel' directive.
Alexey Bataev [Fri, 10 Apr 2015 10:43:45 +0000 (10:43 +0000)]
[OPENMP] Codegen for 'reduction' clause in 'parallel' directive.

Emit a code for reduction clause. Next code should be emitted for reductions:

static kmp_critical_name lock = { 0 };

void reduce_func(void *lhs[<n>], void *rhs[<n>]) {
  ...
  *(Type<i> *)lhs[i] = RedOp<i>(*(Type<i> *)lhs[i], *(Type<i> *)rhs[i]);
  ...
}

... void *RedList[<n>] = {&<RHSExprs>[0], ..., &<RHSExprs>[<n> - 1]};
switch (__kmpc_reduce{_nowait}(<loc>, <gtid>, <n>, sizeof(RedList), RedList, reduce_func, &<lock>)) {
case 1:
  ...
  <LHSExprs>[i] = RedOp<i>(*<LHSExprs>[i], *<RHSExprs>[i]);
  ...
  __kmpc_end_reduce{_nowait}(<loc>, <gtid>, &<lock>);
  break;
case 2:
  ...
  Atomic(<LHSExprs>[i] = RedOp<i>(*<LHSExprs>[i], *<RHSExprs>[i]));
  ...
  break;
default:
  ;
}
Reduction variables are a kind of a private variables, they have private copies, but initial values are chosen in accordance with the reduction operation.

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

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

9 years agoRemove threshold for inserting lifetime markers for named temporaries
Arnaud A. de Grandmaison [Fri, 10 Apr 2015 10:13:52 +0000 (10:13 +0000)]
Remove threshold for inserting lifetime markers for named temporaries

Now that TailRecursionElimination has been fixed with r222354, the
threshold on size for lifetime marker insertion can be removed. This
only affects named temporary though, as the patch for unnamed temporaries
is still in progress.

My previous commit (r222993) was not handling debuginfo correctly, but
this could only be seen with some asan tests. Basically, lifetime markers
are just instrumentation for the compiler's usage and should not affect
debug information; however, the cleanup infrastructure was assuming it
contained only destructors, i.e. actual code to be executed, and was
setting the breakpoint for the end of the function to the closing '}', and
not the return statement, in order to show some destructors have been
called when leaving the function. This is wrong when the cleanups are only
lifetime markers, and this is now fixed.

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

9 years agoReverting test commit.
Szabolcs Sipos [Fri, 10 Apr 2015 08:43:58 +0000 (08:43 +0000)]
Reverting test commit.

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

9 years agoTest commit.
Szabolcs Sipos [Fri, 10 Apr 2015 08:42:08 +0000 (08:42 +0000)]
Test commit.

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

9 years ago[OPENMP] Fixed cleanup of OpenMP code.
Alexey Bataev [Fri, 10 Apr 2015 07:48:12 +0000 (07:48 +0000)]
[OPENMP] Fixed cleanup of OpenMP code.

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