Commit Graph

198753 Commits

Author SHA1 Message Date
Andrey Churbanov 1021040de3 updated copyright date to 2015
llvm-svn: 235086
2015-04-16 11:10:17 +00:00
Yaron Keren 9a78aa0d2c Update MCELFStreamer::reset() following r234714
and order fields according to declaration order.

llvm-svn: 235085
2015-04-16 10:53:22 +00:00
Toma Tabacu 9ca5096f59 [mips] [IAS] Add support for the .insn directive.
Summary:
This assembler directive marks the current label as an instruction label in microMIPS and MIPS16.

This initial implementation works only for microMIPS.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 235084
2015-04-16 09:53:47 +00:00
Robert Flack 3a6a2e58d5 Append to CFLAGS_EXTRAS and LD_EXTRAS when building cmdline.
When building the command-line for compilations during tests, append to
CFLAGS_EXTRAS and LD_EXTRAS to preserve switches set by the environment
(i.e. for cross compiling to test on another platform).

Test Plan:
TestCPP11EnumTypes.py passes testing from macosx -> linux remotely with cross
compiling args in CFLAGS_EXTRAS and LD_EXTRAS.

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

llvm-svn: 235083
2015-04-16 09:18:12 +00:00
Pavel Labath 3b8f3ad7bb Revert "[RuntimeDyldELF] Fold Placeholder into Addend"
This reverts commit cbbeac14f0ddca71f6d8ff91cd05522bd23908e5.

llvm-svn: 235082
2015-04-16 08:58:15 +00:00
Pavel Labath 041b5a571b Revert "[RuntimeDyldELF] Fix missing cases in Placeholder processing"
This reverts commit ec0a34f850eca0d97e0592236e0ac14083aa1c3d.

llvm-svn: 235081
2015-04-16 08:58:11 +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
Simon Pilgrim 6bd5d3caa9 TRUNCATE constant folding - minor fix for rL233224
Fix for test case found by James Molloy - TRUNCATE of constant build vectors can be more simply achieved by simply replacing with a new build vector node with the truncated value type - no need to touch the scalar operands at all.

llvm-svn: 235079
2015-04-16 08:21:09 +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
Oleksiy Vyalov 7d9d941b9b Pass normalized target file paths via GDB-remote to a target and denormalize them on the target.
http://reviews.llvm.org/D8980

llvm-svn: 235077
2015-04-16 07:02:56 +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
Daniel Berlin 4421ac6bf8 Replace loop doing postorder walk with postorder iterator
Summary: LoopInfoImpl's loop population is just a normal postorder walk, written out.

Reviewers: chandlerc

Subscribers: llvm-commits

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

llvm-svn: 235073
2015-04-16 04:28:32 +00:00
Ahmed Bougacha c984b90c86 [CodeGen] Re-apply r234809 (concat of scalars), with an x86_mmx fix.
The only type that isn't an integer, isn't floating point, and isn't
a vector; ladies and gentlemen, the gift that keeps on giving: x86_mmx!

Fixes PR23246.

Original message (reverted in r235062):
[CodeGen] Combine concat_vectors of scalars into build_vector.

Combine something like:
  (v8i8 concat_vectors (v2i8 bitcast (i16)) x4)
into:
  (v8i8 (bitcast (v4i16 BUILD_VECTOR (i16) x4)))

If any of the scalars are floating point, use that throughout.

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

llvm-svn: 235072
2015-04-16 02:39:14 +00:00
Duncan P. N. Exon Smith b0b0e4958b DebugInfo: DIRef<> => TypedDebugNodeRef<>
Delete `DIRef<>`, and replace the remaining uses of it with
`TypedDebugNodeRef<>`.  To minimize code churn, I've added typedefs from
`MDTypeRef` to `DITypeRef` (etc.).

llvm-svn: 235071
2015-04-16 02:24:01 +00:00
Keno Fischer 8ef1bd2437 [RuntimeDyldELF] Fix missing cases in Placeholder processing
Try to appease the build bots. We should write rtdyld test cases for these
to make them testible on other platforms.

llvm-svn: 235070
2015-04-16 02:00:38 +00:00
Duncan P. N. Exon Smith f15c6f8032 DebugInfo: Gut DIDescriptor
PR23080 is almost finished.  With this commit, there's no consequential
API in `DIDescriptor` and its subclasses.  What's left?

  - Default-constructed to `nullptr`.
  - Handy `const_cast<>` (constructed from `const`, but accessors are
    non-`const`).

I think the safe way to catch those is to delete the classes and fix
compile errors.  That'll be my next step, after I delete the `DITypeRef`
(etc.) wrapper around `MDTypeRef`.

