platform/upstream/llvm.git
9 years agoSmallVector: Move emplace_back to SmallVectorImpl.
Benjamin Kramer [Sat, 7 Feb 2015 16:41:02 +0000 (16:41 +0000)]
SmallVector: Move emplace_back to SmallVectorImpl.

This resolves the strange effect that emplace_back is only available
when the type contained in the vector is not trivially copyable.

llvm-svn: 228496

9 years ago[X86] Force fp stack folding tests to keep to specific domain.
Simon Pilgrim [Sat, 7 Feb 2015 16:14:55 +0000 (16:14 +0000)]
[X86] Force fp stack folding tests to keep to specific domain.

General boolean instructions (AND, ANDN, OR, XOR) need to use a specific domain instruction (and not just the default).

llvm-svn: 228495

9 years ago[X86][AVX2] More AVX2 integer stack folding tests.
Simon Pilgrim [Sat, 7 Feb 2015 16:07:27 +0000 (16:07 +0000)]
[X86][AVX2] More AVX2 integer stack folding tests.

llvm-svn: 228494

9 years agoFix typos; NFC.
Andrea Di Biagio [Sat, 7 Feb 2015 13:56:20 +0000 (13:56 +0000)]
Fix typos; NFC.

llvm-svn: 228493

9 years agoCodeGen: Move DebugLocs.
Benjamin Kramer [Sat, 7 Feb 2015 13:15:54 +0000 (13:15 +0000)]
CodeGen: Move DebugLocs.

It's slightly cheaper than copying it, if the DebugLoc points to replaceable
metadata every copy is recorded in a DenseMap, moving reduces the peak size of
that map.

llvm-svn: 228492

9 years agoMove DebugLocs around instead of copying.
Benjamin Kramer [Sat, 7 Feb 2015 12:28:15 +0000 (12:28 +0000)]
Move DebugLocs around instead of copying.

llvm-svn: 228491

9 years agoMC: Emit COFF section flags in the "proper" order
David Majnemer [Sat, 7 Feb 2015 08:26:40 +0000 (08:26 +0000)]
MC: Emit COFF section flags in the "proper" order

COFF section flags are not idempotent:
  'rd' will make a read-write section because 'd' implies write
  'dr' will make a read-only section because 'r' disables write

llvm-svn: 228490

9 years agoConsistently use override rather than virtual.
Chandler Carruth [Sat, 7 Feb 2015 08:12:22 +0000 (08:12 +0000)]
Consistently use override rather than virtual.

This fixes -Winconsistent-missing-override warnings.

llvm-svn: 228489

9 years ago[PowerPC] Handle loop predecessor invokes
Hal Finkel [Sat, 7 Feb 2015 07:32:58 +0000 (07:32 +0000)]
[PowerPC] Handle loop predecessor invokes

If a loop predecessor has an invoke as its terminator, and the return value
from that invoke is used to determine the loop iteration space, then we can't
insert a computation based on that value in the loop predecessor prior to the
terminator (oops). If there's such an invoke, or just no predecessor for that
matter, insert a new loop preheader.

llvm-svn: 228488

9 years agoAdd more DWARF 5 language constants.
Bruce Mitchener [Sat, 7 Feb 2015 06:35:30 +0000 (06:35 +0000)]
Add more DWARF 5 language constants.

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

llvm-svn: 228487

9 years agoWhen creating a disassembler for one of the arm variants that can
Jason Molenda [Sat, 7 Feb 2015 06:03:49 +0000 (06:03 +0000)]
When creating a disassembler for one of the arm variants that can
only execute thumb instructions, force the arch triple string to
be "thumbv..." instead of "armv..." so we do the right thing by
default when disassembling arbitrary chunks of code.
<rdar://problem/15126397>

llvm-svn: 228486

9 years ago[modules] Treat friend declarations that are lexically within a dependent
Richard Smith [Sat, 7 Feb 2015 03:11:11 +0000 (03:11 +0000)]
[modules] Treat friend declarations that are lexically within a dependent
context as anonymous for merging purposes. They can't be found by their names,
so we merge them based on their position within the surrounding context.

llvm-svn: 228485

9 years agoChange RHS-style decltype to LHS-style decltype<declval()>.
Zachary Turner [Sat, 7 Feb 2015 02:02:23 +0000 (02:02 +0000)]
Change RHS-style decltype to LHS-style decltype<declval()>.

Seems some compilers don't like the RHS-style decltype specifier.

This should fix the buildbots.

llvm-svn: 228484

9 years agoclang-format: Format Objective-C try blocks like all the other try blocks.
Nico Weber [Sat, 7 Feb 2015 01:57:32 +0000 (01:57 +0000)]
clang-format: Format Objective-C try blocks like all the other try blocks.

Before:

  @try {
    // ...
  }
  @finally {
    // ...
  }

Now:

  @try {
    // ...
  } @finally {
    // ...
  }

This is consistent with how we format C++ try blocks and SEH try blocks.
clang-format not doing this before was an implementation oversight.

This is dependent on BraceBreakingStyle.  The snippet above is with the
Attach style.  Style Stroustrip for example still results in the "Before:"
snippet, which makes sense since other blocks (try, else) break after '}' too.

llvm-svn: 228483

9 years agoResubmit unittests for DebugInfoPDB.
Zachary Turner [Sat, 7 Feb 2015 01:47:14 +0000 (01:47 +0000)]
Resubmit unittests for DebugInfoPDB.

