platform/upstream/llvm.git
9 years ago[TestDataFormatterUnordered] Use patterns to match unordered_<multi>set elements
Siva Chandra [Thu, 28 May 2015 01:18:11 +0000 (01:18 +0000)]
[TestDataFormatterUnordered] Use patterns to match unordered_<multi>set elements

Summary: This fixes the test for i386 targets.

Test Plan: dotest.py -C clang --arch i386 TestDataFormatterUnordered

Reviewers: chying, chaoren, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 238385

9 years agoFix unused variable warnings.
Michael J. Spencer [Thu, 28 May 2015 00:29:56 +0000 (00:29 +0000)]
Fix unused variable warnings.

llvm-svn: 238384

9 years agoAdd PHDR and FILL parsing.
Michael J. Spencer [Thu, 28 May 2015 00:14:58 +0000 (00:14 +0000)]
Add PHDR and FILL parsing.

llvm-svn: 238383

9 years agoUpdate -Winvalid-noreturn to handle destructors better.
Richard Trieu [Thu, 28 May 2015 00:14:02 +0000 (00:14 +0000)]
Update -Winvalid-noreturn to handle destructors better.

When checking if a function is noreturn, consider a codepath to be noreturn if
the path destroys a class and the class destructor, base class destructors, or
member field destructors are marked noreturn.

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

llvm-svn: 238382

9 years agoFix comment about balanced affinity
Jonathan Peyton [Wed, 27 May 2015 23:27:33 +0000 (23:27 +0000)]
Fix comment about balanced affinity

A while back, Hal mentioned fixing a comment concerning balanced affinity.
http://lists.cs.uiuc.edu/pipermail/openmp-dev/2014-December/000358.html
I forgot about fixing it until now, but now is better than never.

llvm-svn: 238378

9 years agoAsmPrinter: Avoid a warning in NDEBUG, NFC
Duncan P. N. Exon Smith [Wed, 27 May 2015 23:02:36 +0000 (23:02 +0000)]
AsmPrinter: Avoid a warning in NDEBUG, NFC

Should fix the -Werror release build:
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/11113

llvm-svn: 238375

9 years agoAsmPrinter: Return added DIE from DIE::addChild()
Duncan P. N. Exon Smith [Wed, 27 May 2015 22:59:03 +0000 (22:59 +0000)]
AsmPrinter: Return added DIE from DIE::addChild()

Change `DIE::addChild()` to return a reference to the just-added node,
and update consumers to use it directly.  An upcoming commit will
abstract away (and eventually change) the underlying storage of
`DIE::Children`.

llvm-svn: 238372

9 years agoRegisterPressure: fix debug prints in case of physical registers
Fiona Glaser [Wed, 27 May 2015 22:51:47 +0000 (22:51 +0000)]
RegisterPressure: fix debug prints in case of physical registers

llvm-svn: 238371

9 years agoFix PR#23647 - make_shared<volatile bool> - second try
Marshall Clow [Wed, 27 May 2015 22:44:47 +0000 (22:44 +0000)]
Fix PR#23647 - make_shared<volatile bool> - second try

llvm-svn: 238370

9 years agoAsmPrinter: Stop exposing underlying DIEValue list, NFC
Duncan P. N. Exon Smith [Wed, 27 May 2015 22:44:06 +0000 (22:44 +0000)]
AsmPrinter: Stop exposing underlying DIEValue list, NFC

Change the `DIE` API to hide the implementation of the list of
`DIEValue`s.

llvm-svn: 238369

9 years ago[TestNamespace] Fix an accidentally committed local change.
Siva Chandra [Wed, 27 May 2015 22:39:21 +0000 (22:39 +0000)]
[TestNamespace] Fix an accidentally committed local change.

Test Plan: dotest.py -p TestNamespace

Reviewers: sivachandra

Subscribers: lldb-commits

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

llvm-svn: 238368

9 years ago[asan] Fix build dependency issues with ASan version list file.
Evgeniy Stepanov [Wed, 27 May 2015 22:38:01 +0000 (22:38 +0000)]
[asan] Fix build dependency issues with ASan version list file.

CMake pre-3.1 has a bug where a shared library depending on a custom_target
does not really depend on it.

This commit implements a hilariously ugly workaround for this problem, see
code comments for more details.

llvm-svn: 238367

9 years agoAsmPrinter: Remove DIEHash::AttrEntry, NFC
Duncan P. N. Exon Smith [Wed, 27 May 2015 22:36:37 +0000 (22:36 +0000)]
AsmPrinter: Remove DIEHash::AttrEntry, NFC

Remove "the most boring struct ever" (thanks to review by Eric).

llvm-svn: 238366

9 years agoAllow expresions to have unique expression prefixes:
Greg Clayton [Wed, 27 May 2015 22:32:39 +0000 (22:32 +0000)]
Allow expresions to have unique expression prefixes:

