Commit Graph

57757 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith 4078ad4122 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.

llvm-svn: 235112
2015-04-16 16:36:45 +00:00
Vladimir Sukharev e851e04262 [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

llvm-svn: 235110
2015-04-16 15:53:09 +00:00
Alexey Bataev 6ddfe1a6af [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.

llvm-svn: 235096
2015-04-16 13:49:42 +00:00
Daniel Jasper 23341446e8 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).

llvm-svn: 235080
2015-04-16 08:26:37 +00:00
Daniel Jasper 0d6ac27b86 clang-format: [JS] handle comments in template strings.
Patch by Martin Probst. Thank you.

llvm-svn: 235078
2015-04-16 08:20:51 +00:00
Daniel Jasper 20e15563ff 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.

llvm-svn: 235076
2015-04-16 07:02:19 +00:00
Alexey Bataev f56f98c925 [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

llvm-svn: 235075
2015-04-16 05:39:01 +00:00
Alexey Bataev 38e8953352 [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

llvm-svn: 235074
2015-04-16 04:54:05 +00:00
Duncan P. N. Exon Smith 526ab07e3c 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.

llvm-svn: 235068
2015-04-16 01:53:23 +00:00
Duncan P. N. Exon Smith 373ee85966 DebugInfo: Prepare for DIScope to be gutted in LLVM
An upcoming LLVM commit will gut `DIScope`, so just use `MDScope*`
directly.

llvm-svn: 235066
2015-04-16 01:36:36 +00:00
Duncan P. N. Exon Smith 4caa7f2a9c 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.

llvm-svn: 235063
2015-04-16 01:00:56 +00:00
Duncan P. N. Exon Smith b747023081 DebugInfo: Prepare for LLVM change removing DIType::isValid()
This is being replaced with a null check.

llvm-svn: 235058
2015-04-15 23:48:50 +00:00
Dmitri Gribenko 8b7206250f Comment parsing: fix an assertion failure on a verbatim block terminated with "**/"
llvm-svn: 235057
2015-04-15 23:45:43 +00:00
Duncan P. N. Exon Smith 798d565fd8 DebugInfo: Prepare for LLVM gutting DICompileUnit/DIFile
An upcoming LLVM commit will gut `DICompileUnit` and `DIFile`, so start
treating them more like pointers.

llvm-svn: 235054
2015-04-15 23:19:15 +00:00
Nico Weber 608e768d8d 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

llvm-svn: 235053
2015-04-15 23:04:24 +00:00
DeLesley Hutchins 773ba37529 Fix for PR20402 in -Wconsumed.
https://llvm.org/bugs/show_bug.cgi?id=20402
Patch by Chris Wailes.

llvm-svn: 235051
2015-04-15 22:32:44 +00:00
Eli Bendersky 4bdc50eccb 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

llvm-svn: 235049
2015-04-15 22:27:06 +00:00
Nico Weber 7f5015a9cc clang-format a line containing nothing but a "{". No behavior change.
llvm-svn: 235047
2015-04-15 21:53:00 +00:00
Nico Weber ea7386d40c Make __declspec(selectany) turn variable declartions into definitions.
Fixes PR23242.

llvm-svn: 235046
2015-04-15 21:50:06 +00:00
Duncan P. N. Exon Smith fe88b48632 DebugInfo: Pass DebugLocs when creating intrinsics
Update for LLVM API change r235041 that makes `DIBuilder` require a
`DebugLoc` to create a debug info intrinsic.

llvm-svn: 235042
2015-04-15 21:18:30 +00:00
Jonathan Roelofs c7749fca07 Fix docs typo in FunctionTemplateSpecializationInfo
llvm-svn: 235039
2015-04-15 20:47:22 +00:00
Fariborz Jahanian 890803f5f4 [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

llvm-svn: 235023
2015-04-15 17:26:21 +00:00
Hans Wennborg 5615f6bcd5 clang-cl: support -fsyntax-only (PR23197)
This might help running Clang tooling (which appends this option)
with clang-cl command-lines.

llvm-svn: 234990
2015-04-15 10:02:21 +00:00
Alexey Bataev bcb4a8fe1b Changed test to not brake ARM buildbots, NFC.
llvm-svn: 234988
2015-04-15 09:52:50 +00:00
Renato Golin c640ff63e2 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.

llvm-svn: 234983
2015-04-15 08:44:40 +00:00
Daniel Jasper 2b1865c251 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.

llvm-svn: 234980
2015-04-15 07:26:18 +00:00
Alexey Bataev 69c62a9bdb [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

llvm-svn: 234978
2015-04-15 04:52:20 +00:00
Richard Trieu 20abd6bc04 Use concrete type instead of auto in for-loop. No functionality change.
llvm-svn: 234976
2015-04-15 03:48:48 +00:00
Duncan P. N. Exon Smith fda02091e6 uselistorder: Remove dead include
Forgot to remove the include in r234970

llvm-svn: 234972
2015-04-15 03:04:45 +00:00
Duncan P. N. Exon Smith bb9cadf4eb 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).

llvm-svn: 234970
2015-04-15 02:45:28 +00:00
Richard Trieu b58413323d Change range-based for-loops to be -Wrange-loop-analysis clean.
No functionality change.

llvm-svn: 234964
2015-04-15 01:21:42 +00:00
Duncan P. N. Exon Smith bb61825cd5 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`).

llvm-svn: 234962
2015-04-15 01:16:18 +00:00
Reid Kleckner e07140eb3f 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.

llvm-svn: 234961
2015-04-15 01:08:06 +00:00
Duncan P. N. Exon Smith 58927f1aa2 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.

llvm-svn: 234960
2015-04-15 00:36:14 +00:00
Reid Kleckner ebaf28d13d 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.

llvm-svn: 234942
2015-04-14 20:59:00 +00:00
Duncan P. N. Exon Smith d863f6f250 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.

llvm-svn: 234920
2015-04-14 18:30:13 +00:00
Fariborz Jahanian dcf06f4232 [SemaCXX patch] Patch to fix a crash when a 'delete' constructor
is being accessed. Reviewed by Richard Smith.
rdar://20281011

llvm-svn: 234912
2015-04-14 17:21:58 +00:00
Rafael Espindola 2f16bc1095 Use raw_pwrite_stream in clang.
This is a small improvement to -emit-pth and allows llvm to start requiring it.

llvm-svn: 234897
2015-04-14 15:15:49 +00:00
Tom Stellard 7b1059bb2d R600: Add GCC reg names
llvm-svn: 234892
2015-04-14 14:36:56 +00:00
Anton Yartsev b50f4ba461 [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. 
llvm-svn: 234889
2015-04-14 14:18:04 +00:00
Petar Jovanovic 1dbc317736 [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

llvm-svn: 234882
2015-04-14 12:49:08 +00:00
Nikola Smiljanic 879d1be643 Remove useless statement.
llvm-svn: 234881
2015-04-14 12:33:33 +00:00
Alexey Bataev 420d45b2dd [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

llvm-svn: 234856
2015-04-14 05:11:24 +00:00
Alexey Bataev 68adb7da1a [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

llvm-svn: 234849
2015-04-14 03:29:22 +00:00
Duncan P. N. Exon Smith 87afdeb8f5 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->()`.

llvm-svn: 234848
2015-04-14 03:24:14 +00:00
Richard Trieu 3e1d483e0e 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

llvm-svn: 234804
2015-04-13 22:08:55 +00:00
Nico Weber ad108337cf Revert r234613 (and follow-ups 234614, 234616, 234618), it caused PR23216.
llvm-svn: 234789
2015-04-13 20:04:22 +00:00
Nico Weber f2a39a7b4e Revert r234786, it contained a bunch of stuff I did not mean to commit.
llvm-svn: 234787
2015-04-13 20:03:03 +00:00
Nico Weber b31abb05fb Revert r234613 (and follow-ups 234614, 234616, 234618), it caused PR23216.
llvm-svn: 234786
2015-04-13 20:01:20 +00:00
Argyrios Kyrtzidis 6f1fadf989 [CodeGen] Fix crash with duplicated mangled name.
Patch by Yunzhong Gao!

llvm-svn: 234767
2015-04-13 17:40:46 +00:00