These were originally submitted as part of r228428, but this part
caused a build breakage in LLVMConfig.  The library portion was
resubmitted independently since it was not causing breakage.

There were two reasons this was causing the build to fail.  The
first is that there were no Makefiles added for the PDB tests.  And
the second is that the DebugInfoPDB library was only being built by
CMake behind an "if (MSVC)" check.  This is wrong since this the
library hides platform specific details, and it was causing
LLVM-Config to not find the library when trying to build unittests.

llvm-svn: 228482

9 years agoMake the byte-shift SSE intrinsics emit vector shuffles which we know the backend...
Filipe Cabecinhas [Sat, 7 Feb 2015 01:37:09 +0000 (01:37 +0000)]
Make the byte-shift SSE intrinsics emit vector shuffles which we know the backend can handle.

Also removed unused builtins.

Original patch by Andrea Di Biagio!

Reviewers: craig.topper, nadav

Subscribers: cfe-commits

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

llvm-svn: 228481

9 years ago[docs][LLVM-style RTTI] Add a mention of multiple inheritance.
Sean Silva [Sat, 7 Feb 2015 01:16:26 +0000 (01:16 +0000)]
[docs][LLVM-style RTTI] Add a mention of multiple inheritance.

llvm-svn: 228479

9 years agoSupport: Fix tests for VirtualityString
Duncan P. N. Exon Smith [Sat, 7 Feb 2015 01:07:30 +0000 (01:07 +0000)]
Support: Fix tests for VirtualityString

Since these `dwarf` functions return `const char *`, the tests need to
use `StringRef` for checks.  Should fix, e.g., hexagon [1].

[1]: http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/22435

llvm-svn: 228478

9 years agoRemove unused parameter.
Rui Ueyama [Sat, 7 Feb 2015 00:54:46 +0000 (00:54 +0000)]
Remove unused parameter.

llvm-svn: 228476

9 years ago[modules] Don't accidentally trigger deserialization from DeclContext::noload_lookup.
Richard Smith [Sat, 7 Feb 2015 00:45:52 +0000 (00:45 +0000)]
[modules] Don't accidentally trigger deserialization from DeclContext::noload_lookup.

llvm-svn: 228475

9 years agoSupport: Add dwarf::getVirtuality()
Duncan P. N. Exon Smith [Sat, 7 Feb 2015 00:37:15 +0000 (00:37 +0000)]
Support: Add dwarf::getVirtuality()

llvm-svn: 228474

9 years agoSupport: Use Dwarf.def for DW_VIRTUALITY, NFC
Duncan P. N. Exon Smith [Sat, 7 Feb 2015 00:36:23 +0000 (00:36 +0000)]
Support: Use Dwarf.def for DW_VIRTUALITY, NFC

Use definition file for `DW_VIRTUALITY_*`.  Add a `DW_VIRTUALITY_max`
both for ease of testing and for future use by the `LLParser`.

llvm-svn: 228473

9 years agoDont' use close_fds = True on Windows.
Zachary Turner [Sat, 7 Feb 2015 00:14:55 +0000 (00:14 +0000)]
Dont' use close_fds = True on Windows.

If you do, the test runner will fail immediately with the error:

close_fds is not supported on Windows platforms if you redirect
stdin/stdout/stderr.

llvm-svn: 228472

9 years agoSupport: Add dwarf::getAttributeEncoding()
Duncan P. N. Exon Smith [Fri, 6 Feb 2015 23:46:49 +0000 (23:46 +0000)]
Support: Add dwarf::getAttributeEncoding()

llvm-svn: 228470

9 years agoSupport: Rewrite AttributeEncodingString(), NFC
Duncan P. N. Exon Smith [Fri, 6 Feb 2015 23:45:37 +0000 (23:45 +0000)]
Support: Rewrite AttributeEncodingString(), NFC

llvm-svn: 228469

9 years agoSupport: Stop stringifying DW_ATE_{lo,hi}_user
Duncan P. N. Exon Smith [Fri, 6 Feb 2015 23:44:24 +0000 (23:44 +0000)]
Support: Stop stringifying DW_ATE_{lo,hi}_user

llvm-svn: 228468

9 years ago[PowerPC] Fixup incomplete revert of test/CodeGen/PowerPC/tls-pic.ll
Hal Finkel [Fri, 6 Feb 2015 23:30:06 +0000 (23:30 +0000)]
[PowerPC] Fixup incomplete revert of test/CodeGen/PowerPC/tls-pic.ll

llvm-svn: 228467

9 years ago[Orc] Add a Kaleidoscope/Orc tutorial demonstrating lazy-irgen.
Lang Hames [Fri, 6 Feb 2015 23:26:33 +0000 (23:26 +0000)]
[Orc] Add a Kaleidoscope/Orc tutorial demonstrating lazy-irgen.

This tutorial builds on the lazy_codegen kaleidoscope/orc tutorial by making
a small set of changes (~75 lines diff) to defer ir-generation for function
definitions until functions are actually referenced.

llvm-svn: 228466

9 years agoAdd code to llvm-objdump so the -section option with -macho will dump literal
Kevin Enderby [Fri, 6 Feb 2015 23:25:38 +0000 (23:25 +0000)]
Add code to llvm-objdump so the -section option with -macho will dump literal
sections with the Mach-O S_{4,8,16}BYTE_LITERALS section types.