expr_options = lldb.SBExpressionOptions()
expr_options.SetPrefix('''
struct Foo {
   int a;
   int b;
   int c;
}
'''
expr_result = frame.EvaluateExpression ("Foo foo = { 1, 2, 3}; foo", expr_options)

This fixed a current issue with ptr_refs, cstr_refs and malloc_info so that they can work. If expressions define their own types and then return expression results that use those types, those types get copied into the target's AST context so they persist and the expression results can be still printed and used in future expressions. Code was added to the expression parser to copy the context in which types are defined if they are used as the expression results. So in the case of types defined by expressions, they get defined in a lldb_expr function and that function and _all_ of its statements get copied. Many types of statements are not supported in this copy (array subscript, lambdas, etc) so this causes expressions to fail as they can't copy the result types. To work around this issue I have added code that allows expressions to specify an expression specific prefix. Then when you evaluate the expression you can pass the "expr_options" and have types that can be correctly copied out into the target. I added this as a way to work around an issue, but I also think it is nice to be allowed to specify an expression prefix that can be reused by many expressions, so this feature is very useful.

<rdar://problem/21130675>

llvm-svn: 238365

9 years agoAsmPrinter: Store abbreviation data directly in DIE and DIEValue
Duncan P. N. Exon Smith [Wed, 27 May 2015 22:31:41 +0000 (22:31 +0000)]
AsmPrinter: Store abbreviation data directly in DIE and DIEValue

Stop storing a `DIEAbbrev` in `DIE`, since the data fits neatly inside
the `DIEValue` list.  Besides being a cleaner data structure (avoiding
the parallel arrays), this gives us more freedom to rearrange the
`DIEValue` list.

This fixes the temporary memory regression from 845 MB up to 879 MB, and
drops it further to 829 MB for a net memory decrease of around 1.9%
(incremental decrease around 5.7%).

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

llvm-svn: 238364

9 years ago[TestBase.runCmd] Better error message when runCmd fails.
Siva Chandra [Wed, 27 May 2015 22:27:41 +0000 (22:27 +0000)]
[TestBase.runCmd] Better error message when runCmd fails.

Summary:
Before:
    AssertionError: False is not True : Process is launched successfully

After:
    AssertionError: False is not True : Command 'run a.out' failed.
    >>> error: invalid target, create a target using the 'target create' command
    >>> Process could not be launched successfully

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, vharron

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

llvm-svn: 238363

9 years agoReapply "AsmPrinter: Change DIEValue to be stored by value"
Duncan P. N. Exon Smith [Wed, 27 May 2015 22:14:58 +0000 (22:14 +0000)]
Reapply "AsmPrinter: Change DIEValue to be stored by value"

This reverts commit r238350, effectively reapplying r238349 after fixing
(all?) the problems, all somehow related to how I was using
`AlignedArrayCharUnion<>` inside `DIEValue`:

  - MSVC can only handle `sizeof()` on types, not values.  Change the
    assert.
  - GCC doesn't know the `is_trivially_copyable` type trait.  Instead of
    asserting it, add destructors.
  - Call placement new even when constructing POD (i.e., the pointers).
  - Instead of copying the char buffer, copy the casted classes.

I've left in a couple of `static_assert`s that I think both MSVC and GCC
know how to handle.  If the bots disagree with me, I'll remove them.

  - Check that the constructed type is either standard layout or a
    pointer.  This protects against a programming error: we really want
    the "small" `DIEValue`s to be small and simple, so don't
    accidentally change them not to be.
  - Similarly, check that the size of the buffer is no bigger than a
    `uint64_t` or a pointer.  (I thought checking against
    `sizeof(uint64_t)` would be good enough, but Chandler suggested that
    pointers might sometimes be bigger than that in the context of
    sanitizers.)

I've also committed r238359 in the meantime, which introduces a
DIEValue.def to simplify dispatching between the various types (thanks
to a review comment by David Blaikie).  Without that, this commit would
be almost unintelligible.

Here's the original commit message:
--
Change `DIEValue` to be stored/passed/etc. by value, instead of
reference.  It's now a discriminated union, with a `Val` field storing
the actual type.  The classes that used to inherit from `DIEValue` no
longer do.  There are two categories of these:

  - Small values fit in a single pointer and are stored by value.
  - Large values require auxiliary storage, and are stored by reference.

The only non-mechanical change is to tools/dsymutil/DwarfLinker.cpp.  It
was relying on `DIEInteger`s being passed around by reference, so I
replaced that assumption with a `PatchLocation` type that stores a safe
reference to where the `DIEInteger` lives instead.

This commit causes a temporary regression in memory usage, since I've
left merging `DIEAbbrevData` into `DIEValue` for a follow-up commit.  I
measured an increase from 845 MB to 879 MB, around 3.9%.  The follow-up
drops it lower than the starting point, and I've only recently brought
the memory this low anyway, so I'm committing these changes separately
to keep them incremental.  (I also considered swapping the commits, but
the other one first would cause a lot more code churn.)

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)
--

llvm-svn: 238362

9 years ago[TestDataFormatterUnordered] Fix a few typos in the test.
Siva Chandra [Wed, 27 May 2015 22:03:09 +0000 (22:03 +0000)]
[TestDataFormatterUnordered] Fix a few typos in the test.

Summary: The typos were exposed by http://reviews.llvm.org/D9948.

Test Plan: dotest.py -p TestDataFormatterUnordered

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 238361

9 years agoSet function entry counts with -fprofile-instr-use.
Diego Novillo [Wed, 27 May 2015 21:58:42 +0000 (21:58 +0000)]
Set function entry counts with -fprofile-instr-use.

This generates function entry counts from instrumentation profiles.

llvm-svn: 238360

9 years agoAsmPrinter: Introduce DIEValue.def, NFC
Duncan P. N. Exon Smith [Wed, 27 May 2015 21:15:43 +0000 (21:15 +0000)]
AsmPrinter: Introduce DIEValue.def, NFC

Use a .def macro file to iterate through the various subclasses of
`DIEValue`.

llvm-svn: 238359