llvm-svn: 235069
2015-04-16 01:53:33 +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 b273d06b63 DebugInfo: Gut DIScope, DIEnumerator and DISubrange
The only class the still has API left is `DIDescriptor` itself.

llvm-svn: 235067
2015-04-16 01:37:00 +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
Greg Clayton 2c93b80f78 Make -arch work on MacOSX.
llvm-svn: 235065
2015-04-16 01:18:05 +00:00
Duncan P. N. Exon Smith b105564015 DebugInfo: Gut DIType and subclasses
Continuing PR23080, gut `DIType` and its various subclasses, leaving
behind thin wrappers around the pointer types in the new debug info
hierarchy.

llvm-svn: 235064
2015-04-16 01:01:28 +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
Nick Lewycky b8557a972f Revert r234809 because it caused PR23246.
llvm-svn: 235062
2015-04-16 00:56:20 +00:00
Reid Kleckner 8676214025 [SEH] Deal with users of the old lpad for SEH catch-all blocks
The way we split SEH catch-all blocks can leave some dead EH values
behind at -O0. Try to remove them, and if we fail, replace them all with
undef.

Fixes a crash when removing the old unreachable landingpad which is
still used by extractvalue instructions in the catch-all block.

llvm-svn: 235061
2015-04-16 00:02:04 +00:00
Keno Fischer ae9bac3366 [RuntimeDyldELF] Fold Placeholder into Addend
Summary:

This allows us to get rid of the original unrelocated object file after
we're done processing relocations (but before applying them).
MachO and COFF already do not require this (currently we have temporary hacks
to prevent ownership from being released, but those are brittle and should be
removed soon).

The placeholder mechanism allowed the relocation resolver to look at original
object file to obtain more information that are required to apply the
relocations. This is usually necessary in two cases:

- For relocations targetting sub-word memory locations, there may be pieces
  of the instruction at the target address which we should not override.
- Some relocations on some platforms allow an extra addend to be encoded in
  their immediate fields.

The problem is that in the second case the information cannot be recovered
after the relocations have been applied once because they will have been
overridden. In the first case we also need to be careful to not use any bits
that aren't fixed and may have been overriden by applying a first relocation.

In the past both have been fixed by just looking at original object file. This
patch attempts to recover the information from the first by looking at the
relocated object file, while the extra addend in the second case is read
upon relocation processing and addend to the regular addend.

I have tested this on X86. Other platforms represent my best understanding
of how those relocations should work, but I may have missed something because
I do not have access to those platforms.
We will keep the ugly workarounds in place for a couple of days, so this commit
can be reverted if it breaks the bots.

Reviewers: petarj, t.p.northover, lhames

Reviewed By: lhames

Subscribers: aemerson, llvm-commits

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

llvm-svn: 235060
2015-04-15 23:49:29 +00:00
Duncan P. N. Exon Smith 1d1a8e00b8 DebugInfo: Remove unnecessary API from DIDerivedType and DIType
Remove the accessors of `DIDerivedType` that downcast to
`MDDerivedType`, shifting the `cast<MDDerivedType>` into the callers.
Also remove `DIType::isValid()`, which is really just a check against
`nullptr` at this point.

llvm-svn: 235059
2015-04-15 23:49:09 +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
Adrian McCarthy b4b8bb72cb Fix OS default in Makefile.rules for Windows. http://reviews.llvm.org/D9043
llvm-svn: 235056
2015-04-15 23:38:23 +00:00
Duncan P. N. Exon Smith 35ef22cf53 DebugInfo: Gut DICompileUnit and DIFile
Continuing gutting `DIDescriptor` subclasses; this edition,
`DICompileUnit` and `DIFile`.  In the name of PR23080.

llvm-svn: 235055
2015-04-15 23:19:27 +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
Duncan P. N. Exon Smith 768d96ca6f DebugInfo: factor out dead variable in NDEBUG from r235050
Caught by the lld bot:

http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/9832

llvm-svn: 235052
2015-04-15 22:42:43 +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
Duncan P. N. Exon Smith 62e0f454a0 DebugInfo: Remove 'inlinedAt:' field from MDLocalVariable
Remove 'inlinedAt:' from MDLocalVariable.  Besides saving some memory
(variables with it seem to be single largest `Metadata` contributer to
memory usage right now in -g -flto builds), this stops optimization and
backend passes from having to change local variables.

The 'inlinedAt:' field was used by the backend in two ways:

 1. To tell the backend whether and into what a variable was inlined.
 2. To create a unique id for each inlined variable.

Instead, rely on the 'inlinedAt:' field of the intrinsic's `!dbg`
attachment, and change the DWARF backend to use a typedef called
`InlinedVariable` which is `std::pair<MDLocalVariable*, MDLocation*>`.
This `DebugLoc` is already passed reliably through the backend (as
verified by r234021).

