platform/upstream/llvm.git
9 years agoUriParser - fixed potential buffer overrun
Vince Harron [Thu, 15 Jan 2015 20:57:01 +0000 (20:57 +0000)]
UriParser - fixed potential buffer overrun

Switched from ::strtoul to StringConvert::ToUInt32
Changed port output parameter to be -1 if port is unspecified

llvm-svn: 226204

9 years ago[asan] Loosen test for upcoming ppc64 change
Hal Finkel [Thu, 15 Jan 2015 20:48:38 +0000 (20:48 +0000)]
[asan] Loosen test for upcoming ppc64 change

This test casts 0x4 to a function pointer and calls it. Unfortunately, the
faulting address may not exactly be 0x4 on PPC64 ELFv1 systems. The LLVM PPC
backend used to always generate the loads "in order", so we'd fault at 0x4
anyway. However, at upcoming change to loosen that ordering, and we'll pick a
different order on some targets. As a result, as explained in the comment, we
need to allow for certain nearby addresses as well.

llvm-svn: 226202

9 years agoAdd a new pass "inductive range check elimination"
Sanjoy Das [Thu, 15 Jan 2015 20:45:46 +0000 (20:45 +0000)]
Add a new pass "inductive range check elimination"

IRCE eliminates range checks of the form

  0 <= A * I + B < Length