9 years agoRename and move getCurrentSectionData.
Rafael Espindola [Wed, 27 May 2015 21:04:14 +0000 (21:04 +0000)]
Rename and move getCurrentSectionData.

I think this concludes the merge of MCSectionData and MCSection.

llvm-svn: 238358

9 years agoThere is only one current section.
Rafael Espindola [Wed, 27 May 2015 20:52:32 +0000 (20:52 +0000)]
There is only one current section.

Both MCStreamer and MCObjectStreamer were maintaining a current section
variable and they were slightly out of sync. I don't think this was observable,
but was inefficient and error prone.

Changing this requires a few cascading changes:

* SwitchSection has to call ChangeSection earlier for ChangeSection to see
  the old section.
* With that change, ChangeSection cannot call EmitLabel, since during
  ChangeSection we are still in the old section.
* When the object streamer requires a begin label, just reused the existing
  generic support for begin labels instead of calling EmitLabel directly.

llvm-svn: 238357

9 years ago[RuntimeDyld] Fix MachO i386 SECTDIFF relocation to support non-zero addends.
Lang Hames [Wed, 27 May 2015 20:50:01 +0000 (20:50 +0000)]
[RuntimeDyld] Fix MachO i386 SECTDIFF relocation to support non-zero addends.

Previously, relocations of the form 'A - B + C' would fail on i386 when C was
non-zero.

llvm-svn: 238356

9 years agoRevert 238354 while I figure out what broke in weak_ptr
Marshall Clow [Wed, 27 May 2015 20:36:14 +0000 (20:36 +0000)]
Revert 238354 while I figure out what broke in weak_ptr

llvm-svn: 238355

9 years agoFix PR#23647 - make_shared<volatile bool>
Marshall Clow [Wed, 27 May 2015 20:15:33 +0000 (20:15 +0000)]
Fix PR#23647 - make_shared<volatile bool>

llvm-svn: 238354

9 years agoARMTargetParser: Make BSD Thumb/BE armv6 work
Renato Golin [Wed, 27 May 2015 19:49:53 +0000 (19:49 +0000)]
ARMTargetParser: Make BSD Thumb/BE armv6 work

Simple change to make arch like "thumbv6" and "armbev6" to return the
correct CPU for FreeBSD and NetBSD.

llvm-svn: 238353

9 years agoMIR: Remove 2 empty non-reverted directories form SVN.
Alex Lorenz [Wed, 27 May 2015 19:39:44 +0000 (19:39 +0000)]
MIR: Remove 2 empty non-reverted directories form SVN.

The revert commit r238007 didn't delete the old 'MIR' directories
in 'include/llvm/CodeGen' and 'lib/CodeGen'. Since the resubmitted
commit r238341 uses the 'MIRParser' directories instead of 'MIR'
this commit deletes the unused directories.

llvm-svn: 238352

9 years agoFinal fix for PR 23499 and IR test case.
Diego Novillo [Wed, 27 May 2015 19:34:01 +0000 (19:34 +0000)]
Final fix for PR 23499 and IR test case.

This fixes a bit I forgot in r238335. In addition to the data record and
the counter, we can also move the name of the counter to the comdat for
the associated function.

I'm also adding an IR test case to check that these three elements are
placed in the proper comdat.

llvm-svn: 238351

9 years agoRevert "AsmPrinter: Change DIEValue to be stored by value"
Duncan P. N. Exon Smith [Wed, 27 May 2015 19:30:27 +0000 (19:30 +0000)]
Revert "AsmPrinter: Change DIEValue to be stored by value"

This reverts commit r238349, since it caused some errors on bots:
  - std::is_trivially_copyable isn't available until GCC 5.0.
  - It was complaining about strict aliasing with my use of
    ArrayCharUnion.

llvm-svn: 238350

9 years agoAsmPrinter: Change DIEValue to be stored by value
Duncan P. N. Exon Smith [Wed, 27 May 2015 19:22:50 +0000 (19:22 +0000)]
AsmPrinter: Change DIEValue to be stored by value

Change `DIEValue` to be stored/passed/etc. by value, instead of
reference.  It's now a discriminated union, with a `Val` field storing
the actual type.  The classes that used to inherit from `DIEValue` no
longer do.  There are two categories of these:

  - Small values fit in a single pointer and are stored by value.
  - Large values require auxiliary storage, and are stored by reference.

The only non-mechanical change is to tools/dsymutil/DwarfLinker.cpp.  It
was relying on `DIEInteger`s being passed around by reference, so I
replaced that assumption with a `PatchLocation` type that stores a safe
reference to where the `DIEInteger` lives instead.

This commit causes a temporary regression in memory usage, since I've
left merging `DIEAbbrevData` into `DIEValue` for a follow-up commit.  I
measured an increase from 845 MB to 879 MB, around 3.9%.  The follow-up
drops it lower than the starting point, and I've only recently brought
the memory this low anyway, so I'm committing these changes separately
to keep them incremental.  (I also considered swapping the commits, but
the other one first would cause a lot more code churn.)

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

llvm-svn: 238349

9 years agoXTIMEOUT another test timing out on the FreeBSD buildbot
Ed Maste [Wed, 27 May 2015 19:11:29 +0000 (19:11 +0000)]
XTIMEOUT another test timing out on the FreeBSD buildbot

llvm-svn: 238348

9 years agoAllow gcc 5.x to compile library.
Jonathan Peyton [Wed, 27 May 2015 18:57:33 +0000 (18:57 +0000)]
Allow gcc 5.x to compile library.