llvm-svn: 228465

9 years agoPR22405: don't lose implicit-deleted-ness across AST write / read.
Richard Smith [Fri, 6 Feb 2015 23:20:21 +0000 (23:20 +0000)]
PR22405: don't lose implicit-deleted-ness across AST write / read.

llvm-svn: 228464

9 years ago[AArch64] Use the source location of the IR branch when creating Bcc
Ahmed Bougacha [Fri, 6 Feb 2015 23:15:39 +0000 (23:15 +0000)]
[AArch64] Use the source location of the IR branch when creating Bcc
from a conditional branch fed by an add/sub/mul-with-overflow node.

We previously used the SDLoc of the overflow node, for no good reason.
In some cases, this led to the Bcc and B terminators having different
source orders, and DBG_VALUEs being inserted between them.

The real issue is with the code that can't handle DBG_VALUEs between
terminators: the few places affected by this will be fixed soon.
In the meantime, fixing the SDLoc is a positive change no matter what.

No tests, as I have no idea how to get .loc emitted for branches?

rdar://19347133

llvm-svn: 228463

9 years ago[X86][AVX2] Begun adding AVX2 integer stack folding tests.
Simon Pilgrim [Fri, 6 Feb 2015 23:12:15 +0000 (23:12 +0000)]
[X86][AVX2] Begun adding AVX2 integer stack folding tests.

llvm-svn: 228462

9 years agoPECOFF: Move error check for invalid command line combination to validateImpl.
Rui Ueyama [Fri, 6 Feb 2015 23:09:13 +0000 (23:09 +0000)]
PECOFF: Move error check for invalid command line combination to validateImpl.

llvm-svn: 228461

9 years agoRevert "r227976 - [PowerPC] Yet another approach to __tls_get_addr" and related fixups
Hal Finkel [Fri, 6 Feb 2015 23:07:40 +0000 (23:07 +0000)]
Revert "r227976 - [PowerPC] Yet another approach to __tls_get_addr" and related fixups

Unfortunately, even with the workaround of disabling the linker TLS
optimizations in Clang restored (which has already been done), this still
breaks self-hosting on my P7 machine (-O3 -DNDEBUG -mcpu=native).

Bill is currently working on an alternate implementation to address the TLS
issue in a way that also fully elides the linker bug (which, unfortunately,
this approach did not fully), so I'm reverting this now.

llvm-svn: 228460

9 years ago[Orc] Add a Kaleidoscope/Orc tutorial demonstrating lazy-codegen.
Lang Hames [Fri, 6 Feb 2015 23:04:53 +0000 (23:04 +0000)]
[Orc] Add a Kaleidoscope/Orc tutorial demonstrating lazy-codegen.

This tutorial builds on the initial kaleidoscope/orc tutorial by adding a
LazyEmittingLayer to the custom stack. This extra layer defers compilation
of modules in the JIT until they are statically referenced.

llvm-svn: 228459

9 years agoSupport: Add dwarf::getLanguage()
Duncan P. N. Exon Smith [Fri, 6 Feb 2015 22:55:13 +0000 (22:55 +0000)]
Support: Add dwarf::getLanguage()

llvm-svn: 228458

9 years agoSupport: Rewrite dwarf::LanguageString(), NFC
Duncan P. N. Exon Smith [Fri, 6 Feb 2015 22:53:19 +0000 (22:53 +0000)]
Support: Rewrite dwarf::LanguageString(), NFC

llvm-svn: 228457

9 years ago[Orc] Add a Kaleidoscope tutorial for Orc demonstrating eager compilation.
Lang Hames [Fri, 6 Feb 2015 22:52:04 +0000 (22:52 +0000)]
[Orc] Add a Kaleidoscope tutorial for Orc demonstrating eager compilation.

This tutorial demonstrates a very basic custom Orc JIT stack that performs eager
compilation: All modules are CodeGen'd immediately upon being added to the JIT.

llvm-svn: 228456

9 years agoIR: Allow 32-bits for lines in debug location
Duncan P. N. Exon Smith [Fri, 6 Feb 2015 22:50:13 +0000 (22:50 +0000)]
IR: Allow 32-bits for lines in debug location

Remove unnecessary restriction of 24-bits for line numbers in
`MDLocation`.

The rest of the debug info schema (with the exception of local
variables) uses 32-bits for line numbers.  As I introduce the
specialized nodes, it makes sense to canonicalize on one size or the
other.

llvm-svn: 228455

9 years ago[Orc] Add more missing headers.
Lang Hames [Fri, 6 Feb 2015 22:48:43 +0000 (22:48 +0000)]
[Orc] Add more missing headers.

llvm-svn: 228454

9 years agoUse make_unique.
Rui Ueyama [Fri, 6 Feb 2015 22:44:16 +0000 (22:44 +0000)]
Use make_unique.

llvm-svn: 228453

9 years agouse local variables; NFC
Sanjay Patel [Fri, 6 Feb 2015 22:43:52 +0000 (22:43 +0000)]
use local variables; NFC

llvm-svn: 228452

9 years agoSupport: Stop stringifying DW_LANG_{lo,hi}_user
Duncan P. N. Exon Smith [Fri, 6 Feb 2015 22:34:48 +0000 (22:34 +0000)]
Support: Stop stringifying DW_LANG_{lo,hi}_user