by splitting a loop's iteration space into three segments in a way
that the check is completely redundant in the middle segment.  As an
example, IRCE will convert

  len = < known positive >
  for (i = 0; i < n; i++) {
    if (0 <= i && i < len) {
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }

to

  len = < known positive >
  limit = smin(n, len)
  // no first segment
  for (i = 0; i < limit; i++) {
    if (0 <= i && i < len) { // this check is fully redundant
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }
  for (i = limit; i < n; i++) {
    if (0 <= i && i < len) {
      do_something();
    } else {
      throw_out_of_bounds();
    }
  }

IRCE can deal with multiple range checks in the same loop (it takes
the intersection of the ranges that will make each of them redundant
individually).

Currently IRCE does not do any profitability analysis.  That is a
TODO.

Please note that the status of this pass is *experimental*, and it is
not part of any default pass pipeline.  Having said that, I will love
to get feedback and general input from people interested in trying
this out.

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

llvm-svn: 226201

9 years agoRevert "r226086 - Revert "r226071 - [RegisterCoalescer] Remove copies to reserved...
Hal Finkel [Thu, 15 Jan 2015 20:32:09 +0000 (20:32 +0000)]
Revert "r226086 - Revert "r226071 - [RegisterCoalescer] Remove copies to reserved registers""

Reapply r226071 with fixes. Two fixes:

 1. We need to manually remove the old and create the new 'deaf defs'
    associated with physical register definitions when we move the definition of
    the physical register from the copy point to the point of the original vreg def.

    This problem was picked up by the machinstr verifier, and could trigger a
    verification failure on test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll, so I've
    turned on the verifier in the tests.

 2. When moving the def point of the phys reg up, we need to make sure that it
    is neither defined nor read in between the two instructions. We don't, however,
    extend the live ranges of phys reg defs to cover uses, so just checking for
    live-range overlap between the pair interval and the phys reg aliases won't
    pick up reads. As a result, we manually iterate over the range and check for
    reads.

    A test soon to be committed to the PowerPC backend will test this change.

Original commit message:

[RegisterCoalescer] Remove copies to reserved registers

This allows the RegisterCoalescer to join "non-flipped" range pairs with a
physical destination register -- which allows the RegisterCoalescer to remove
copies like this:

<vreg> = something (maybe a load, for example)
... (things that don't use PHYSREG)
PHYSREG = COPY <vreg>

(with all of the restrictions normally applied by the RegisterCoalescer: having
compatible register classes, etc. )

Previously, the RegisterCoalescer handled only the opposite case (copying
*from* a physical register). I don't handle the problem fully here, but try to
get the common case where there is only one use of <vreg> (the COPY).

An upcoming commit to the PowerPC backend will make this pattern much more
common on PPC64/ELF systems.

llvm-svn: 226200

9 years agoMoved Args::StringToXIntYZ to StringConvert::ToXIntYZ
Vince Harron [Thu, 15 Jan 2015 20:08:35 +0000 (20:08 +0000)]
Moved Args::StringToXIntYZ to StringConvert::ToXIntYZ

The refactor was motivated by some comments that Greg made
http://reviews.llvm.org/D6918

and also to break a dependency cascade that caused functions linking
in string->int conversion functions to pull in most of lldb

llvm-svn: 226199

9 years agoStyle cleanup of old gc.root lowering code
Philip Reames [Thu, 15 Jan 2015 19:49:25 +0000 (19:49 +0000)]
Style cleanup of old gc.root lowering code

Use static functions for helpers rather than static member functions.  a) this changes the linking (minor at best), and b) this makes it obvious no object state is involved.

llvm-svn: 226198

9 years agoR600/SI: Improve fpext / fptrunc test coverage
Matt Arsenault [Thu, 15 Jan 2015 19:39:42 +0000 (19:39 +0000)]
R600/SI: Improve fpext / fptrunc test coverage

llvm-svn: 226197

9 years agoclang-format GCStrategy.cpp & GCRootLowering.cpp (NFC)
Philip Reames [Thu, 15 Jan 2015 19:39:17 +0000 (19:39 +0000)]
clang-format GCStrategy.cpp & GCRootLowering.cpp (NFC)

llvm-svn: 226196

9 years agoSplit GCStrategy.cpp into two files (NFC)
Philip Reames [Thu, 15 Jan 2015 19:29:42 +0000 (19:29 +0000)]
Split GCStrategy.cpp into two files (NFC)

This preparation for an update to http://reviews.llvm.org/D6811.  GCStrategy.cpp will hopefully be moving into IR/, where as the lowering logic needs to stay in CodeGen/

llvm-svn: 226195

9 years ago[Hexagon] Removing old versions of vsplice, valign, cl0, ct0 and updating references...
Colin LeMahieu [Thu, 15 Jan 2015 19:28:32 +0000 (19:28 +0000)]
[Hexagon] Removing old versions of vsplice, valign, cl0, ct0 and updating references to new versions.

llvm-svn: 226194

9 years agoUse set() instead of option() for string option.
Dan Albert [Thu, 15 Jan 2015 18:56:45 +0000 (18:56 +0000)]
Use set() instead of option() for string option.

Fixes issue in r226185.

llvm-svn: 226192

9 years agoR600/SI: Unify VOP2 instructions which are VOP3-only on VI
Marek Olsak [Thu, 15 Jan 2015 18:43:06 +0000 (18:43 +0000)]
R600/SI: Unify VOP2 instructions which are VOP3-only on VI

This removes some duplicated classes and definitions.

These instructions are defined:
  _e32 // pseudo
  _e32_si
  _e64 // pseudo
  _e64_si
  _e64_vi

llvm-svn: 226191

9 years agoR600/SI: Use 64-bit encoding by default for opcodes that are VOP3-only on VI
Marek Olsak [Thu, 15 Jan 2015 18:43:01 +0000 (18:43 +0000)]
R600/SI: Use 64-bit encoding by default for opcodes that are VOP3-only on VI

llvm-svn: 226190

9 years agoR600/SI: Add V_READLANE_B32 and V_WRITELANE_B32 for VI
Marek Olsak [Thu, 15 Jan 2015 18:42:55 +0000 (18:42 +0000)]
R600/SI: Add V_READLANE_B32 and V_WRITELANE_B32 for VI

These are VOP3-only on VI.

The new multiclass doesn't define VOP3 versions of VOP2 instructions.

llvm-svn: 226189

9 years agoR600/SI: Don't shrink instructions whose e32 encoding doesn't exist
Marek Olsak [Thu, 15 Jan 2015 18:42:51 +0000 (18:42 +0000)]
R600/SI: Don't shrink instructions whose e32 encoding doesn't exist

v2: modify hasVALU32BitEncoding instead
v3: - add pseudoToMCOpcode helper to AMDGPUInstInfo, which is used by both
      hasVALU32BitEncoding and AMDGPUMCInstLower::lower
    - report an error if a pseudo can't be lowered
llvm-svn: 226188

9 years agoR600/SI: Add common class VOPAnyCommon
Marek Olsak [Thu, 15 Jan 2015 18:42:44 +0000 (18:42 +0000)]
R600/SI: Add common class VOPAnyCommon

llvm-svn: 226187

9 years agoR600/SI: Don't select SI-only VOP3 opcodes on VI
Marek Olsak [Thu, 15 Jan 2015 18:42:40 +0000 (18:42 +0000)]
R600/SI: Don't select SI-only VOP3 opcodes on VI

llvm-svn: 226186

9 years agoAdd a cmake option for LIT configuration variant.
Dan Albert [Thu, 15 Jan 2015 18:35:04 +0000 (18:35 +0000)]
Add a cmake option for LIT configuration variant.

llvm-svn: 226185

9 years ago[Hexagon] Adding vmux instruction. Removing old transfer instructions and updating...
Colin LeMahieu [Thu, 15 Jan 2015 18:16:00 +0000 (18:16 +0000)]
[Hexagon] Adding vmux instruction.  Removing old transfer instructions and updating references.

llvm-svn: 226184

9 years agostatepoint tests: use statepoint-example gc
Ramkumar Ramachandra [Thu, 15 Jan 2015 18:10:44 +0000 (18:10 +0000)]
statepoint tests: use statepoint-example gc

Mechanical conversion of statepoint tests to use the example-statepoint
gc.

llvm-svn: 226183

9 years agoSupport @PLT loads on 32bit x86.
Joerg Sonnenberger [Thu, 15 Jan 2015 17:59:02 +0000 (17:59 +0000)]
Support @PLT loads on 32bit x86.

llvm-svn: 226182

9 years agoFix a -Wnull-conversion warning.
Nico Weber [Thu, 15 Jan 2015 17:55:24 +0000 (17:55 +0000)]
Fix a -Wnull-conversion warning.

llvm-svn: 226181

9 years agoFix build after clang r226128.
Nico Weber [Thu, 15 Jan 2015 17:51:05 +0000 (17:51 +0000)]
Fix build after clang r226128.

llvm-svn: 226180

9 years ago[Hexagon] Deleting old float comparison instruction and updating references to new...
Colin LeMahieu [Thu, 15 Jan 2015 17:28:14 +0000 (17:28 +0000)]
[Hexagon] Deleting old float comparison instruction and updating references to new ones.

llvm-svn: 226179

9 years agoPR 20146
Nathan Sidwell [Thu, 15 Jan 2015 16:45:53 +0000 (16:45 +0000)]
PR 20146
reject CV void return type on C definitions per 6.9.1/3

llvm-svn: 226178

9 years ago[sanitizer] Restore -fno-lto accidentally removed in r226169.
Evgeniy Stepanov [Thu, 15 Jan 2015 16:31:22 +0000 (16:31 +0000)]
[sanitizer] Restore -fno-lto accidentally removed in r226169.

llvm-svn: 226177

9 years ago[Hexagon] Replacing old fadd/fsub instructions and updating references.
Colin LeMahieu [Thu, 15 Jan 2015 16:30:07 +0000 (16:30 +0000)]
[Hexagon] Replacing old fadd/fsub instructions and updating references.

llvm-svn: 226176

9 years ago[sanitizer] Implement include= option.
Evgeniy Stepanov [Thu, 15 Jan 2015 16:26:59 +0000 (16:26 +0000)]
[sanitizer] Implement include= option.

Allows loading sanitizer options from file.

llvm-svn: 226175

9 years agoRefactor configure_link_flags for modularity. NFC
Jonathan Roelofs [Thu, 15 Jan 2015 16:18:13 +0000 (16:18 +0000)]
Refactor configure_link_flags for modularity. NFC

llvm-svn: 226174

9 years agoRevert Don't create new comdats in CodeGen
Timur Iskhodzhanov [Thu, 15 Jan 2015 16:14:34 +0000 (16:14 +0000)]
Revert Don't create new comdats in CodeGen

It breaks AddressSanitizer on Windows.

llvm-svn: 226173

9 years agoclang-tidy: 'size' call that could be replaced with 'empty' on STL containers
Alexander Kornienko [Thu, 15 Jan 2015 15:46:58 +0000 (15:46 +0000)]
clang-tidy: 'size' call that could be replaced with 'empty' on STL containers

We are porting some of the checkers at a company we developed to the Clang Tidy
infrastructure. We would like to open source the checkers that may be useful
for the community as well. This patch is the first checker that is being ported
to Clang Tidy. We also added fix-it hints, and applied them to LLVM:
http://reviews.llvm.org/D6924

The code compiled and the unit tests are passed after the fixits was applied.

The documentation of the checker:

/// The emptiness of a container should be checked using the empty method
/// instead of the size method. It is not guaranteed that size is a
/// constant-time function, and it is generally more efficient and also shows
/// clearer intent to use empty. Furthermore some containers may implement the
/// empty method but not implement the size method. Using empty whenever
/// possible makes it easier to switch to another container in the future.

It also uses some custom ASTMatchers. In case you find them useful I can submit
them as separate patches to clang. I will apply your suggestions to this patch.

http://reviews.llvm.org/D6925

Patch by Gábor Horváth!

llvm-svn: 226172

9 years ago[mips] Fix a typo in the compare patterns for MIPS32r6/MIPS64r6.
Daniel Sanders [Thu, 15 Jan 2015 15:41:03 +0000 (15:41 +0000)]
[mips] Fix a typo in the compare patterns for MIPS32r6/MIPS64r6.

Summary: The patterns intended for the SETLE node were actually matching the SETLT node.

Reviewers: atanasyan, sstankovic, vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

llvm-svn: 226171

9 years agoFix the C-API MCJIT test for 32-bit big endian machines.
Vasileios Kalintiris [Thu, 15 Jan 2015 15:36:04 +0000 (15:36 +0000)]
Fix the C-API MCJIT test for 32-bit big endian machines.

Avoid using unions for storing the return value from
LLVMGetGlobalValueAddress() and LLVMGetFunctionAddress() and accessing it as
a pointer through another pointer member. This causes problems on 32-bit big
endian machines since the pointer gets the higher part of the return value of
the aforementioned functions.

llvm-svn: 226170

9 years ago[sanitizer] Flag parser rewrite.
Evgeniy Stepanov [Thu, 15 Jan 2015 15:13:43 +0000 (15:13 +0000)]
[sanitizer] Flag parser rewrite.

The new parser is a lot stricter about syntax, reports unrecognized
flags, and will make it easier to implemented some of the planned features.

llvm-svn: 226169

9 years ago[lsan] Fix a typo in a test.
Evgeniy Stepanov [Thu, 15 Jan 2015 15:00:49 +0000 (15:00 +0000)]
[lsan] Fix a typo in a test.

llvm-svn: 226168

9 years agoFix compilation of compiler_rt against libunwind.
Evgeniy Stepanov [Thu, 15 Jan 2015 14:27:38 +0000 (14:27 +0000)]
Fix compilation of compiler_rt against libunwind.

libunwind defines _Unwind_GetLanguageSpecificData as returning long
instead of (uint8_t *).

llvm-svn: 226167

9 years agoAdd disassembler tests for mips64r6 platform. There are no functional changes.
Vladimir Medic [Thu, 15 Jan 2015 14:18:12 +0000 (14:18 +0000)]
Add disassembler tests for mips64r6 platform. There are no functional changes.

llvm-svn: 226166

9 years agoAdd disassembler tests for mips32r6 platform. There are no functional changes.
Vladimir Medic [Thu, 15 Jan 2015 14:11:38 +0000 (14:11 +0000)]
Add disassembler tests for mips32r6 platform. There are no functional changes.

llvm-svn: 226165

9 years agoAdd disassembler tests for mips64r2 platform. There are no functional changes.
Vladimir Medic [Thu, 15 Jan 2015 14:06:34 +0000 (14:06 +0000)]
Add disassembler tests for mips64r2 platform. There are no functional changes.

llvm-svn: 226164

9 years agoFix SelectionDAG -view-*-dags filtering
Mehdi Amini [Thu, 15 Jan 2015 12:03:32 +0000 (12:03 +0000)]
Fix SelectionDAG -view-*-dags filtering

llvm-svn: 226163

9 years agoIn commit clang r226096, DefinitionRequired has been removed. Do the same in lldb...
Sylvestre Ledru [Thu, 15 Jan 2015 11:50:50 +0000 (11:50 +0000)]
In commit clang r226096, DefinitionRequired has been removed. Do the same in lldb implementation

llvm-svn: 226162

9 years agoReplace size method call of containers to empty method where appropriate
Alexander Kornienko [Thu, 15 Jan 2015 11:41:30 +0000 (11:41 +0000)]
Replace size method call of containers to empty method where appropriate

This patch was generated by a clang tidy checker that is being open sourced.
The documentation of that checker is the following:

/// The emptiness of a container should be checked using the empty method
/// instead of the size method. It is not guaranteed that size is a
/// constant-time function, and it is generally more efficient and also shows
/// clearer intent to use empty. Furthermore some containers may implement the
/// empty method but not implement the size method. Using empty whenever
/// possible makes it easier to switch to another container in the future.

Patch by Gábor Horváth!

llvm-svn: 226161

9 years ago[PM] Port TargetLibraryInfo to the new pass manager, provided by the
Chandler Carruth [Thu, 15 Jan 2015 11:39:46 +0000 (11:39 +0000)]
[PM] Port TargetLibraryInfo to the new pass manager, provided by the
TargetLibraryAnalysis pass.

There are actually no direct tests of this already in the tree. I've
added the most basic test that the pass manager bits themselves work,
and the TLI object produced will be tested by an upcoming patches as
they port passes which rely on TLI.

This is starting to point out the awkwardness of the invalidate API --
it seems poorly fitting on the *result* object. I suspect I will change
it to live on the analysis instead, but that's not for this change, and
I'd rather have a few more passes ported in order to have more
experience with how this plays out.

I believe there is only one more analysis required in order to start
porting instcombine. =]