Change check of __GNUC__ macro from:
__GNUC__ == 4 to __GNUC__ >= 4

llvm-svn: 238347

9 years agoAsmPrinter: Reorganize DIE.h, NFC
Duncan P. N. Exon Smith [Wed, 27 May 2015 18:49:38 +0000 (18:49 +0000)]
AsmPrinter: Reorganize DIE.h, NFC

An upcoming commit will switch to storing `DIEValue`s by value in a
`DIE`, so move the `DIE` down below all the subclasses it can.  Two
subclasses inherit from `DIE`, so drop those down below `DIE`.

`DIEValue` will become a discriminated union, which contains an instance
of one of the classes that are currently subclasses.  "Big" ones, such
as those that inherit from `DIE`, will continue to be stored by pointer.
This commit does as much of the code motion ahead of time as possible.

llvm-svn: 238346

9 years agoIt appears these exports are needed, as wmmintrin.h includes them.
John Thompson [Wed, 27 May 2015 18:26:41 +0000 (18:26 +0000)]
It appears these exports are needed, as wmmintrin.h includes them.

llvm-svn: 238345

9 years agoARMTargetParser: Normalising build attributes
Renato Golin [Wed, 27 May 2015 18:15:37 +0000 (18:15 +0000)]
ARMTargetParser: Normalising build attributes

Now that most of the methods in Clang and LLVM that were parsing arch/cpu/fpu
strings are using ARMTargetParser, it's time to make it a bit more conforming
with what the ABI says.

This commit adds some clarification on what build attributes are accepted and
which are "non-standard". It also makes clear that the "defaultCPU" and
"defaultArch" methods were really just build attribute getters.

It also diverges from GCC's behaviour to say that armv2/armv3 are really an
ARMv4 in the build attributes, when the ABI has a clear state for that: Pre-v4.

llvm-svn: 238344

9 years agoAvoid creating and destroying a std::string on every iteration.
Yaron Keren [Wed, 27 May 2015 18:11:07 +0000 (18:11 +0000)]
Avoid creating and destroying a std::string on every iteration.

llvm-svn: 238343

9 years agoResubmit r237954 (MIR Serialization: print and parse LLVM IR using MIR format).
Alex Lorenz [Wed, 27 May 2015 18:02:19 +0000 (18:02 +0000)]
Resubmit r237954 (MIR Serialization: print and parse LLVM IR using MIR format).

This commit a 3rd attempt at comitting the initial MIR serialization patch.
The first commit (r237708) was reverted in 237730. Then the second commit
(r237954) was reverted in r238007, as the MIR library under CodeGen caused
a circular dependency where the CodeGen library depended on MIR and MIR
library depended on CodeGen.

This commit has fixed the dependencies between CodeGen and MIR by
reorganizing the MIR serialization code - the code that prints out
MIR has been moved to CodeGen, and the MIR library has been renamed
to MIRParser. Now the CodeGen library doesn't depend on the
MIRParser library, thus the circular dependency no longer exists.

--Original Commit Message--

MIR Serialization: print and parse LLVM IR using MIR format.

This commit is the initial commit for the MIR serialization project.
It creates a new library under CodeGen called 'MIR'. This new
library adds a new machine function pass that prints out the LLVM IR
using the MIR format. This pass is then added as a last pass when a
'stop-after' option is used in llc. The new library adds the initial
functionality for parsing of MIR files as well. This commit also
extends the llc tool so that it can recognize and parse MIR input files.

Reviewers: Duncan P. N. Exon Smith, Matthias Braun, Philip Reames

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

llvm-svn: 238341

9 years agoAdd N4259 to the list of papers from Lenexa. Update links to point at public repos.
Marshall Clow [Wed, 27 May 2015 17:19:40 +0000 (17:19 +0000)]
Add N4259 to the list of papers from Lenexa. Update links to point at public repos.

llvm-svn: 238340

9 years agoTest case for PR 23499.
Diego Novillo [Wed, 27 May 2015 17:03:26 +0000 (17:03 +0000)]
Test case for PR 23499.

llvm-svn: 238338

9 years agoR600: Rely on TypeLegalizer to use divrem instead of div/rem
Jan Vesely [Wed, 27 May 2015 16:54:10 +0000 (16:54 +0000)]
R600: Rely on TypeLegalizer to use divrem instead of div/rem

reviewer: tstellardAMD
llvm-svn: 238337

9 years agoSelectionDAG: Don't do libcall on div/rem if divrem is custom
Jan Vesely [Wed, 27 May 2015 16:54:09 +0000 (16:54 +0000)]
SelectionDAG: Don't do libcall on div/rem if divrem is custom

v2: TargetLoweringBase:: -> TargetLowering::
    Use Ops array
v3: Explicitly use value 0 for ?DIV
    Remove redundant newline

Differential revision: http://reviews.llvm.org/D7803
reviewer: ab

llvm-svn: 238336

9 years agoFix PR 23499 - Avoid multiple profile counters for functions in comdat sections.
Diego Novillo [Wed, 27 May 2015 16:44:47 +0000 (16:44 +0000)]
Fix PR 23499 - Avoid multiple profile counters for functions in comdat sections.

Counter symbols created for linkonce functions are not discarded by ELF
linkers unless the symbols are placed in the same comdat section as its
associated function.

llvm-svn: 238335

9 years agoMake sure we print timestamps correctly to 9 places since we are printing nanoseconds.
Greg Clayton [Wed, 27 May 2015 16:25:01 +0000 (16:25 +0000)]
Make sure we print timestamps correctly to 9 places since we are printing nanoseconds.