This commit removes the check from r234021, but I added a new check
(that will survive) in r235048, and changed the `DIBuilder` API in
r235041 to require a `!dbg` attachment whose 'scope:` is in the same
`MDSubprogram` as the variable's.

If this breaks your out-of-tree testcases, perhaps the script I used
(mdlocalvariable-drop-inlinedat.sh) will help; I'll attach it to PR22778
in a moment.

llvm-svn: 235050
2015-04-15 22:29:27 +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
Duncan P. N. Exon Smith f17f34e42b Verifier: Check that @llvm.dbg.* intrinsics have a !dbg attachment
Before we start to rely on valid `!dbg` attachments, add a check to the
verifier that `@llvm.dbg.*` intrinsics always have one.  Also check that
the `scope:` fields point at the same `MDSubprogram`.

This is in the context of PR22778.  The check that the `inlinedAt:`
fields agree has baked for a while (since r234021), so I'll kill [1] the
`MDLocalVariable::getInlinedAt()` field soon.

[1]: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150330/269387.html

Unfortunately, that means it's impossible to keep the current `Verifier`
checks, which rely on comparing `inlinedAt:` fields.  We'll be able to
keep the checks I'm adding here.

If this breaks your out-of-tree testcases, the upgrade script
(add-dbg-to-intrinsics.sh) attached to PR22778 that I used for r235040
might fix them for you.

llvm-svn: 235048
2015-04-15 22:15:46 +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
Richard Trieu a2ee3013e6 One more -Wrange-loop-analysis cleanup.
llvm-svn: 235044
2015-04-15 21:40:50 +00:00
Lang Hames c3246ad45c [RuntimeDyld] Work around a bug in RuntimeDyldELF exposed by r234839.
Hopefully this will fix the failures on the windows builders that started with
r234839.

llvm-svn: 235043
2015-04-15 21:18:41 +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
Duncan P. N. Exon Smith cd1aecfe36 DebugInfo: Require a DebugLoc in DIBuilder::insertDeclare()
Change `DIBuilder::insertDeclare()` and `insertDbgValueIntrinsic()` to
take an `MDLocation*`/`DebugLoc` parameter which it attaches to the
created intrinsic.  Assert at creation time that the `scope:` field's
subprogram matches the variable's.  There's a matching `clang` commit to
use the API.

The context for this is PR22778, which is removing the `inlinedAt:`
field from `MDLocalVariable`, instead deferring to the `!dbg` location
attached to the debug info intrinsic.  The best way to ensure we always
have a `!dbg` attachment is to require one at creation time.  I'll be
adding verifier checks next, but this API change is the best way to
shake out frontend bugs.

Note: I added an `llvm_unreachable()` in `bindings/go` and passed in
`nullptr` for the `DebugLoc`.  The `llgo` folks will eventually need to
pass a valid `DebugLoc` here.

llvm-svn: 235041
2015-04-15 21:18:07 +00:00
Duncan P. N. Exon Smith 48b3503c16 DebugInfo: Add missing !dbg attachments to intrinsics
Add missing `!dbg` attachments to `@llvm.dbg.*` intrinsics.  I updated
these using a script (add-dbg-to-intrinsics.sh) that I'll attach to
PR22778 for posterity.

llvm-svn: 235040
2015-04-15 21:04:10 +00:00
Jonathan Roelofs c7749fca07 Fix docs typo in FunctionTemplateSpecializationInfo
llvm-svn: 235039
2015-04-15 20:47:22 +00:00
Daniel Berlin a7a8f57b06 Update for post-commit review comments
llvm-svn: 235038
2015-04-15 19:36:10 +00:00
Reid Kleckner 3e9fadfbc8 [WinEH] Try to make the MachineFunction CFG more accurate
This avoids emitting code for unreachable landingpad blocks that contain
calls to llvm.eh.actions and indirectbr.

It's also a first step towards unifying the SEH and WinEH lowering
codepaths. I'm keeping the old fan-in lowering of SEH around until the
preparation version works well enough that we can switch over without
breaking existing users.

llvm-svn: 235037
2015-04-15 18:48:15 +00:00
Siva Chandra 9e7a8172a3 [TestRvalueReferences] Fix an expectation.
Summary:
If 'i' is an rvalue reference to an 'int', evaluating it with the
'expression' command will return an 'int' value and not an 'int &&'.
Before this patch, an 'int &&' type was expected.

Enabled the test for clang and gcc as all parts of the test now pass
when the testcase is compiled with them.

Test Plan: dotest.py -C <gcc|clang> -p TestRvalueReferences

Reviewers: spyffe, chaoren

Subscribers: lldb-commits

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

llvm-svn: 235036
2015-04-15 18:35:29 +00:00