llvm-svn: 226160

9 years ago[PM] Track an LLVM API change by switching this code to directly create
Chandler Carruth [Thu, 15 Jan 2015 10:43:18 +0000 (10:43 +0000)]
[PM] Track an LLVM API change by switching this code to directly create
the wrapper pass for TLI which is now separate from the core class.

llvm-svn: 226159

9 years ago[PM] Track an LLVM API update which separates the TargetLibraryInfo
Chandler Carruth [Thu, 15 Jan 2015 10:42:26 +0000 (10:42 +0000)]
[PM] Track an LLVM API update which separates the TargetLibraryInfo
object from the pass that provides access to it.

We should probably refactor the createTLI code here in Clang in light of
the new structure, but I wanted this patch to be a minimal one that just
patches the behavior back together.

llvm-svn: 226158

9 years ago[PM] Separate the TargetLibraryInfo object from the immutable pass.
Chandler Carruth [Thu, 15 Jan 2015 10:41:28 +0000 (10:41 +0000)]
[PM] Separate the TargetLibraryInfo object from the immutable pass.

The pass is really just a means of accessing a cached instance of the
TargetLibraryInfo object, and this way we can re-use that object for the
new pass manager as its result.

Lots of delta, but nothing interesting happening here. This is the
common pattern that is developing to allow analyses to live in both the
old and new pass manager -- a wrapper pass in the old pass manager
emulates the separation intrinsic to the new pass manager between the
result and pass for analyses.