<rdar://problem/21090231>

llvm-svn: 238334

9 years ago[mips][microMIPSr6] Implement SEB and SEH instructions
Zoran Jovanovic [Wed, 27 May 2015 15:39:47 +0000 (15:39 +0000)]
[mips][microMIPSr6] Implement SEB and SEH instructions
Differential Revision: http://reviews.llvm.org/D9739

llvm-svn: 238333

9 years agoFix NDEBUG build.
Rafael Espindola [Wed, 27 May 2015 15:18:34 +0000 (15:18 +0000)]
Fix NDEBUG build.

llvm-svn: 238332

9 years agoDelete MCSectionData.
Rafael Espindola [Wed, 27 May 2015 15:14:11 +0000 (15:14 +0000)]
Delete MCSectionData.

llvm-svn: 238331

9 years agoDelete dead code. NFC.
Rafael Espindola [Wed, 27 May 2015 14:55:09 +0000 (14:55 +0000)]
Delete dead code. NFC.

llvm-svn: 238330

9 years agoStop using MCSectionData in WinCOFFObjectWriter.cpp.
Rafael Espindola [Wed, 27 May 2015 14:45:54 +0000 (14:45 +0000)]
Stop using MCSectionData in WinCOFFObjectWriter.cpp.

llvm-svn: 238329

9 years agoclang-format WinCOFFObjectWriter.cpp. NFC.
Rafael Espindola [Wed, 27 May 2015 14:37:12 +0000 (14:37 +0000)]
clang-format WinCOFFObjectWriter.cpp. NFC.

llvm-svn: 238328

9 years agoRemove uses of MCSectionData from MachObjectWriter.cpp.
Rafael Espindola [Wed, 27 May 2015 14:33:39 +0000 (14:33 +0000)]
Remove uses of MCSectionData from MachObjectWriter.cpp.

llvm-svn: 238327

9 years ago[clang-tidy] Renamed misc-noexcept-move-ctors to misc-noexcept-move-constructor
Alexander Kornienko [Wed, 27 May 2015 14:24:11 +0000 (14:24 +0000)]
[clang-tidy] Renamed misc-noexcept-move-ctors to misc-noexcept-move-constructor

llvm-svn: 238326

9 years ago[mips][microMIPSr6] Implement BEQZALC, BGEZALC, BGTZALC, BLEZALC, BLTZALC and BNEZALC...
Jozef Kolek [Wed, 27 May 2015 14:19:22 +0000 (14:19 +0000)]
[mips][microMIPSr6] Implement BEQZALC, BGEZALC, BGTZALC, BLEZALC, BLTZALC and BNEZALC instructions

This patch implements microMIPS32r6 BEQZALC, BGEZALC, BGTZALC, BLEZALC, BLTZALC
and BNEZALC instructions using mapping.

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

llvm-svn: 238325

9 years agoARMTargetParser FIXME getCPUProfile A/R/M
Renato Golin [Wed, 27 May 2015 14:15:12 +0000 (14:15 +0000)]
ARMTargetParser FIXME getCPUProfile A/R/M

This is the last of the easy ones.

llvm-svn: 238324

9 years agoChange ProcessGDBRemote last stop packet to a container.
Ewan Crawford [Wed, 27 May 2015 14:12:34 +0000 (14:12 +0000)]
Change ProcessGDBRemote last stop packet to a container.

In ProcessGDBRemote we currently have a single packet, m_last_stop_packet, used to set the thread stop info.
However in non-stop mode we can receive several stop reply packets in a sequence for different threads. As a result we need to use a container to hold them before they are processed.

This patch also changes the return type of CheckPacket() so we can detect async notification packets.

Reviewers: clayborg

Subscribers: labath, ted, deepak2427, lldb-commits

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

llvm-svn: 238323

9 years agoAVX-512: Fixed a bug in extracting subvector from v64i1
Elena Demikhovsky [Wed, 27 May 2015 14:09:33 +0000 (14:09 +0000)]
AVX-512: Fixed a bug in extracting subvector from v64i1

By Igor Breger (igor.breger@intel.com)

llvm-svn: 238322

9 years agoFix xcode project after r238319
Tamas Berghammer [Wed, 27 May 2015 14:04:26 +0000 (14:04 +0000)]
Fix xcode project after r238319

llvm-svn: 238321

9 years agoMove getSubsectionInsertionPoint to MCSection.
Rafael Espindola [Wed, 27 May 2015 13:37:28 +0000 (13:37 +0000)]
Move getSubsectionInsertionPoint to MCSection.

llvm-svn: 238320

9 years agoMake log options uniform betwwen lldb-platform and lldb-gdbserver
Tamas Berghammer [Wed, 27 May 2015 13:34:04 +0000 (13:34 +0000)]
Make log options uniform betwwen lldb-platform and lldb-gdbserver

This change also get rid of an unused Debugger instance in
GDBRemoteCommunicationServerLLGS and the command interpreter from
lldb-platform what was used only for enabling logging.

Differential revision: http://reviews.llvm.org/D9876

llvm-svn: 238319

9 years agoARMTargetParser FIXME: ARMv8 detection for hdiv
Renato Golin [Wed, 27 May 2015 13:33:00 +0000 (13:33 +0000)]
ARMTargetParser FIXME: ARMv8 detection for hdiv

Avoiding ugly combination of string parsing in the front-end. We still
need to move away from CPU parsing at all, but that's for a different
commit.