llvm-svn: 228451

9 years agoRemove unused #include.
Rui Ueyama [Fri, 6 Feb 2015 22:34:29 +0000 (22:34 +0000)]
Remove unused #include.

llvm-svn: 228450

9 years agoELF: Split OrderPass::compareInitFini for readability. NFC.
Rui Ueyama [Fri, 6 Feb 2015 22:32:09 +0000 (22:32 +0000)]
ELF: Split OrderPass::compareInitFini for readability. NFC.

llvm-svn: 228449

9 years agoAsmParser: Use DW_TAG_hi_user instead of magic constant, NFC
Duncan P. N. Exon Smith [Fri, 6 Feb 2015 22:29:35 +0000 (22:29 +0000)]
AsmParser: Use DW_TAG_hi_user instead of magic constant, NFC

llvm-svn: 228448

9 years agoAsmWriter: Extract writeTag(), NFC
Duncan P. N. Exon Smith [Fri, 6 Feb 2015 22:28:05 +0000 (22:28 +0000)]
AsmWriter: Extract writeTag(), NFC

llvm-svn: 228447

9 years agoAsmWriter: Extract writeMetadataAsOperand(), NFC
Duncan P. N. Exon Smith [Fri, 6 Feb 2015 22:27:22 +0000 (22:27 +0000)]
AsmWriter: Extract writeMetadataAsOperand(), NFC

llvm-svn: 228446

9 years ago[msan] Fix "missing origin" in atomic store.
Evgeniy Stepanov [Fri, 6 Feb 2015 21:47:39 +0000 (21:47 +0000)]
[msan] Fix "missing origin" in atomic store.

An atomic store always make the target location fully initialized (in the
current implementation). It should not store origin. Initialized memory can't
have meaningful origin, and, due to origin granularity (4 bytes) there is a
chance that this extra store would overwrite meaningfull origin for an adjacent
location.

llvm-svn: 228444

9 years ago[Refactor] Use only one BlockGenerator for a SCoP
Johannes Doerfert [Fri, 6 Feb 2015 21:39:31 +0000 (21:39 +0000)]
[Refactor] Use only one BlockGenerator for a SCoP

  This change has two main purposes:
    1) We do not use a static interface to hide an object we create and
       destroy for every basic block we copy.
    2) We allow the BlockGenerator to store information between calls to
       the copyBB method. This will ease scalar/phi code generation
       later on.

  While a lot of method signatures were changed this should not cause
  any real behaviour change.

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

llvm-svn: 228443

9 years agoTest commit to see if it triggers an email to llvm-commits. No change.
Cameron Esfahani [Fri, 6 Feb 2015 21:33:08 +0000 (21:33 +0000)]
Test commit to see if it triggers an email to llvm-commits.  No change.

llvm-svn: 228442

9 years agoDo not run independent blocks when we model all scalar dependences
Johannes Doerfert [Fri, 6 Feb 2015 21:26:45 +0000 (21:26 +0000)]
Do not run independent blocks when we model all scalar dependences

llvm-svn: 228441

9 years ago[Revert] [ELF] Determine default search directories from Context
Shankar Easwaran [Fri, 6 Feb 2015 21:23:50 +0000 (21:23 +0000)]
[Revert] [ELF] Determine default search directories from Context

It looks like the Driver manages search path for each Target lld would support
on the Gnu flavor.

llvm-svn: 228440

9 years ago[Fix] Broken test case
Johannes Doerfert [Fri, 6 Feb 2015 21:20:14 +0000 (21:20 +0000)]
[Fix] Broken test case

llvm-svn: 228439

9 years agoMake this test a little less specific by removing the argument that
Eric Christopher [Fri, 6 Feb 2015 20:53:40 +0000 (20:53 +0000)]
Make this test a little less specific by removing the argument that
could change.

llvm-svn: 228438

9 years agoTry to fix Makefile build for LLVMDebugInfoPDB.
Zachary Turner [Fri, 6 Feb 2015 20:42:03 +0000 (20:42 +0000)]
Try to fix Makefile build for LLVMDebugInfoPDB.

llvm-svn: 228437

9 years agoUnwind: hoist placement delete into base class
Saleem Abdulrasool [Fri, 6 Feb 2015 20:34:17 +0000 (20:34 +0000)]
Unwind: hoist placement delete into base class

Move the placement delete into the base class.  This permits the proper emission
of the virtual destructor in UnwindCursor by using the class specific placement
delete instead of the normal single element ::operator delete.  With this patch,
we can finally build libunwind as a DSO without a runtime dependency on
libc++/libc++abi.

llvm-svn: 228436

9 years agoResubmit "Create lib/DebugInfo/PDB" (r228428)
Zachary Turner [Fri, 6 Feb 2015 20:30:52 +0000 (20:30 +0000)]
Resubmit "Create lib/DebugInfo/PDB" (r228428)

This change resubmits the patch that broke the build, this time
without unittests.  The unittests will be submitted separately
after the problem has been addressed:

--Original Commit Message--

Create lib/DebugInfo/PDB.

This patch creates a platform-independent interface to a PDB reader.
There is currently no implementation of this interface, which will
be provided in future patches.  This defines the basic object model
which any implementation must conform to.

Reviewed by: David Blaikie
Differential Revision: http://reviews.llvm.org/D7356

llvm-svn: 228435