llvm-svn: 226157

9 years agoAST: alignof might be dependent because of alignment attributes
David Majnemer [Thu, 15 Jan 2015 10:04:14 +0000 (10:04 +0000)]
AST: alignof might be dependent because of alignment attributes

Dependent alignment attributes should make an alignof expression
dependent as well.

llvm-svn: 226156

9 years agoHide some redundant AVX512 instructions from the asm parser, but force them to show...
Craig Topper [Thu, 15 Jan 2015 09:37:15 +0000 (09:37 +0000)]
Hide some redundant AVX512 instructions from the asm parser, but force them to show up in the disassembler.

llvm-svn: 226155

9 years agoRename InputGraph.h -> Node.h.
Rui Ueyama [Thu, 15 Jan 2015 08:58:38 +0000 (08:58 +0000)]
Rename InputGraph.h -> Node.h.

llvm-svn: 226154

9 years agoSimplify.
Rui Ueyama [Thu, 15 Jan 2015 08:51:23 +0000 (08:51 +0000)]
Simplify.

llvm-svn: 226153

9 years ago[CMake] clangCodeGen: Prune a redundant "Target" out of libdeps. It is supplied by...
NAKAMURA Takumi [Thu, 15 Jan 2015 08:51:01 +0000 (08:51 +0000)]
[CMake] clangCodeGen: Prune a redundant "Target" out of libdeps. It is supplied by Analysis.