llvm-svn: 238318

9 years agoRemove uses of MCSectionData from ELFObjectWriter. NFC.
Rafael Espindola [Wed, 27 May 2015 13:30:50 +0000 (13:30 +0000)]
Remove uses of MCSectionData from ELFObjectWriter. NFC.

llvm-svn: 238317

9 years agoAdd real time signals support to FreeBSDSignals
Ed Maste [Wed, 27 May 2015 13:19:46 +0000 (13:19 +0000)]
Add real time signals support to FreeBSDSignals

Apply r238009 to FreeBSD as well.

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

llvm-svn: 238316

9 years agoUse operator<< instead of print in a few more places.
Rafael Espindola [Wed, 27 May 2015 13:05:42 +0000 (13:05 +0000)]
Use operator<< instead of print in a few more places.

llvm-svn: 238315

9 years agoAdd a language log category.
Colin Riley [Wed, 27 May 2015 12:48:14 +0000 (12:48 +0000)]
Add a language log category.

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

llvm-svn: 238314

9 years agoImprove LLDB prompt handling
Pavel Labath [Wed, 27 May 2015 12:40:32 +0000 (12:40 +0000)]
Improve LLDB prompt handling

Summary:
There is an issue in lldb where the command prompt can appear at the wrong time. The partial fix
we have in for this is not working all the time and is introducing unnecessary delays. This
change does:
- Change Process:SyncIOHandler to use integer start id's for synchronization to avoid it being
  confused by quick start-stop cycles. I picked this up from a suggested patch by Greg to
  lldb-dev.
- coordinates printing of asynchronous text with the iohandlers. This is also based on a
  (different) Greg's patch, but I have added stronger synchronization to it to avoid races.

Together, these changes solve the prompt problem for me on linux (both with and without libedit).
I think they should behave similarly on Mac and FreeBSD and I think they will not make matters
worse for windows.

Test Plan: Prompt comes out alright. All tests still pass on linux.

Reviewers: clayborg, emaste, zturner

Subscribers: lldb-commits

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

llvm-svn: 238313

9 years agoFix write register context in EmulateInstructionARM::EmulateMOVRdRm
Tamas Berghammer [Wed, 27 May 2015 12:32:28 +0000 (12:32 +0000)]
Fix write register context in EmulateInstructionARM::EmulateMOVRdRm

llvm-svn: 238312

9 years agoWe always have an InstPrinter.
Rafael Espindola [Wed, 27 May 2015 12:13:06 +0000 (12:13 +0000)]
We always have an InstPrinter.

llvm-svn: 238311

9 years ago[Mips] Move member function definitions to cpp files
Simon Atanasyan [Wed, 27 May 2015 11:56:15 +0000 (11:56 +0000)]
[Mips] Move member function definitions to cpp files

No functional changes.

llvm-svn: 238310

9 years agoFix BreakpointLocationCollection::ShouldStop to handle breakpoint removal
Tamas Berghammer [Wed, 27 May 2015 09:46:47 +0000 (09:46 +0000)]
Fix BreakpointLocationCollection::ShouldStop to handle breakpoint removal

Differential revision: http://reviews.llvm.org/D9886

llvm-svn: 238308

9 years agoParse function name from DWARF DW_AT_abstract_origin
Tamas Berghammer [Wed, 27 May 2015 09:43:44 +0000 (09:43 +0000)]
Parse function name from DWARF DW_AT_abstract_origin

A DW_TAG_subprogram entry can contain a reference to a
DW_AT_abstract_origin entry instead of duplicating the information
from it (e.g.: name) when the same function is inlined in some case
and not inlined in other cases.

This CL fixes name parsing for the case when the DW_TAG_subprogram
for the non inlined version contains just a reference to the
DW_AT_abstract_origin entry instead of the full information.

Differential revision: http://reviews.llvm.org/D10034

llvm-svn: 238307

9 years agoRevert r238305: [PM] Use a simpler technique to drop optional analysis
Chandler Carruth [Wed, 27 May 2015 09:36:33 +0000 (09:36 +0000)]
Revert r238305: [PM] Use a simpler technique to drop optional analysis
manager arguments...

I have no idea why, but compilers seem to hate this and its late, so I'm
not going to debug it. :: sigh :: This is why we can't have nice things.

llvm-svn: 238306

9 years ago[PM] Use a simpler technique to drop optional analysis manager arguments
Chandler Carruth [Wed, 27 May 2015 09:02:51 +0000 (09:02 +0000)]
[PM] Use a simpler technique to drop optional analysis manager arguments
when invoking run methods.

This technique was suggested by Dinesh Dwivedi who also wrote the
original patch. During the code review, they explained to me that this
isn't a fully general technique as we need to know the signatures of the
method candidates. Since this is really a narrower utility, I switched
the names and structure to be more clearly a specialized run method
invoke helper and commented it accordingly. I still think this is
a pretty big win.

Very sorry to Dinesh for the extreme delay in landing this patch. I've
been far to busy poking at other things.

Original review: http://reviews.llvm.org/D3543

llvm-svn: 238305

9 years ago[ELF][Mips] Do not merge ELF flags in the `isCompatible` routine
Simon Atanasyan [Wed, 27 May 2015 08:45:31 +0000 (08:45 +0000)]
[ELF][Mips] Do not merge ELF flags in the `isCompatible` routine

We do not need to merge ELF flags from DSO. But `isCompatible` is called
for all input files. So this change move ELF flags merging into the
MipsELFFile class.