9 years agoUse estimated number of optimized insns in unroll-threshold computation.
Michael Zolotukhin [Fri, 6 Feb 2015 20:20:40 +0000 (20:20 +0000)]
Use estimated number of optimized insns in unroll-threshold computation.

If complete-unroll could help us to optimize away N% of instructions, we
might want to do this even if the final size would exceed loop-unroll
threshold. However, we don't want to unroll huge loop, and we are add
AbsoluteThreshold to avoid that - this threshold will never be crossed,
even if we expect to optimize 99% instructions after that.

llvm-svn: 228434

9 years agoModel PHI nodes without demoting them
Johannes Doerfert [Fri, 6 Feb 2015 20:13:15 +0000 (20:13 +0000)]
Model PHI nodes without demoting them

  This allows us to model PHI nodes in the polyhedral description
  without demoting them. The modeling however will result in the
  same accesses as the demotion would have introduced.

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

llvm-svn: 228433

9 years ago[InstSimplify] Add SimplifyFPBinOp function.
Michael Zolotukhin [Fri, 6 Feb 2015 20:02:51 +0000 (20:02 +0000)]
[InstSimplify] Add SimplifyFPBinOp function.

It is a variation of SimplifyBinOp, but it takes into account
FastMathFlags.

It is needed in inliner and loop-unroller to accurately predict the
transformation's outcome (previously we dropped the flags and were too
conservative in some cases).

Example:
float foo(float *a, float b) {
 float r;
 if (a[1] * b)
   r = /* a lot of expensive computations */;
 else
   r = 1;
 return r;
}
float boo(float *a) {
 return foo(a, 0.0);
}

Without this patch, we don't inline 'foo' into 'boo'.

llvm-svn: 228432

9 years agoRevert "Create lib/DebugInfo/PDB."
Zachary Turner [Fri, 6 Feb 2015 20:00:18 +0000 (20:00 +0000)]
Revert "Create lib/DebugInfo/PDB."

This reverts commit 21028, as it is causing failures in LLVMConfig.

llvm-svn: 228431

9 years agoMake lldb-platform to clear m_process_launch_info when hanlding qProcessInfo request...
Oleksiy Vyalov [Fri, 6 Feb 2015 19:56:33 +0000 (19:56 +0000)]
Make lldb-platform to clear m_process_launch_info when hanlding qProcessInfo request - otherwise subsequent process launches will reuse data from previous launch.

llvm-svn: 228430

9 years ago[fuzzer] move default sanitizer options to a separate file
Kostya Serebryany [Fri, 6 Feb 2015 19:52:07 +0000 (19:52 +0000)]
[fuzzer] move default sanitizer options to a separate file

llvm-svn: 228429

9 years agoCreate lib/DebugInfo/PDB.
Zachary Turner [Fri, 6 Feb 2015 19:44:09 +0000 (19:44 +0000)]
Create lib/DebugInfo/PDB.

This patch creates a platform-independent interface to a PDB reader.
There is currently no implementation of this interface, which will
be provided in future patches.  This defines the basic object model
which any implementation must conform to.

Reviewed by: David Blaikie
Differential Revision: http://reviews.llvm.org/D7356

llvm-svn: 228428

9 years ago[Orc] Move SectionMemoryManager's implementation from MCJIT to ExecutionEngine.
Lang Hames [Fri, 6 Feb 2015 19:36:40 +0000 (19:36 +0000)]
[Orc] Move SectionMemoryManager's implementation from MCJIT to ExecutionEngine.

This is a more sensible home for SectionMemoryManager, and allows the implementation
to be shared between Orc and MCJIT.

llvm-svn: 228427

9 years ago[Orc] Add some missing headers.
Lang Hames [Fri, 6 Feb 2015 19:34:40 +0000 (19:34 +0000)]
[Orc] Add some missing headers.

llvm-svn: 228426

9 years ago[Orc] Fix syntax error in LazyEmittingLayer::removeModuleSet.
Lang Hames [Fri, 6 Feb 2015 19:34:04 +0000 (19:34 +0000)]
[Orc] Fix syntax error in LazyEmittingLayer::removeModuleSet.

This was a trivial think-o, but it's in a method of a templated class
and doesn't have any callers yet, so the compiler let it pass. I hope
to add a unit test to cover this soon.

llvm-svn: 228425

9 years agoASTUnit: Fix a name clash in GCC builds.
Benjamin Kramer [Fri, 6 Feb 2015 18:58:04 +0000 (18:58 +0000)]
ASTUnit: Fix a name clash in GCC builds.

Should fix the build. Looks like GCC 4.9 is using different scoping rules for
range-based for loops.

llvm-svn: 228424

9 years agoUnwind: replace pure virtual functions with aborts
Saleem Abdulrasool [Fri, 6 Feb 2015 18:48:07 +0000 (18:48 +0000)]
Unwind: replace pure virtual functions with aborts

Convert all pure virtual functions in the UnwindCursor with implementations that
abort.  This is effectively manually replicating the current behaviour, whilst
removing the compiler generated calls to __cxa_pure_virtual, which will abort at
runtime with a message indicating that a pure virtual call was made.

The whitespace changes are the result of executing clang-format over the changed
region.

llvm-svn: 228423

9 years agoInline asm IR input register constraints don't have early clobber
Eric Christopher [Fri, 6 Feb 2015 18:44:18 +0000 (18:44 +0000)]
Inline asm IR input register constraints don't have early clobber
modifiers on them. If we have a matching output constraint with
an early clobber make sure we don't propagate that to the input
constraint.