llvm-svn: 226152

9 years agoAdd disassembler tests for mips64 platform. There are no functional changes.
Vladimir Medic [Thu, 15 Jan 2015 08:50:20 +0000 (08:50 +0000)]
Add disassembler tests for mips64 platform. There are no functional changes.

llvm-svn: 226151

9 years ago[ELF] Do not error on non-existent file in the driver.
Rui Ueyama [Thu, 15 Jan 2015 08:49:19 +0000 (08:49 +0000)]
[ELF] Do not error on non-existent file in the driver.

This change makes it easy to write unit tests for the GNU driver.
No more "empty group" hack is needed. No change in functionality.

llvm-svn: 226150

9 years agoRemove InputGraph and use std::vector<Node> instead.
Rui Ueyama [Thu, 15 Jan 2015 08:46:36 +0000 (08:46 +0000)]
Remove InputGraph and use std::vector<Node> instead.

In total we have removed more than 1000 lines!

llvm-svn: 226149

9 years agoAST: Ensure implicit records have default visibility
David Majnemer [Thu, 15 Jan 2015 08:41:25 +0000 (08:41 +0000)]
AST: Ensure implicit records have default visibility

Types composed with certain implicit record types would have their RTTI
marked as hidden because the implicit record type didn't have any
visibility.

This manifests itself as triggering false positives from tools like
clang's -fsantize=function feature.  The RTTI for a function type's
return type wouldn't match if the return type was an implicit record
type.

Patch by Stephan Bergmann!

llvm-svn: 226148

9 years agoRename InputElement Node.
Rui Ueyama [Thu, 15 Jan 2015 08:31:46 +0000 (08:31 +0000)]
Rename InputElement Node.

InputElement was named that because it's an element of an InputGraph.
It's losing the origin because the InputGraph is now being removed.
InputElement's subclass is FileNode, that naming inconsistency needed
to be fixed.

llvm-svn: 226147

9 years agoRemove InputGraph::addInputElement{,Front}.
Rui Ueyama [Thu, 15 Jan 2015 08:18:14 +0000 (08:18 +0000)]
Remove InputGraph::addInputElement{,Front}.

They were the last member functions of InputGraph (besides members()).
Now InputGraph is just a container of a vector. We are ready to replace
InputGraph with plain File vector.

llvm-svn: 226146

9 years agoRemove WrapperNode.
Rui Ueyama [Thu, 15 Jan 2015 08:10:10 +0000 (08:10 +0000)]
Remove WrapperNode.

WrapperNode was a useless subclass of FileNode. We should just use
FileNode instead.

llvm-svn: 226145

9 years agoRemove FileNode::parse.
Rui Ueyama [Thu, 15 Jan 2015 07:56:14 +0000 (07:56 +0000)]
Remove FileNode::parse.

FileNode::parse was just a forwarder to File::parse so we could remove that.
Also removed dead code.

llvm-svn: 226144

9 years agoRemove FileNode::getPath().
Rui Ueyama [Thu, 15 Jan 2015 07:38:32 +0000 (07:38 +0000)]
Remove FileNode::getPath().

Previously both FileNode and File keep filename. This patch removed
that redundancy.

llvm-svn: 226143

9 years ago[CMake] Update libdeps on clangCodeGen, corresponding to r226079.
NAKAMURA Takumi [Thu, 15 Jan 2015 07:28:53 +0000 (07:28 +0000)]
[CMake] Update libdeps on clangCodeGen, corresponding to r226079.

llvm-svn: 226142

9 years agotemporary commit.
Rui Ueyama [Thu, 15 Jan 2015 07:23:39 +0000 (07:23 +0000)]
temporary commit.

llvm-svn: 226141

9 years agoRemove InputGraph::size().
Rui Ueyama [Thu, 15 Jan 2015 07:20:39 +0000 (07:20 +0000)]
Remove InputGraph::size().

llvm-svn: 226140

9 years agoSimplify FileNode.
Rui Ueyama [Thu, 15 Jan 2015 07:15:36 +0000 (07:15 +0000)]
Simplify FileNode.

The member function was defined to allow subclasses to customize
error message. But since we only have one FileNode type, there's
no actual need for that.

llvm-svn: 226139

9 years agoSimplifyIndVar: Remove unused variable
David Majnemer [Thu, 15 Jan 2015 07:11:23 +0000 (07:11 +0000)]
SimplifyIndVar: Remove unused variable

OtherOperandIdx is not used anymore, remove it to silence warnings.

llvm-svn: 226138

9 years agoMerge SimpleFileNode with WrapperNode.
Rui Ueyama [Thu, 15 Jan 2015 07:05:46 +0000 (07:05 +0000)]
Merge SimpleFileNode with WrapperNode.

llvm-svn: 226137

9 years ago[Mips] Define macros `__mips_isa_rev` in case of mips32r6/mips64r6 options
Simon Atanasyan [Thu, 15 Jan 2015 07:04:48 +0000 (07:04 +0000)]
[Mips] Define macros `__mips_isa_rev` in case of mips32r6/mips64r6 options

llvm-svn: 226136