llvm-svn: 238304

9 years ago[Mips] Factor out look up of Elf_Mips_RegInfo structure into the separate function
Simon Atanasyan [Wed, 27 May 2015 08:45:21 +0000 (08:45 +0000)]
[Mips] Factor out look up of Elf_Mips_RegInfo structure into the separate function

No functional changes.

llvm-svn: 238303

9 years agoRevert r238190 and r238197: [mips] Make TTypeEncoding indirect to allow .eh_frame...
Daniel Sanders [Wed, 27 May 2015 08:44:01 +0000 (08:44 +0000)]
Revert r238190 and r238197: [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.

This broke the llvm-mips-linux builder and several of our out-of-tree builders.
Initial investigations show that the commit probably isn't the problem but
reverting anyway while I investigate.

llvm-svn: 238302

9 years agoAVX-512: Implemented all forms of sign-extend and zero-extend instructions for KNL...
Elena Demikhovsky [Wed, 27 May 2015 08:15:19 +0000 (08:15 +0000)]
AVX-512: Implemented all forms of sign-extend and zero-extend instructions for KNL and SKX
Implemented DAG lowering for all these forms.
Added tests for DAG lowering and encoding.

By Igor Breger (igor.breger@intel.com)

llvm-svn: 238301

9 years agoAdd some more detailed docs about the current state of Phabricator and
Chandler Carruth [Wed, 27 May 2015 07:20:46 +0000 (07:20 +0000)]
Add some more detailed docs about the current state of Phabricator and
reviwes.llvm.org to help reduce confusion.

llvm-svn: 238295

9 years agoDrop const in front of iterator
Tobias Grosser [Wed, 27 May 2015 06:51:34 +0000 (06:51 +0000)]
Drop const in front of iterator

David Blaikie:

"find returns an iterator by value, so it's just added complexity/strangeness to
then use reference lifetime extension to give it the same semantics as if you'd
used a value type instead of a reference type."

llvm-svn: 238294

9 years ago[X86] Implement the support for shrink-wrapping.
Quentin Colombet [Wed, 27 May 2015 06:28:41 +0000 (06:28 +0000)]
[X86] Implement the support for shrink-wrapping.
With this patch the x86 backend is now shrink-wrapping capable
and this functionality can be tested by using the
-enable-shrink-wrap switch.

The next step is to make more test and enable shrink-wrapping by
default for x86.

Related to <rdar://problem/20821487>

llvm-svn: 238293

9 years ago[ShrinkWrap] Add a target hook to check whether or not
Quentin Colombet [Wed, 27 May 2015 06:25:48 +0000 (06:25 +0000)]
[ShrinkWrap] Add a target hook to check whether or not
the target can handle a given basic block as prologue
or epilogue.

Related to <rdar://problem/20821487>

llvm-svn: 238292

9 years agoclang-format: [JS] Fix incorrect detection of ternary expressions.
Daniel Jasper [Wed, 27 May 2015 05:37:40 +0000 (05:37 +0000)]
clang-format: [JS] Fix incorrect detection of ternary expressions.

A definintion like this could not be formatted at all:
  constructor({aa}: {
    aa?: string,
    aaaaaaaa?: string,
    aaaaaaaaaaaaaaa?: boolean,
    aaaaaa?: List<string>
  }) {
  }

llvm-svn: 238291

9 years agoUse value semantics for list of ScopStmt(s) instead of std::owningptr
Tobias Grosser [Wed, 27 May 2015 05:16:57 +0000 (05:16 +0000)]
Use value semantics for list of ScopStmt(s) instead of std::owningptr

David Blaike suggested this as an alternative to the use of owningptr(s) for our
memory management, as value semantics allow to avoid the additional interface
complexity caused by owningptr while still providing similar memory consistency
guarantees. We could also have used a std::vector, but the use of std::vector
would yield possibly changing pointers which currently causes problems as for
example the memory accesses carry pointers to their parent statements. Such
pointers should not change.

Reviewer: jblaikie, jdoerfert

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

llvm-svn: 238290

9 years agoARMLoadStoreOptimizer: Code cleanup; NFC
Matthias Braun [Wed, 27 May 2015 05:12:40 +0000 (05:12 +0000)]
ARMLoadStoreOptimizer: Code cleanup; NFC

llvm-svn: 238289

9 years agoMachineBasicBlock: Cleanup computeRegisterLiveness()
Matthias Braun [Wed, 27 May 2015 05:12:39 +0000 (05:12 +0000)]
MachineBasicBlock: Cleanup computeRegisterLiveness()

- Clean documentation comment
- Change the API to accept an iterator so you can actually pass
  MachineBasicBlock::end() now.
- Add more "const".

llvm-svn: 238288

9 years agoMCSymbol: Make print() robust against empty names
Matthias Braun [Wed, 27 May 2015 05:12:37 +0000 (05:12 +0000)]
MCSymbol: Make print() robust against empty names

This shouldn't happen, but it's nice not to abort when printing broken machine
functions.

llvm-svn: 238287

9 years agoAdd support for custom commands to set flags on themselves
Enrico Granata [Wed, 27 May 2015 05:04:35 +0000 (05:04 +0000)]
Add support for custom commands to set flags on themselves
This works for Python commands defined via a class (implement get_flags on your class) and C++ plugin commands (which can call SBCommand::GetFlags()/SetFlags())

Flags allow features such as not letting the command run if there's no target, or if the process is not stopped, ...
Commands could always check for these things themselves, but having these accessible via flags makes custom commands more consistent with built-in ones

llvm-svn: 238286

9 years agoclang-format: Fix false positive in function annotation detection.
Daniel Jasper [Wed, 27 May 2015 04:55:47 +0000 (04:55 +0000)]
clang-format: Fix false positive in function annotation detection.

llvm-svn: 238285

9 years agowww - updated build server URLs
Vince Harron [Wed, 27 May 2015 04:55:31 +0000 (04:55 +0000)]
www - updated build server URLs

llvm-svn: 238284

9 years agoChanged Flags::clang_type_resolve_state to unsigned for gcc
Vince Harron [Wed, 27 May 2015 04:54:36 +0000 (04:54 +0000)]
Changed Flags::clang_type_resolve_state to unsigned for gcc

to work around a very noisy gcc warning

llvm-svn: 238283

9 years agotest Makefile.rules - pick a more sensible default CC on Linux
Vince Harron [Wed, 27 May 2015 04:42:54 +0000 (04:42 +0000)]
test Makefile.rules - pick a more sensible default CC on Linux

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

llvm-svn: 238282

9 years agodosep - force timeout processes to dump core when they timeout
Vince Harron [Wed, 27 May 2015 04:40:36 +0000 (04:40 +0000)]
dosep - force timeout processes to dump core when they timeout

move all core files to the session dir after all tests have completed

TEST PLAN
Run tests. Force a timeout by decreasing a timeout
export LLDB_EVENTS_TIMEOUT=10s
./dosep.py

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

llvm-svn: 238281

9 years agoAllow clients to get parsing errors and also fix the ApplePropertyList so it parses...
Greg Clayton [Wed, 27 May 2015 03:24:17 +0000 (03:24 +0000)]
Allow clients to get parsing errors and also fix the ApplePropertyList so it parses the structured data correctly.

llvm-svn: 238280

9 years agoMake StructureData objects dump themselves with correct indentation.
Greg Clayton [Wed, 27 May 2015 03:23:26 +0000 (03:23 +0000)]
Make StructureData objects dump themselves with correct indentation.

llvm-svn: 238279

9 years agoAdd StructuredData.h to the Xcode project.
Greg Clayton [Wed, 27 May 2015 03:22:42 +0000 (03:22 +0000)]
Add StructuredData.h to the Xcode project.

llvm-svn: 238278

9 years agoObject/COFF: Add accessors for import header bitfields.
Rui Ueyama [Wed, 27 May 2015 02:55:04 +0000 (02:55 +0000)]
Object/COFF: Add accessors for import header bitfields.

llvm-svn: 238277

9 years ago[inliner] Fix the early-exit of the inline cost analysis to correctly
Chandler Carruth [Wed, 27 May 2015 02:49:05 +0000 (02:49 +0000)]
[inliner] Fix the early-exit of the inline cost analysis to correctly
model the dense vector instruction bonuses.

Previously, this code really didn't effectively compute the density of
inlined vector instructions and apply the intended inliner bonus. It
would try to compute it repeatedly while analyzing the function and
didn't handle the case where future vector instructions would tip the
scales back towards the bonus.

Instead, speculatively apply all possible bonuses to the threshold
initially. Once we *know* that a certain bonus can not be applied,
subtract it. This should delay early bailout enough to get much more
consistent results without actually causing us to analyze huge swaths of
code. I expect some (hopefully mild) compile time hit here, and some
swings in performance, but this was definitely the intended behavior of
these bonuses.

This also dramatically simplifies the computation of the bonuses to not
interact with each other in confusing ways. The previous code didn't do
a good job of this and the values for bonuses may be surprising but are
at least now clearly written in the code.

Finally, fix code to be in line with comments and use zero as the
bailout condition.

Patch by Easwaran Raman, with some comment tweaks by me to try and
further clarify what is going on with this code.

http://reviews.llvm.org/D8267

llvm-svn: 238276

9 years agoObject/COFF: Add coff_import_header.
Rui Ueyama [Wed, 27 May 2015 02:40:20 +0000 (02:40 +0000)]
Object/COFF: Add coff_import_header.

This type is described in the PE/COFF spec section 7.1.

llvm-svn: 238275

9 years agoImplement and use adb push for PlatformAndroid::PutFile
Robert Flack [Wed, 27 May 2015 02:18:50 +0000 (02:18 +0000)]
Implement and use adb push for PlatformAndroid::PutFile

Using the adb push protocol is significantly faster than the current method of
sending the hex encoded file data for the remote to write to the file.

Test Plan:
Tests continue to pass - and much faster (e.g. TestSBValuePersist.py takes 10s
down from 4m51s on mac -> android)

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

llvm-svn: 238274

9 years agoGet thread sleep_for test passing in C++03
Eric Fiselier [Wed, 27 May 2015 01:09:51 +0000 (01:09 +0000)]
Get thread sleep_for test passing in C++03

llvm-svn: 238273

9 years ago[BitcodeReader] Change assert to report_fatal_error
Filipe Cabecinhas [Wed, 27 May 2015 01:05:40 +0000 (01:05 +0000)]
[BitcodeReader] Change assert to report_fatal_error

It can be triggered by user input.

Bug found with AFL fuzz.

llvm-svn: 238272

9 years agoMark __convert_to_integral test as XFAIL in c++03
Eric Fiselier [Wed, 27 May 2015 01:02:51 +0000 (01:02 +0000)]
Mark __convert_to_integral test as XFAIL in c++03

llvm-svn: 238271