llvm-svn: 228422

9 years ago[LiveIntervalAnalysis] Speed up creation of live ranges for physical registers
Quentin Colombet [Fri, 6 Feb 2015 18:42:41 +0000 (18:42 +0000)]
[LiveIntervalAnalysis] Speed up creation of live ranges for physical registers
by using a segment set.

The patch addresses a compile-time performance regression in the LiveIntervals
analysis pass (see http://llvm.org/bugs/show_bug.cgi?id=18580). This regression
is especially critical when compiling long functions. Our analysis had shown
that the most of time is taken for generation of live intervals for physical
registers. Insertions in the middle of the array of live ranges cause quadratic
algorithmic complexity, which is apparently the main reason for the slow-down.

Overview of changes:
- The patch introduces an additional std::set<Segment>* member in LiveRange for
  storing segments in the phase of initial creation. The set is used if this
  member is not NULL, otherwise everything works the old way.
- The set of operations on LiveRange used during initial creation (i.e. used by
  createDeadDefs and extendToUses) have been reimplemented to use the segment
  set if it is available.
- After a live range is created the contents of the set are flushed to the
  segment vector, because the set is not as efficient as the vector for the
  later uses of the live range. After the flushing, the set is deleted and
  cannot be used again.
- The set is only for live ranges computed in
  LiveIntervalAnalysis::computeLiveInRegUnits() and getRegUnit() but not in
  computeVirtRegs(), because I did not bring any performance benefits to
  computeVirtRegs() and for some examples even brought a slow down.

Patch by Vaidas Gasiunas <vaidas.gasiunas@sap.com>

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

llvm-svn: 228421

9 years agoASTUnit: Use range-based for loops.
Benjamin Kramer [Fri, 6 Feb 2015 18:36:04 +0000 (18:36 +0000)]
ASTUnit: Use range-based for loops.

llvm-svn: 228420

9 years agoAdd support for SBProcess::PutSTDIN to remote processes
Vince Harron [Fri, 6 Feb 2015 18:32:57 +0000 (18:32 +0000)]
Add support for SBProcess::PutSTDIN to remote processes

Processes running on a remote target can already send $O messages
to send stdout but there is no way to send stdin to a remote
inferior.

This allows processes using the API to pump stdin into a remote
inferior process.

It fixes a hang in TestProcessIO.py when running against a remote
target.

llvm-svn: 228419

9 years ago[LV] Move addRuntimeCheck to LoopAccessAnalysis
Adam Nemet [Fri, 6 Feb 2015 18:31:04 +0000 (18:31 +0000)]
[LV] Move addRuntimeCheck to LoopAccessAnalysis

This will allow it to be shared with the new Loop Distribution pass.

getFirstInst is currently duplicated across LoopVectorize.cpp and
LoopAccessAnalysis.cpp.  This is a short-term work-around until we figure out
a better solution.

NFC.  (The code moved is adjusted a bit for the name of the Loop member and
that PtrRtCheck is now a reference rather than a pointer.)

llvm-svn: 228418

9 years agoFix a missing "*stopped" notification in LLDB-MI after "process launch -s" in case...
Ilia K [Fri, 6 Feb 2015 18:15:05 +0000 (18:15 +0000)]
Fix a missing "*stopped" notification in LLDB-MI after "process launch -s" in case of remote-macosx

Summary:
This patch fixes *stopped notification for remote target when started with eLaunchFlagStopAtEntry (for example, using "process launch -s").

See explanation below:
```
Target::Launch (ProcessLaunchInfo &launch_info, Stream *stream)
{
...
if (state != eStateConnected && platform_sp && platform_sp->CanDebugProcess ())
{
   ...
}
else
{
   ...
   if (m_process_sp)
      error = m_process_sp->Launch (launch_info);
}

if (error.Success())
{
    if (launch_info.GetFlags().Test(eLaunchFlagStopAtEntry) == false)
    {
        ....
    }
    -- missing event if eLaunchFlagStopAtEntry is set --
    m_process_sp->RestoreProcessEvents ();
}
...
return error
```

Also this patch contains tests and you can check how it works.

Reviewers: zturner, clayborg, abidh

Reviewed By: clayborg

Subscribers: clayborg, abidh, zturner, lldb-commits

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

llvm-svn: 228417

9 years agoFix darwin-debug installation in cmake (OS X)
Ilia K [Fri, 6 Feb 2015 18:13:10 +0000 (18:13 +0000)]
Fix darwin-debug installation in cmake (OS X)

Summary: Fix darwin-debug installation in cmake (OS X)

Reviewers: zturner, clayborg

Subscribers: lldb-commits, zturner, clayborg

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

llvm-svn: 228416

9 years agoFix ConvenienceVariablesCase.test_with_dsym_and_run_command test after r227285
Ilia K [Fri, 6 Feb 2015 18:11:56 +0000 (18:11 +0000)]
Fix ConvenienceVariablesCase.test_with_dsym_and_run_command test after r227285

Summary:
This fixes test_with_dsym_and_run_command and test_with_dwarf_and_run_commands tests after r227285: "SBThread::GetDescription should use the Thread format instead of making up"

log:
```
======================================================================
FAIL: test_with_dsym_and_run_command (TestConvenienceVariables.ConvenienceVariablesCase)
Test convenience variables lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 456, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 612, in wrapper
    func(*args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 18, in test_with_dsym_and_run_command
    self.convenience_variables()
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 83, in convenience_variables
    patterns = ['SBThread: tid = 0x[0-9a-f]+'])
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 2091, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : 'print lldb.thread
thread #1: tid = 0x80d885, 0x0000000100000f4d a.out`main(argc=1, argv=0x00007fff5fbff078) + 29 at main.c:4, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
' matches expected result
Config=x86_64-clang
======================================================================
FAIL: test_with_dwarf_and_run_commands (TestConvenienceVariables.ConvenienceVariablesCase)
      Test convenience variables lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 473, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 641, in wrapper
    func(*args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 612, in wrapper
    func(*args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 537, in wrapper
    func(*args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 537, in wrapper
    func(*args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 28, in test_with_dwarf_and_run_commands
    self.convenience_variables()
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 83, in convenience_variables
    patterns = ['SBThread: tid = 0x[0-9a-f]+'])
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 2091, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : 'print lldb.thread
thread #1: tid = 0x80d8d3, 0x0000000100000f4d a.out`main(argc=1, argv=0x00007fff5fbff078) + 29 at main.c:4, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
' matches expected result
Config=x86_64-clang
```

Reviewers: zturner, jingham, abidh, clayborg

Subscribers: abidh, lldb-commits, jingham, clayborg, zturner

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

llvm-svn: 228415

9 years agoFix evaluation commands (MI)
Ilia K [Fri, 6 Feb 2015 18:10:30 +0000 (18:10 +0000)]
Fix evaluation commands (MI)

Summary:
These changes include:
* Fix -var-create to be able use current frame '*' (MI)
* Fix print-values option in -var-update (MI)
* Fix 'variable doesn't exist' error in -var-show-attributes (MI)
* Mark print-values option as 'handled-by-cmd' in -var-update (MI)
* Fix SBValue::GetValueDidChange if value was changed
* Fix lldb-mi: -data-evaluate-expression shows undef vars. Before this fix -data-evaluate-expression perceives undefined variables as strings:
```
(gdb)
-data-evaluate-expression undef
^done,value="undef"
```
* Minor fix: -data-evaluate-expression uses IsUnknownValue()
* Enable MiEvaluateTestCase test

All test pass on OS X.

Reviewers: abidh, clayborg

Subscribers: lldb-commits, clayborg, abidh

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

llvm-svn: 228414

9 years ago-iframework option should be forwarded to linker
Steven Wu [Fri, 6 Feb 2015 18:08:29 +0000 (18:08 +0000)]
-iframework option should be forwarded to linker

Summary:
-iframework option is used to specified System framework path so the
path specified should be passed to linker as -F option
rdar://problem/18234544

Reviewers: bob.wilson

Subscribers: cfe-commits

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

llvm-svn: 228413

9 years agoFix -stack-list-locals and -stack-list-arguments (MI)
Ilia K [Fri, 6 Feb 2015 18:08:24 +0000 (18:08 +0000)]
Fix -stack-list-locals and -stack-list-arguments (MI)

Summary:
These changes include:
* Add eVariableInfoFormat argument for MIResponseFormVariableInfo{,2,3} and GetVariableInfo{,2} functions
* Fix -stack-list-locals and -stack-list-arguments: they ingored print-values
* Enable MiStackTestCase tests for -stack-list-xxx commands

All test pass on OS X.

Reviewers: abidh, clayborg

Reviewed By: abidh

Subscribers: lldb-commits, clayborg, abidh

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

llvm-svn: 228412

9 years agoDon't dllexport declarations
Reid Kleckner [Fri, 6 Feb 2015 17:59:49 +0000 (17:59 +0000)]
Don't dllexport declarations

Fixes PR22488

llvm-svn: 228411

9 years agoMake helper functions/classes/globals static. NFC.
Benjamin Kramer [Fri, 6 Feb 2015 17:51:54 +0000 (17:51 +0000)]
Make helper functions/classes/globals static. NFC.

llvm-svn: 228410

9 years agoInstCombine: Combine select sequences into a single select
Matthias Braun [Fri, 6 Feb 2015 17:49:36 +0000 (17:49 +0000)]
InstCombine: Combine select sequences into a single select

Normalize
select(C0, select(C1, a, b), b) -> select((C0 & C1), a, b)
select(C0, a, select(C1, a, b)) -> select((C0 | C1), a, b)

This normal form may enable further combines on the And/Or and shortens
paths for the values. Many targets prefer the other but can go back
easily in CodeGen.

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

llvm-svn: 228409

9 years agounwind: use -fno-rtti -fno-exceptions -funwind-tables
Saleem Abdulrasool [Fri, 6 Feb 2015 17:47:57 +0000 (17:47 +0000)]
unwind: use -fno-rtti -fno-exceptions -funwind-tables

RTTI and exceptions are not needed for the unwinder, the use of C++ there is for
very specific cases, and does not require dynamic_cast nor does it use
exceptions.  This avoids unnecessary references to type information being
emitted.

llvm-svn: 228408

9 years agoMake FileEntry::closeFile public
Ben Langmuir [Fri, 6 Feb 2015 17:34:28 +0000 (17:34 +0000)]
Make FileEntry::closeFile public

If you request that the file manager not close your file immediately
after reading, it's useful to be able to close it later to prevent a
file descriptor leak.

llvm-svn: 228407

9 years agoRevert "OpenCL: handle shift operator with vector operands"
Tom Stellard [Fri, 6 Feb 2015 17:30:04 +0000 (17:30 +0000)]
Revert "OpenCL: handle shift operator with vector operands"

This reverts commit r228382.

This breaks the following case:  Reported by Jeroen Ketema:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150202/122961.html

typedef __attribute__((ext_vector_type(3))) char char3;

void foo() {
 char3 v = {1,1,1};
 char3 w = {1,2,3};

 w <<= v;
}

If I compile with:

 clang -x cl file.c

Then an error is produced:

file.c:10:5: error: expression is not assignable
 w <<= v;
 ~ ^
1 error generated.

llvm-svn: 228406

9 years agoLiveInterval: Fix SubRange memory leak.
Matthias Braun [Fri, 6 Feb 2015 17:28:47 +0000 (17:28 +0000)]
LiveInterval: Fix SubRange memory leak.

llvm-svn: 228405

9 years agoUpdate APIs that return a pair of iterators to return an iterator_range instead.
Benjamin Kramer [Fri, 6 Feb 2015 17:25:10 +0000 (17:25 +0000)]
Update APIs that return a pair of iterators to return an iterator_range instead.

Convert uses of those APIs into ranged for loops. NFC.

llvm-svn: 228404

9 years ago[mips] Fix FileCheck prefixes with whitespace between 'CHECK' and ':'
Daniel Sanders [Fri, 6 Feb 2015 16:37:30 +0000 (16:37 +0000)]
[mips] Fix FileCheck prefixes with whitespace between 'CHECK' and ':'

llvm-svn: 228403

9 years ago[PowerPC] Re-disable linker optimizations for now
Bill Schmidt [Fri, 6 Feb 2015 15:31:03 +0000 (15:31 +0000)]
[PowerPC] Re-disable linker optimizations for now

llvm-svn: 228402

9 years agoRevert "[Core] Update ContentPermissions"
Shankar Easwaran [Fri, 6 Feb 2015 14:55:40 +0000 (14:55 +0000)]
Revert "[Core] Update ContentPermissions"

This reverts commit r228381.

The MachO writer uses the permissions as bit masks.

llvm-svn: 228401

9 years agoValue: Remove superfluous typedefs and deprecated method. NFC.
Benjamin Kramer [Fri, 6 Feb 2015 14:44:02 +0000 (14:44 +0000)]
Value: Remove superfluous typedefs and deprecated method. NFC.

llvm-svn: 228400

9 years agoAArch64PromoteConstant: Modernize and resolve some Use<->User confusion.
Benjamin Kramer [Fri, 6 Feb 2015 14:43:55 +0000 (14:43 +0000)]
AArch64PromoteConstant: Modernize and resolve some Use<->User confusion.

NFC.

llvm-svn: 228399

9 years agoIRCE: Demote template to ArrayRef and SmallVector to array.
Benjamin Kramer [Fri, 6 Feb 2015 14:43:49 +0000 (14:43 +0000)]
IRCE: Demote template to ArrayRef and SmallVector to array.

NFC.

llvm-svn: 228398

9 years agoWhitespace.
Chad Rosier [Fri, 6 Feb 2015 14:14:41 +0000 (14:14 +0000)]
Whitespace.

llvm-svn: 228397

9 years agoCorrecting keyword highlighting in llvm-mode.el.
Rafael Espindola [Fri, 6 Feb 2015 13:57:58 +0000 (13:57 +0000)]
Correcting keyword highlighting in llvm-mode.el.

llvm-mode was previously confused when variable names contained keywords.
This changes ensures that keywords are only highlighted when they're standalone.

Patch by Wilfred Hughes!

llvm-svn: 228396

9 years ago[OCaml] Add Llvm.build_empty_phi.
Peter Zotov [Fri, 6 Feb 2015 13:42:03 +0000 (13:42 +0000)]
[OCaml] Add Llvm.build_empty_phi.

llvm-svn: 228395

9 years agoAdded a test to check that exception flags are not passed by default on PS4.
Andrea Di Biagio [Fri, 6 Feb 2015 13:02:39 +0000 (13:02 +0000)]
Added a test to check that exception flags are not passed by default on PS4.

This patch adds an extra test case to clang-exception-flags.cpp.
No functional change intended.

Patch by Wolfgang Pieb!

Reviewers: filcab, alexr

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

llvm-svn: 228394

9 years agoFix -data-list-register-names/-data-disassemble, minor fix in -data-list-register...
Ilia K [Fri, 6 Feb 2015 12:43:05 +0000 (12:43 +0000)]
Fix -data-list-register-names/-data-disassemble, minor fix in -data-list-register-values (MI)

Summary:
* Fix -data-list-register-names command: previously it ignored regno arguments and always showed all registers
* Add 'size' field to -data-disassemble command: now we are able to get an instruction's size
* Minor fix in -data-list-register-value: fix comments/code style
* Enable all tests in MiDataTestCase
* Fix the GetRegister function that gets an register by its index

These changes were tested on OS X; all MiDataTestCase tests were passed.

Reviewers: clayborg, abidh

Reviewed By: clayborg, abidh

Subscribers: clayborg, abidh, lldb-commits

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

llvm-svn: 228393