9 years agoSema: Recover when a function template is in an extern "C" block
David Majnemer [Thu, 15 Jan 2015 07:04:38 +0000 (07:04 +0000)]
Sema: Recover when a function template is in an extern "C" block

llvm-svn: 226135

9 years agoAdjust to the new explicit debug metadata
Tobias Grosser [Thu, 15 Jan 2015 07:02:12 +0000 (07:02 +0000)]
Adjust to the new explicit debug metadata

This fixes the outfall of r226048

llvm-svn: 226134

9 years ago[PECOFF] Remove an InputElement placeholder for the entry name.
Rui Ueyama [Thu, 15 Jan 2015 06:56:26 +0000 (06:56 +0000)]
[PECOFF] Remove an InputElement placeholder for the entry name.

llvm-svn: 226133

9 years agoRe-commit r225766, r225767, r225769, r225814, r225816, r225829, and r225832.
Rui Ueyama [Thu, 15 Jan 2015 06:49:21 +0000 (06:49 +0000)]
Re-commit r225766, r225767, r225769, r225814, r225816, r225829, and r225832.

These changes depended on r225674 and had been rolled back in r225859.
Because r225674 has been re-submitted, it's safe to re-submit them.

llvm-svn: 226132

9 years agoRemove unused parameter, followup to r179639. No behavior change.
Nico Weber [Thu, 15 Jan 2015 06:00:15 +0000 (06:00 +0000)]
Remove unused parameter, followup to r179639. No behavior change.

llvm-svn: 226128

9 years agoAttempt to fix a Linux buildbot.
Rui Ueyama [Thu, 15 Jan 2015 05:41:12 +0000 (05:41 +0000)]
Attempt to fix a Linux buildbot.

llvm-svn: 226127

9 years agoUpdate libdeps since TLI was moved from Target to Analysis in r226078.
NAKAMURA Takumi [Thu, 15 Jan 2015 05:21:00 +0000 (05:21 +0000)]
Update libdeps since TLI was moved from Target to Analysis in r226078.

llvm-svn: 226126

9 years agoReorder.
NAKAMURA Takumi [Thu, 15 Jan 2015 05:20:46 +0000 (05:20 +0000)]
Reorder.

llvm-svn: 226125

9 years agoutils/release/tag.sh: fix -revision vs. -rc check
Hans Wennborg [Thu, 15 Jan 2015 04:36:20 +0000 (04:36 +0000)]
utils/release/tag.sh: fix -revision vs. -rc check

llvm-svn: 226124

9 years agoRe-commit r225674: Convert other drivers to use WrapperNode.
Rui Ueyama [Thu, 15 Jan 2015 04:34:31 +0000 (04:34 +0000)]
Re-commit r225674: Convert other drivers to use WrapperNode.

The original commit had an issue with Mac OS dylib files. It didn't
handle fat binary dylib files correctly. This patch includes a fix.
A test for that case has already been committed in r225764.

llvm-svn: 226123

9 years agoIntroduce llgoi, a REPL for Go
Peter Collingbourne [Thu, 15 Jan 2015 04:13:29 +0000 (04:13 +0000)]
Introduce llgoi, a REPL for Go

llgoi is a Go REPL based on llgo irgen and the LLVM JIT. It supports
expressions, statements, most declarations and imports, including binary
imports from the standard library and source imports from $GOPATH.

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

llvm-svn: 226097

9 years agoRemove ASTConsumer::HandleVTable()'s bool parameter.
Nico Weber [Thu, 15 Jan 2015 04:07:35 +0000 (04:07 +0000)]
Remove ASTConsumer::HandleVTable()'s bool parameter.

Sema calls HandleVTable() with a bool parameter which is then threaded through
three layers.  The only effect of this bool is an early return at the last
layer.

Instead, remove this parameter and call HandleVTable() only if the bool is
true.  No intended behavior change.

llvm-svn: 226096

9 years ago[PM] Clean up the TLI doxygen comments prior to refactoring this code
Chandler Carruth [Thu, 15 Jan 2015 03:51:04 +0000 (03:51 +0000)]
[PM] Clean up the TLI doxygen comments prior to refactoring this code
for the new pass manager.

llvm-svn: 226089

9 years agoFix a little thinko in r226017 - the code to actually add the demangled name to the...
Jim Ingham [Thu, 15 Jan 2015 03:34:31 +0000 (03:34 +0000)]
Fix a little thinko in r226017 - the code to actually add the demangled name to the Mangled object got
moved into the #else branch of the #if/#elif/#endif, so it wasn't getting done in the #if case anymore.

Keep the code to add the demangled name outside of the #if, and then just free the demangled_name
and set it back to NULL in the Windows case.

<rdar://problem/19479499>

llvm-svn: 226088

9 years agoDon't crash when we can't find a block for some reason, just try and do the right...
Greg Clayton [Thu, 15 Jan 2015 03:13:44 +0000 (03:13 +0000)]
Don't crash when we can't find a block for some reason, just try and do the right thing and fail gracefully.

<rdar://problem/19196221>

llvm-svn: 226087

9 years agoRevert "r226071 - [RegisterCoalescer] Remove copies to reserved registers"
Hal Finkel [Thu, 15 Jan 2015 03:08:59 +0000 (03:08 +0000)]
Revert "r226071 - [RegisterCoalescer] Remove copies to reserved registers"

Reverting this while I investigate some bad behavior this is causing. As a
possibly-related issue, adding -verify-machineinstrs to one of the test cases
now fails because of this change:

  llc test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll -march=x86-64 -o - -verify-machineinstrs

*** Bad machine code: No instruction at def index ***
- function:    foo
- basic block: BB#0 return (0x10007e21f10) [0B;736B)
- liverange:   [128r,128d:9)[160r,160d:8)[176r,176d:7)[336r,336d:6)[464r,464d:5)[480r,480d:4)[624r,624d:3)[752r,752d:2)[768r,768d:1)[78
4r,784d:0)  0@784r 1@768r 2@752r 3@624r 4@480r 5@464r 6@336r 7@176r 8@160r 9@128r
- register:    %DS
Valno #3 is defined at 624r

*** Bad machine code: Live segment doesn't end at a valid instruction ***
- function:    foo
- basic block: BB#0 return (0x10007e21f10) [0B;736B)
- liverange:   [128r,128d:9)[160r,160d:8)[176r,176d:7)[336r,336d:6)[464r,464d:5)[480r,480d:4)[624r,624d:3)[752r,752d:2)[768r,768d:1)[78
4r,784d:0)  0@784r 1@768r 2@752r 3@624r 4@480r 5@464r 6@336r 7@176r 8@160r 9@128r
- register:    %DS
[624r,624d:3)
LLVM ERROR: Found 2 machine code errors.

where 624r corresponds exactly to the interval combining change:

624B    %RSP<def> = COPY %vreg16; GR64:%vreg16
        Considering merging %vreg16 with %RSP
                RHS = %vreg16 [608r,624r:0)  0@608r
                updated: 608B   %RSP<def> = MOV64rm <fi#3>, 1, %noreg, 0, %noreg; mem:LD8[%saved_stack.1]
        Success: %vreg16 -> %RSP
        Result = %RSP

llvm-svn: 226086

9 years agoDon't crash when we run into lexical block address range problems, just ignore the...
Greg Clayton [Thu, 15 Jan 2015 03:04:37 +0000 (03:04 +0000)]
Don't crash when we run into lexical block address range problems, just ignore the bad ranges and log an error message asking the user to file a bug.

<rdar://problem/19021931>

llvm-svn: 226085

9 years agoModified LLDB to be able to lookup global variables by address.
Greg Clayton [Thu, 15 Jan 2015 02:59:20 +0000 (02:59 +0000)]
Modified LLDB to be able to lookup global variables by address.

This is done by adding a "Variable *" to SymbolContext and allowing SymbolFile::ResolveSymbolContext() so if an address is resolved into a symbol context, we can include the global or static variable for that address.

This means you can now find global variables that are merged globals when doing a "image lookup --verbose --address 0x1230000". Previously we would resolve a symbol and show "_MergedGlobals123 + 1234". But now we can show the global variable name.

The eSymbolContextEverything purposely does not include the new eSymbolContextVariable in its lookup since stack frame code does many lookups and we don't want it triggering the global variable lookups.

<rdar://problem/18945678>

llvm-svn: 226084

9 years agoPR13699: Include friend declarations in code completion results if they had a
Richard Smith [Thu, 15 Jan 2015 02:27:20 +0000 (02:27 +0000)]
PR13699: Include friend declarations in code completion results if they had a
prior visible declaration. Prefer to take template parameter names from the
first declaration.

Testcase from a patch by Francisco Lopes!

llvm-svn: 226083

9 years agoSwitch this header file to not hard-code Windows line endings.
Chandler Carruth [Thu, 15 Jan 2015 02:21:56 +0000 (02:21 +0000)]
Switch this header file to not hard-code Windows line endings.

llvm-svn: 226081

9 years ago[PM] Update for LLVM r226078 which moved TargetLibraryInfo to the
Chandler Carruth [Thu, 15 Jan 2015 02:17:27 +0000 (02:17 +0000)]
[PM] Update for LLVM r226078 which moved TargetLibraryInfo to the
Analysis library.

llvm-svn: 226080

9 years ago[PM] Update for LLVM r226078 which moved TargetLibraryInfo to the
Chandler Carruth [Thu, 15 Jan 2015 02:16:55 +0000 (02:16 +0000)]
[PM] Update for LLVM r226078 which moved TargetLibraryInfo to the
Analysis library.

llvm-svn: 226079

9 years ago[PM] Move TargetLibraryInfo into the Analysis library.
Chandler Carruth [Thu, 15 Jan 2015 02:16:27 +0000 (02:16 +0000)]
[PM] Move TargetLibraryInfo into the Analysis library.

While the term "Target" is in the name, it doesn't really have to do
with the LLVM Target library -- this isn't an abstraction which LLVM
targets generally need to implement or extend. It has much more to do
with modeling the various runtime libraries on different OSes and with
different runtime environments. The "target" in this sense is the more
general sense of a target of cross compilation.

This is in preparation for porting this analysis to the new pass
manager.

No functionality changed, and updates inbound for Clang and Polly.

llvm-svn: 226078

9 years agoWin64Exception.cpp: Try to fix crash for x64 EH. "Per" might be null there.
NAKAMURA Takumi [Thu, 15 Jan 2015 02:15:21 +0000 (02:15 +0000)]
Win64Exception.cpp: Try to fix crash for x64 EH. "Per" might be null there.

llvm-svn: 226077

9 years agoFix build after r226068: cannot initialize 'int' with 'nullptr_t'
Ed Maste [Thu, 15 Jan 2015 02:07:28 +0000 (02:07 +0000)]
Fix build after r226068: cannot initialize 'int' with 'nullptr_t'

llvm-svn: 226076

9 years agoFix PR22222
Sanjoy Das [Thu, 15 Jan 2015 01:46:09 +0000 (01:46 +0000)]
Fix PR22222

The bug was introduced in r225282. r225282 assumed that sub X, Y is
the same as add X, -Y. This is not correct if we are going to upgrade
the sub to sub nuw. This change fixes the issue by making the
optimization ignore sub instructions.

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

llvm-svn: 226075

9 years agoMake sure that when a breakpoint is hit but its condition is not met,
Jim Ingham [Thu, 15 Jan 2015 01:41:04 +0000 (01:41 +0000)]
Make sure that when a breakpoint is hit but its condition is not met,
the hit count is not updated.
Also, keep the hit count for the breakpoint in the breakpoint.  We were
using just the sum of the location's hit counts, but that was wrong since if a shared library is
unloaded, and the location goes away, the breakpoint hit count should not suddenly drop
by the number of hits there were on that location.

llvm-svn: 226074

9 years ago[TableGen] Add support for negative immediates to AsmMatcherEmitter
Hal Finkel [Thu, 15 Jan 2015 01:33:00 +0000 (01:33 +0000)]
[TableGen] Add support for negative immediates to AsmMatcherEmitter

This adds support for creating an InstAlias with a negative immediate, i.e.:

  def NOT : InstAlias<"not $dst, $src", (XORI GR32:$dst, GR32:$src, -1)>;

by resolving this problem:

RISCVGenAsmMatcher.inc:95:11: error: expected '= constant-expression' or end of enumerator definition
  CVT_imm_-1,
  ^^^^^^^^^^

Patch by Jordy Potman, thanks!

llvm-svn: 226073

9 years agoMake libmyshared.dylib a fat binary.
Rui Ueyama [Thu, 15 Jan 2015 01:32:00 +0000 (01:32 +0000)]
Make libmyshared.dylib a fat binary.

This would have caught the issue that I made in r225764.

llvm-svn: 226072

9 years ago[RegisterCoalescer] Remove copies to reserved registers
Hal Finkel [Thu, 15 Jan 2015 01:25:28 +0000 (01:25 +0000)]
[RegisterCoalescer] Remove copies to reserved registers

This allows the RegisterCoalescer to join "non-flipped" range pairs with a
physical destination register -- which allows the RegisterCoalescer to remove
copies like this:

<vreg> = something (maybe a load, for example)
... (things that don't use PHYSREG)
PHYSREG = COPY <vreg>

(with all of the restrictions normally applied by the RegisterCoalescer: having
compatible register classes, etc. )

Previously, the RegisterCoalescer handled only the opposite case (copying
*from* a physical register). I don't handle the problem fully here, but try to
get the common case where there is only one use of <vreg> (the COPY).

An upcoming commit to the PowerPC backend will make this pattern much more
common on PPC64/ELF systems.

llvm-svn: 226071

9 years ago[PowerPC] Add assembler support for mcrfs and friends
Hal Finkel [Thu, 15 Jan 2015 01:00:53 +0000 (01:00 +0000)]
[PowerPC] Add assembler support for mcrfs and friends

Fill out our support for the floating-point status and control register
instructions (mcrfs and friends). As it turns out, these are necessary for
compiling src/test/harness_fp.h in TBB for PowerPC.

Thanks to Raf Schietekat for reporting the issue!

llvm-svn: 226070

9 years agoFor PR21145: recognise a builtin call to a known deallocation function even if
Richard Smith [Thu, 15 Jan 2015 01:00:33 +0000 (01:00 +0000)]
For PR21145: recognise a builtin call to a known deallocation function even if
it's defined in the current module. Clang generates this situation for the
C++14 sized deallocation functions, because it generates a weak definition in
case one isn't provided by the C++ runtime library.

llvm-svn: 226069

9 years agoThree related changes to help:
Kate Stone [Thu, 15 Jan 2015 00:52:41 +0000 (00:52 +0000)]
Three related changes to help:

The default help display now shows the alias collection by default, and hides commands whose named begin with an underscore.  Help is primarily useful to those unfamiliar with LLDB and should aim to answer typical questions while still being able to provide more esoteric answers when required.  To that latter end an argument to include the hidden commands in help has been added, and instead of having a help flag to show aliases there is now one to hide them.  This final change might be controversial as it repurposes the -a shorthand as the opposite of its original meaning.

The previous implementation of OutputFormattedHelpText was easily confused by embedded newlines.  The new algorithm correctly breaks on the FIRST newline or LAST space/tab before the target column count rather than treating all whitespace interchangeably.

Command interpreters now have the ability to specify help prologue text and a command prefix string.  Neither are used in the current LLDB sources but are required to support REPL-like extensions where LLDB commands must be prefixed and additional help text is required to explain how to access traditional debugging commands.

<rdar://problem/17751929>
<rdar://problem/16953815>
<rdar://problem/16953841>
<rdar://problem/16930173>
<rdar://problem/16879028>

llvm-svn: 226068