platform/upstream/llvm.git
11 years agoFix typeo in diagnose-unwind.py.
Jason Molenda [Mon, 15 Jul 2013 22:40:17 +0000 (22:40 +0000)]
Fix typeo in diagnose-unwind.py.

llvm-svn: 186358

11 years agoPPC: Refactoring to support subtarget feature changing
Hal Finkel [Mon, 15 Jul 2013 22:29:40 +0000 (22:29 +0000)]
PPC: Refactoring to support subtarget feature changing

This change mirrors the changes that were made to the X86 and ARM targets to
support subtarget feature changing. As indicated in r182899, the mechanism is
still undergoing revision, and so as with the X86 and ARM targets, there is no
test case yet (there is no effective functionality change).

llvm-svn: 186357

11 years agoFurther simplify test case from r186119/r186035.
David Blaikie [Mon, 15 Jul 2013 22:28:45 +0000 (22:28 +0000)]
Further simplify test case from r186119/r186035.

llvm-svn: 186356

11 years ago[PECOFF][Writer] Follow up patch for r186336.
Rui Ueyama [Mon, 15 Jul 2013 22:20:10 +0000 (22:20 +0000)]
[PECOFF][Writer] Follow up patch for r186336.

- Make a const reference instead of copying an object
- Fix a comment

llvm-svn: 186355

11 years agoXFAIL on windows too and document the XFAILs.
Rafael Espindola [Mon, 15 Jul 2013 22:16:53 +0000 (22:16 +0000)]
XFAIL on windows too and document the XFAILs.

llvm-svn: 186354

11 years ago[PECOFF][Writer] s/dyn_cast/cast/ where we don't expect null return value.
Rui Ueyama [Mon, 15 Jul 2013 22:15:32 +0000 (22:15 +0000)]
[PECOFF][Writer] s/dyn_cast/cast/ where we don't expect null return value.

llvm-svn: 186353

11 years ago[PECOFF][Writer] Refactoring: Move private methods below public ones.
Rui Ueyama [Mon, 15 Jul 2013 21:35:15 +0000 (21:35 +0000)]
[PECOFF][Writer] Refactoring: Move private methods below public ones.

llvm-svn: 186352

11 years agoTest case for r18266 (serialization support for TagDecl:IsCompleteDefinitionRequired)
David Blaikie [Mon, 15 Jul 2013 21:33:26 +0000 (21:33 +0000)]
Test case for r18266 (serialization support for TagDecl:IsCompleteDefinitionRequired)

llvm-svn: 186351

11 years agoMachine Verifier: verify FrameSetup and FrameDestroy
Manman Ren [Mon, 15 Jul 2013 21:26:31 +0000 (21:26 +0000)]
Machine Verifier: verify FrameSetup and FrameDestroy

1> on every path through the CFG, a FrameSetup <n> is always followed by a
   FrameDestroy <n> and a FrameDestroy is always followed by a FrameSetup.
2> stack adjustments are identical on all CFG edges to a merge point.
3> frame is destroyed at end of a return block.

PR16393

llvm-svn: 186350

11 years agoObjC migrator: finding conforming protocol
Fariborz Jahanian [Mon, 15 Jul 2013 21:22:08 +0000 (21:22 +0000)]
ObjC migrator: finding conforming protocol
candidates for each class. wip.

llvm-svn: 186349

11 years agoFix a typo in the diagnostic note added in r186342.
Kaelyn Uhrain [Mon, 15 Jul 2013 21:18:33 +0000 (21:18 +0000)]
Fix a typo in the diagnostic note added in r186342.

llvm-svn: 186348

11 years agoFix issues with GCC debugging. GCC emits DWARF in unique ways that LLDB wasn't handli...
Greg Clayton [Mon, 15 Jul 2013 21:10:17 +0000 (21:10 +0000)]
Fix issues with GCC debugging. GCC emits DWARF in unique ways that LLDB wasn't handling. This fix will fix cases where classes are forward declared using DW_TAG_structure_type and then actually defined using DW_TAG_class_type. LLDB, when it finds a forward declaration, would try and find and parse the complete type. It does this by:

1 - looking up the type basename in the type index
2 - iterate through all matches and look for decl contexts (namespace/class hierarchy) that match

The issue was the decl context matching wasn't watching for DW_TAG_class_type/DW_TAG_structure_type mismatches, and it wasn't also getting the name for DIE's that didn't have a DW_AT_name, but did have a DW_AT_specification that had a name.

llvm-svn: 186347

11 years ago[PECOFF] Fix comment.
Rui Ueyama [Mon, 15 Jul 2013 21:00:53 +0000 (21:00 +0000)]
[PECOFF] Fix comment.

llvm-svn: 186346

11 years agoRemove an extra is_directory call.
Rafael Espindola [Mon, 15 Jul 2013 20:52:01 +0000 (20:52 +0000)]
Remove an extra is_directory call.

I checked that opening a directory on windows does fail, so this saves a "stat".

llvm-svn: 186345

11 years agoMake std::forward and std::move (and std::move_if_noexcept) constexpr in C++14
Marshall Clow [Mon, 15 Jul 2013 20:46:11 +0000 (20:46 +0000)]
Make std::forward and std::move (and std::move_if_noexcept) constexpr in C++14

llvm-svn: 186344

11 years agoFix register subclass handling in PPCInstrInfo::insertSelect
Hal Finkel [Mon, 15 Jul 2013 20:22:58 +0000 (20:22 +0000)]
Fix register subclass handling in PPCInstrInfo::insertSelect

PPCInstrInfo::insertSelect and PPCInstrInfo::canInsertSelect were computing the
common subclass of the true and false inputs, and then selecting either the
32-bit or the 64-bit isel variant based on the result of calling
PPC::GPRCRegClass.hasSubClassEq(RC) and PPC::G8RCRegClass.hasSubClassEq(RC)
(where RC is the common subclass). Unfortunately, this is not quite right: if
we have something like this:

  %vreg8<def> = SELECT_CC_I8 %vreg4<kill>, %vreg7<kill>, %vreg6<kill>, 76;
    G8RC_and_G8RC_NOX0:%vreg8 CRRC:%vreg4 G8RC_NOX0:%vreg7,%vreg6

then the common subclass of G8RC_and_G8RC_NOX0 and G8RC_NOX0 is G8RC_NOX0, and
G8RC_NOX0 is not a subclass of G8RC (because it also contains the ZERO8
pseudo-register). As a result, we also need to check the common subclass
against GPRC_NOR0 and G8RC_NOX0 explicitly.

This had not been a problem for clients of insertSelect that called
canInsertSelect first (because it had a compensating mistake), but insertSelect
is also used by the PPC pseudo-instruction expander, and this error was causing
a problem in that context.

This problem was found by csmith.

llvm-svn: 186343

11 years agoMove the "->" to "." fixit from r186128 into a separate note since
Kaelyn Uhrain [Mon, 15 Jul 2013 19:54:54 +0000 (19:54 +0000)]
Move the "->" to "." fixit from r186128 into a separate note since
recovery is not attempted with the fixit. Also move the associated test
case from FixIt/fixit.cpp to SemaCXX/member-expr.cpp since the fixit is
no longer automatically applied.

llvm-svn: 186342

11 years ago[mc-coff] Resolve aliases when emitting COFF relocations
Reid Kleckner [Mon, 15 Jul 2013 19:41:21 +0000 (19:41 +0000)]
[mc-coff] Resolve aliases when emitting COFF relocations

This is consistent with the ELF object writer.

Add some COFF tests that relocate against an alias.

Reviewers: espindola

Differential Revision: http://llvm-reviews.chandlerc.com/D1079

llvm-svn: 186341

11 years agoAdd support for type traversal matchers.
Samuel Benzaquen [Mon, 15 Jul 2013 19:25:06 +0000 (19:25 +0000)]
Add support for type traversal matchers.

Summary:
Fixup the type traversal macros/matchers to specify the supported types.
Make the marshallers a little more generic to support any variadic function.
Update the doc script.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1023

llvm-svn: 186340

11 years agoR600/SI: Add support for 64-bit loads
Tom Stellard [Mon, 15 Jul 2013 19:00:09 +0000 (19:00 +0000)]
R600/SI: Add support for 64-bit loads

https://bugs.freedesktop.org/show_bug.cgi?id=65873

llvm-svn: 186339

11 years agoRemove invalid assert in DAGTypeLegalizer::RemapValue
Hal Finkel [Mon, 15 Jul 2013 18:57:05 +0000 (18:57 +0000)]
Remove invalid assert in DAGTypeLegalizer::RemapValue

There is a comment at the top of DAGTypeLegalizer::PerformExpensiveChecks
which, in part, says:

  // Note that these invariants may not hold momentarily when processing a node:
  // the node being processed may be put in a map before being marked Processed.

Unfortunately, this assert would be valid only if the above-mentioned invariant
held unconditionally. This was causing llc to assert when, in fact,
everything was fine.

Thanks to Richard Sandiford for investigating this issue!

Fixes PR16562.

llvm-svn: 186338

11 years agoActually use the return value we get back when
Sean Callanan [Mon, 15 Jul 2013 18:43:36 +0000 (18:43 +0000)]
Actually use the return value we get back when
creating a persistent variable, rather than making
a (potentially expensive) lookup by name.

<rdar://problem/14337653>

llvm-svn: 186337

11 years ago[PECOFF][Writer] Emit .reloc section.
Rui Ueyama [Mon, 15 Jul 2013 18:43:01 +0000 (18:43 +0000)]
[PECOFF][Writer] Emit .reloc section.

Emit .reloc section. This is the first step to support DLL creation. The
executable doesn't need .reloc section, but the DLL does.

Reviewers: Bigcheese

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1126

llvm-svn: 186336

11 years agoBill Fisher: This patch fixes an ill-formed comparison when parsing control escapes...
Howard Hinnant [Mon, 15 Jul 2013 18:21:11 +0000 (18:21 +0000)]
Bill Fisher: This patch fixes an ill-formed comparison when parsing control escapes, e.g. "\cA\ca". The code will now throw an error_escape exception for invalid control sequences like "\c:" or "\c".

I've added the test cases to bad_escape.pass.cpp.

llvm-svn: 186335

11 years agoA few fixes to tests for Windows port.
Howard Hinnant [Mon, 15 Jul 2013 18:09:11 +0000 (18:09 +0000)]
A few fixes to tests for Windows port.

llvm-svn: 186334

11 years agoRemove trailing whitespace
Stephen Lin [Mon, 15 Jul 2013 17:55:02 +0000 (17:55 +0000)]
Remove trailing whitespace

llvm-svn: 186333

11 years agoRevert r186316 while I track down an ASan failure and an assert from
Chandler Carruth [Mon, 15 Jul 2013 17:36:21 +0000 (17:36 +0000)]
Revert r186316 while I track down an ASan failure and an assert from
a bot.

This reverts the commit which introduced a new implementation of the
fancy SROA pass designed to reduce its overhead. I'll skip the huge
commit log here, refer to r186316 if you're looking for how this all
works and why it works that way.

llvm-svn: 186332

11 years agoRe-revert r86040, which was un-reverted in r186199.
Chandler Carruth [Mon, 15 Jul 2013 17:27:42 +0000 (17:27 +0000)]
Re-revert r86040, which was un-reverted in r186199.

This breaks the build of basic patterns with repeated friend
declarations. See the added test case in SemaCXX/friend.cpp or the test
case reported to the original commit log.

Original commit log:
  If we friend a declaration twice, that should not make it visible to
  name lookup in the surrounding context. Slightly rework how we handle
  friend declarations to inherit the visibility of the prior
  declaration, rather than setting a friend declaration to be visible
  whenever there was a prior declaration.

llvm-svn: 186331

11 years agoTeaching llvm-tblgen to not emit a switch statement when there are no case statements.
Aaron Ballman [Mon, 15 Jul 2013 16:53:32 +0000 (16:53 +0000)]
Teaching llvm-tblgen to not emit a switch statement when there are no case statements.

llvm-svn: 186330

11 years agoRevert "[Option] Store arg strings in a set backed by a BumpPtrAllocator"
Reid Kleckner [Mon, 15 Jul 2013 16:40:52 +0000 (16:40 +0000)]
Revert "[Option] Store arg strings in a set backed by a BumpPtrAllocator"

This broke clang's crash-report.c test, and I haven't been able to
figure it out yet.

This reverts commit r186319.

llvm-svn: 186329

11 years agoFix check_lint warnings in sanitizers' runtime libraries
Timur Iskhodzhanov [Mon, 15 Jul 2013 16:11:39 +0000 (16:11 +0000)]
Fix check_lint warnings in sanitizers' runtime libraries

llvm-svn: 186328

11 years agoFix UseAuto not transforming iterator when non-fully qualifiers are used and
Ariel J. Bernal [Mon, 15 Jul 2013 15:37:05 +0000 (15:37 +0000)]
Fix UseAuto not transforming iterator when non-fully qualifiers are used and
using inline namespaces is specified.

UseAuto used to fail to transform iterators when using inline namespaces and
non-fully qualified types, relying on a using directive previously declared.
- This fix uses the already define isFromStdNamespace matcher.
- Fixed tests and added a new test using inline namespaces.
- Added CustomMatchers to reuse common matchers among transforms.

llvm-svn: 186327

11 years agoAdd integer-gentype.inc: Missing file from r185839
Tom Stellard [Mon, 15 Jul 2013 15:20:05 +0000 (15:20 +0000)]
Add integer-gentype.inc: Missing file from r185839

llvm-svn: 186326

11 years agoAdds a passing test for step-over and step-out when the inferior is about to call...
Ashok Thirumurthi [Mon, 15 Jul 2013 15:05:33 +0000 (15:05 +0000)]
Adds a passing test for step-over and step-out when the inferior is about to call longjmp (non-local goto) in a single-threaded inferior.

llvm-svn: 186325

11 years agoclang-format: Improve c-style cast detection.
Daniel Jasper [Mon, 15 Jul 2013 15:04:42 +0000 (15:04 +0000)]
clang-format: Improve c-style cast detection.

Before:
  #define x ((int) - 1)
  #define p(q) ((int *) & q)
After:
  #define x ((int)-1)
  #define p(q) ((int *)&q)

llvm-svn: 186324

11 years agoAdd macro _LIBCPP_CONSTEXPR_AFTER_CXX11 for functions that have been marked constexpr...
Marshall Clow [Mon, 15 Jul 2013 14:57:19 +0000 (14:57 +0000)]
Add macro _LIBCPP_CONSTEXPR_AFTER_CXX11 for functions that have been marked constexpr post C++11

llvm-svn: 186323

11 years agoImprovement of change r186320.
Daniel Jasper [Mon, 15 Jul 2013 14:33:14 +0000 (14:33 +0000)]
Improvement of change r186320.

Fixed a test that by now passed for the wrong reason.

Before:
  llvm::outs() << "aaaaaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaa(
                                                 aaaaaaaaaaaaaaaaaaaaaaaaaaaa);
After:
  llvm::outs() << "aaaaaaaaaaaaaaaaaaa: "
               << aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaa);

Also reformatted Format.cpp with the latest changes (1 formatting fix
and 1 layout change of a <<-chain).

llvm-svn: 186322

11 years agoTest commit to see if write access works.
Job Noorman [Mon, 15 Jul 2013 14:25:26 +0000 (14:25 +0000)]
Test commit to see if write access works.

llvm-svn: 186321

11 years agoImprove formatting of operator<< chains.
Daniel Jasper [Mon, 15 Jul 2013 14:12:30 +0000 (14:12 +0000)]
Improve formatting of operator<< chains.

Before:
  llvm::outs() << "aaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaaaaa << "aaaaaaaaaaaaaaaa: "
               << aaaaaaaaaaaaaaaa << "aaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaaaaa;

After:
  llvm::outs() << "aaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaaaaa
               << "aaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaaaaa
               << "aaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaaaaa;

llvm-svn: 186320

11 years ago[Option] Store arg strings in a set backed by a BumpPtrAllocator
Reid Kleckner [Mon, 15 Jul 2013 13:46:24 +0000 (13:46 +0000)]
[Option] Store arg strings in a set backed by a BumpPtrAllocator

No functionality change.

This is preparing to move response file parsing into lib/Option so it
can be shared between clang and lld.  This change isn't just a
micro-optimization.  Clang's driver uses a std::set<std::string> to
unique arguments while parsing response files, so this matches that.

llvm-svn: 186319

11 years agoReplacing an empty switch with its moral equivalent. No functional changes intended.
Aaron Ballman [Mon, 15 Jul 2013 13:41:33 +0000 (13:41 +0000)]
Replacing an empty switch with its moral equivalent.  No functional changes intended.

llvm-svn: 186318

11 years agoXFAIL this on freebsd to bring the bot back.
Rafael Espindola [Mon, 15 Jul 2013 12:18:30 +0000 (12:18 +0000)]
XFAIL this on freebsd to bring the bot back.

Joerg Sonnenberger tells me one can open a directory in freebsd. I will try
to centralize our calls to open so that we can handle O_BINARY in one place,
and will then handle this there too.

llvm-svn: 186317

11 years agoReimplement SROA yet again. Same fundamental principle, but a totally
Chandler Carruth [Mon, 15 Jul 2013 10:30:19 +0000 (10:30 +0000)]
Reimplement SROA yet again. Same fundamental principle, but a totally
different core implementation strategy.

Previously, SROA would build a relatively elaborate partitioning of an
alloca, associate uses with each partition, and then rewrite the uses of
each partition in an attempt to break apart the alloca into chunks that
could be promoted. This was very wasteful in terms of memory and compile
time because regardless of how complex the alloca or how much we're able
to do in breaking it up, all of the datastructure work to analyze the
partitioning was done up front.

The new implementation attempts to form partitions of the alloca lazily
and on the fly, rewriting the uses that make up that partition as it
goes. This has a few significant effects:
1) Much simpler data structures are used throughout.
2) No more double walk of the recursive use graph of the alloca, only
   walk it once.
3) No more complex algorithms for associating a particular use with
   a particular partition.
4) PHI and Select speculation is simplified and happens lazily.
5) More precise information is available about a specific use of the
   alloca, removing the need for some side datastructures.

Ultimately, I think this is a much better implementation. It removes
about 300 lines of code, but arguably removes more like 500 considering
that some code grew in the process of being factored apart and cleaned
up for this all to work.

I've re-used as much of the old implementation as possible, which
includes the lion's share of code in the form of the rewriting logic.
The interesting new logic centers around how the uses of a partition are
sorted, and split into actual partitions.

Each instruction using a pointer derived from the alloca gets
a 'Partition' entry. This name is totally wrong, but I'll do a rename in
a follow-up commit as there is already enough churn here. The entry
describes the offset range accessed and the nature of the access. Once
we have all of these entries we sort them in a very specific way:
increasing order of begin offset, followed by whether they are
splittable uses (memcpy, etc), followed by the end offset or whatever.
Sorting by splittability is important as it simplifies the collection of
uses into a partition.

Once we have these uses sorted, we walk from the beginning to the end
building up a range of uses that form a partition of the alloca.
Overlapping unsplittable uses are merged into a single partition while
splittable uses are broken apart and carried from one partition to the
next. A partition is also introduced to bridge splittable uses between
the unsplittable regions when necessary.

I've looked at the performance PRs fairly closely. PR15471 no longer
will even load (the module is invalid). Not sure what is up there.
PR15412 improves by between 5% and 10%, however it is nearly impossible
to know what is holding it up as SROA (the entire pass) takes less time
than reading the IR for that test case. The analysis takes the same time
as running mem2reg on the final allocas. I suspect (without much
evidence) that the new implementation will scale much better however,
and it is just the small nature of the test cases that makes the changes
small and noisy. Either way, it is still simpler and cleaner I think.

llvm-svn: 186316

11 years agoDebugInfo: Factor out parsing compile unit DIEs to a separate function. Improve code...
Alexey Samsonov [Mon, 15 Jul 2013 08:43:35 +0000 (08:43 +0000)]
DebugInfo: Factor out parsing compile unit DIEs to a separate function. Improve code style and comments.

No functionality change.

llvm-svn: 186315

11 years agoAdd 'static' and 'const' qualifiers to some arrays of strings.
Craig Topper [Mon, 15 Jul 2013 08:24:27 +0000 (08:24 +0000)]
Add 'static' and 'const' qualifiers to some arrays of strings.

llvm-svn: 186314

11 years agoAdd 'const' qualifier to some arrays.
Craig Topper [Mon, 15 Jul 2013 08:02:13 +0000 (08:02 +0000)]
Add 'const' qualifier to some arrays.

llvm-svn: 186312

11 years agoMake some arrays 'static const'
Craig Topper [Mon, 15 Jul 2013 07:22:00 +0000 (07:22 +0000)]
Make some arrays 'static const'

llvm-svn: 186311

11 years agoAdd include to hopefully fix windows build.
Craig Topper [Mon, 15 Jul 2013 07:15:05 +0000 (07:15 +0000)]
Add include to hopefully fix windows build.

llvm-svn: 186310

11 years agoAdd const qualifier to some static arrays.
Craig Topper [Mon, 15 Jul 2013 07:02:45 +0000 (07:02 +0000)]
Add const qualifier to some static arrays.

llvm-svn: 186309

11 years agoAdd 'static' keyword to some const arrays for consistency.
Craig Topper [Mon, 15 Jul 2013 06:54:12 +0000 (06:54 +0000)]
Add 'static' keyword to some const arrays for consistency.

llvm-svn: 186308

11 years agoMake some arrays 'static const'
Craig Topper [Mon, 15 Jul 2013 06:39:13 +0000 (06:39 +0000)]
Make some arrays 'static const'

llvm-svn: 186307

11 years agoFix to PR12262 - assertion when substituting explicit template arguments
Serge Pavlov [Mon, 15 Jul 2013 06:14:07 +0000 (06:14 +0000)]
Fix to PR12262 - assertion when substituting explicit template arguments
does not substitute a sizeof-pack expression.
The solution is proposed by Richard Smith.
Differential Revision: http://llvm-reviews.chandlerc.com/D869

llvm-svn: 186306

11 years agoRevert 186302 to fix build bots.
Craig Topper [Mon, 15 Jul 2013 05:44:18 +0000 (05:44 +0000)]
Revert 186302 to fix build bots.

llvm-svn: 186305

11 years agoBump version number to 310.99.0.
Jason Molenda [Mon, 15 Jul 2013 04:47:33 +0000 (04:47 +0000)]
Bump version number to 310.99.0.

llvm-svn: 186304

11 years agoRevert part of 186302 to fix buildbots.
Craig Topper [Mon, 15 Jul 2013 04:37:54 +0000 (04:37 +0000)]
Revert part of 186302 to fix buildbots.

llvm-svn: 186303

11 years agoUse llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).
Craig Topper [Mon, 15 Jul 2013 04:28:48 +0000 (04:28 +0000)]
Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).

llvm-svn: 186302

11 years agoUse llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).
Craig Topper [Mon, 15 Jul 2013 04:27:47 +0000 (04:27 +0000)]
Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).

llvm-svn: 186301

11 years agoUse llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).
Craig Topper [Mon, 15 Jul 2013 03:38:40 +0000 (03:38 +0000)]
Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).

llvm-svn: 186300

11 years agoCommit Timothee Besset's patch to update Host/linux/Host.cpp to keep up
Jason Molenda [Mon, 15 Jul 2013 03:25:21 +0000 (03:25 +0000)]
Commit Timothee Besset's patch to update Host/linux/Host.cpp to keep up
with the changes in r186211.

llvm-svn: 186299

11 years agoMark llvm/test/Object/extract.ll as XFAIL:mingw32, for now.
NAKAMURA Takumi [Mon, 15 Jul 2013 03:04:13 +0000 (03:04 +0000)]
Mark llvm/test/Object/extract.ll as XFAIL:mingw32, for now.

FIXME: Investigate Win32's TimeValue stuff!
llvm-svn: 186298

11 years agoClarify comments.
Eric Christopher [Sun, 14 Jul 2013 22:23:54 +0000 (22:23 +0000)]
Clarify comments.

llvm-svn: 186297

11 years agoAdd DW_AT_GNU_odr_signature to the set of dwarf attributes.
Eric Christopher [Sun, 14 Jul 2013 22:02:31 +0000 (22:02 +0000)]
Add DW_AT_GNU_odr_signature to the set of dwarf attributes.

llvm-svn: 186296

11 years agoCollapse temporary variable into call.
Eric Christopher [Sun, 14 Jul 2013 21:46:51 +0000 (21:46 +0000)]
Collapse temporary variable into call.

llvm-svn: 186295

11 years agoReformat line.
Eric Christopher [Sun, 14 Jul 2013 21:15:27 +0000 (21:15 +0000)]
Reformat line.

llvm-svn: 186294

11 years agoMove BlockLiteralGeneric earlier in CGDebugInfo and remove
Eric Christopher [Sun, 14 Jul 2013 21:12:44 +0000 (21:12 +0000)]
Move BlockLiteralGeneric earlier in CGDebugInfo and remove
BlockLiteralGenericSet and replace with a call to isType() on the
BlockLiteralGeneric.

llvm-svn: 186293

11 years agoUpdate a few comments and reformat a decl for clarity.
Eric Christopher [Sun, 14 Jul 2013 21:00:07 +0000 (21:00 +0000)]
Update a few comments and reformat a decl for clarity.

llvm-svn: 186292

11 years agoUse conventional syntax for branches.
Anton Korobeynikov [Sun, 14 Jul 2013 18:19:44 +0000 (18:19 +0000)]
Use conventional syntax for branches.
Patch by Job!

llvm-svn: 186291

11 years agoCorrect inaccurate statement in FileCheck docs.
Stephen Lin [Sun, 14 Jul 2013 18:12:25 +0000 (18:12 +0000)]
Correct inaccurate statement in FileCheck docs.

llvm-svn: 186290

11 years agoScopDetect: clang-format
Tobias Grosser [Sun, 14 Jul 2013 18:09:43 +0000 (18:09 +0000)]
ScopDetect: clang-format

llvm-svn: 186289

11 years agoDependences: Use ostream printer to print analysis output
Tobias Grosser [Sun, 14 Jul 2013 18:09:40 +0000 (18:09 +0000)]
Dependences: Use ostream printer to print analysis output

llvm-svn: 186288

11 years agoReplace C++0x in a comment with C++11
Craig Topper [Sun, 14 Jul 2013 17:04:56 +0000 (17:04 +0000)]
Replace C++0x in a comment with C++11

llvm-svn: 186287

11 years agoChange cxx0x to cxx11 in diagnostic name.
Craig Topper [Sun, 14 Jul 2013 17:02:30 +0000 (17:02 +0000)]
Change cxx0x to cxx11 in diagnostic name.

llvm-svn: 186286

11 years agoChange cxx0x to cxx11 in diagnostic name.
Craig Topper [Sun, 14 Jul 2013 17:01:54 +0000 (17:01 +0000)]
Change cxx0x to cxx11 in diagnostic name.

llvm-svn: 186285

11 years agoUse SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.
Craig Topper [Sun, 14 Jul 2013 16:47:36 +0000 (16:47 +0000)]
Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.

llvm-svn: 186284

11 years agoProperly lower jump tables on MSP430. Patch by Job Noorman!
Anton Korobeynikov [Sun, 14 Jul 2013 15:11:00 +0000 (15:11 +0000)]
Properly lower jump tables on MSP430. Patch by Job Noorman!

llvm-svn: 186283

11 years agoThe archive update test has a subtle race condition in it: if the test
Chandler Carruth [Sun, 14 Jul 2013 10:46:51 +0000 (10:46 +0000)]
The archive update test has a subtle race condition in it: if the test
is executed within the same second as the inputs for the test are
checked out from the source tree, it will fail to update due to being
below the resolution of the 'mtime' test used.

Now, this may seem improbably to you... ok, maybe *really* improbable,
but consider a system which does distributed execution of tests by
shipping their inputs to another machine and runs them. That might cause
the mtime to be quite recent during the test run. ;]

Instead, create two files directly in the test (allowing all platforms
to see the problem) and add either a use of the 'touch' command that
forces one mtime to some time quite a bit in the past, or it sleeps for
just over a second to be outside of the precision window.

llvm-svn: 186282

11 years agoSupport: No need to comment __isl_keep
Tobias Grosser [Sun, 14 Jul 2013 06:59:38 +0000 (06:59 +0000)]
Support: No need to comment __isl_keep

llvm-svn: 186281

11 years agoMass update to CodeGen tests to use CHECK-LABEL for labels corresponding to function...
Stephen Lin [Sun, 14 Jul 2013 06:24:09 +0000 (06:24 +0000)]
Mass update to CodeGen tests to use CHECK-LABEL for labels corresponding to function definitions for more informative error messages. No functionality change and all updated tests passed locally.

This update was done with the following bash script:

  find test/CodeGen -name "*.ll" | \
  while read NAME; do
    echo "$NAME"
    if ! grep -q "^; *RUN: *llc.*debug" $NAME; then
      TEMP=`mktemp -t temp`
      cp $NAME $TEMP
      sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \
      while read FUNC; do
        sed -i '' "s/;\(.*\)\([A-Za-z0-9_-]*\):\( *\)$FUNC: *\$/;\1\2-LABEL:\3$FUNC:/g" $TEMP
      done
      sed -i '' "s/;\(.*\)-LABEL-LABEL:/;\1-LABEL:/" $TEMP
      sed -i '' "s/;\(.*\)-NEXT-LABEL:/;\1-NEXT:/" $TEMP
      sed -i '' "s/;\(.*\)-NOT-LABEL:/;\1-NOT:/" $TEMP
      sed -i '' "s/;\(.*\)-DAG-LABEL:/;\1-DAG:/" $TEMP
      mv $TEMP $NAME
    fi
  done

llvm-svn: 186280

11 years agoMake these tests more robust against IRgen choosing to emit more named metadata.
Richard Smith [Sun, 14 Jul 2013 06:18:38 +0000 (06:18 +0000)]
Make these tests more robust against IRgen choosing to emit more named metadata.

llvm-svn: 186279

11 years agoDelete a test that is checking badly for a point bug that Clang never had (and that...
Richard Smith [Sun, 14 Jul 2013 06:17:03 +0000 (06:17 +0000)]
Delete a test that is checking badly for a point bug that Clang never had (and that spuriously fails with modules enabled).

llvm-svn: 186278

11 years agoSLPVectorizer: change the order in which we search for vectorization candidates....
Nadav Rotem [Sun, 14 Jul 2013 06:15:46 +0000 (06:15 +0000)]
SLPVectorizer: change the order in which we search for vectorization candidates. Do stores first and PHIs second.

llvm-svn: 186277

11 years agoFix build by replacing '>>' with '> >'
Tobias Grosser [Sun, 14 Jul 2013 06:12:01 +0000 (06:12 +0000)]
Fix build by replacing '>>' with '> >'

llvm-svn: 186276

11 years agoAdd missing include guards into headers in lib/Headers. While it may appear
Richard Smith [Sun, 14 Jul 2013 05:41:45 +0000 (05:41 +0000)]
Add missing include guards into headers in lib/Headers. While it may appear
that these headers should not be included more than once, they are in fact
included twice when building our builtins module (in order for it to generate
submodules for them), and without this, any modular build enabling AVX and
including any builtin header fails.

Testing this is tricky because including any of these headers in a modular
build is liable to fail, due to unrelated builtin headers in the same module
including headers which might not be available on the system running the tests.
Suggestion on that front are welcome (but we're getting close to being able to
run a buildbot that has modules enabled for all tests, which would nicely solve
the testing problem).

llvm-svn: 186275

11 years agoUse SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.
Craig Topper [Sun, 14 Jul 2013 04:42:23 +0000 (04:42 +0000)]
Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.

llvm-svn: 186274

11 years agoRemove a bunch of old SCEVExpander FIXME's for preserving NoWrap.
Andrew Trick [Sun, 14 Jul 2013 03:10:08 +0000 (03:10 +0000)]
Remove a bunch of old SCEVExpander FIXME's for preserving NoWrap.

The great thing about the SCEVAddRec No-Wrap flag (unlike nsw/nuw) is
that is can be preserved while normalizing (reassociating and
factoring).

The bad thing is that is can't be tranfered back to IR, which is one
of the reasons I don't like the concept of SCEVExpander.

Sorry, I can't think of a direct way to test this, which is why these
were FIXMEs for so long. I just think it's a good time to finally
clean it up.

llvm-svn: 186273

11 years agoTeach indvars to generate nsw/nuw flags when widening an induction variable.
Andrew Trick [Sun, 14 Jul 2013 02:50:07 +0000 (02:50 +0000)]
Teach indvars to generate nsw/nuw flags when widening an induction variable.

Fixes PR16600.

llvm-svn: 186272

11 years agoFixup to r186268 and r186269: don't append -LABEL to CHECK-NOT. No functionality...
Stephen Lin [Sun, 14 Jul 2013 02:10:57 +0000 (02:10 +0000)]
Fixup to r186268 and r186269: don't append -LABEL to CHECK-NOT. No functionality change.

llvm-svn: 186271

11 years agoIf an unimported submodule of an imported module contains a declaration of a
Richard Smith [Sun, 14 Jul 2013 02:01:48 +0000 (02:01 +0000)]
If an unimported submodule of an imported module contains a declaration of a
global allocation or deallocation function, that should not cause that global
allocation or deallocation function to become unavailable.

llvm-svn: 186270

11 years agoCatch more CHECK that can be converted to CHECK-LABEL in Transforms for easier debugg...
Stephen Lin [Sun, 14 Jul 2013 01:50:49 +0000 (01:50 +0000)]
Catch more CHECK that can be converted to CHECK-LABEL in Transforms for easier debugging. No functionality change.

This conversion was done with the following bash script:

  find test/Transforms -name "*.ll" | \
  while read NAME; do
    echo "$NAME"
    if ! grep -q "^; *RUN: *llc" $NAME; then
      TEMP=`mktemp -t temp`
      cp $NAME $TEMP
      sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \
      while read FUNC; do
        sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)define\([^@]*\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3define\4@$FUNC(/g" $TEMP
      done
      mv $TEMP $NAME
    fi
  done

llvm-svn: 186269

11 years agoUpdate Transforms tests to use CHECK-LABEL for easier debugging. No functionality...
Stephen Lin [Sun, 14 Jul 2013 01:42:54 +0000 (01:42 +0000)]
Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change.

This update was done with the following bash script:

  find test/Transforms -name "*.ll" | \
  while read NAME; do
    echo "$NAME"
    if ! grep -q "^; *RUN: *llc" $NAME; then
      TEMP=`mktemp -t temp`
      cp $NAME $TEMP
      sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \
      while read FUNC; do
        sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3@$FUNC(/g" $TEMP
      done
      mv $TEMP $NAME
    fi
  done

llvm-svn: 186268

11 years agoModify two Transforms tests to explicitly check for full function names in some cases...
Stephen Lin [Sun, 14 Jul 2013 01:38:19 +0000 (01:38 +0000)]
Modify two Transforms tests to explicitly check for full function names in some cases, rather than just a common prefix. No functionality change.

(This is to avoid confusing a scripted mass update of these tests to use CHECK-LABEL)

llvm-svn: 186267

11 years agoSerialization support for TagDecl::IsCompleteDefinitionRequired
David Blaikie [Sun, 14 Jul 2013 01:07:41 +0000 (01:07 +0000)]
Serialization support for TagDecl::IsCompleteDefinitionRequired

Requested by Richard Smith in post-commit review of r186262

llvm-svn: 186266

11 years agoInitialize the "IsCompleteDefinitionRequired" field in the ASTContext ctor
David Blaikie [Sat, 13 Jul 2013 22:29:32 +0000 (22:29 +0000)]
Initialize the "IsCompleteDefinitionRequired" field in the ASTContext ctor

Introduced in r186262 & found by the hexagon buildbots (but owing to
this being UB, that's random chance - so there's no additional test case
here)

llvm-svn: 186265

11 years agoConvert Windows to Unix line endings, no functionality change.
Stephen Lin [Sat, 13 Jul 2013 22:08:55 +0000 (22:08 +0000)]
Convert Windows to Unix line endings, no functionality change.

llvm-svn: 186264

11 years agoAdd newlines at end of test files, no functionality change
Stephen Lin [Sat, 13 Jul 2013 22:00:58 +0000 (22:00 +0000)]
Add newlines at end of test files, no functionality change

llvm-svn: 186263

11 years agoPR16214, PR14467: DebugInfo: use "RequireCompleteType" to decide when to emit the...
David Blaikie [Sat, 13 Jul 2013 21:08:14 +0000 (21:08 +0000)]
PR16214, PR14467: DebugInfo: use "RequireCompleteType" to decide when to emit the full definition of a type in -flimit-debug-info

This simplifies the core benefit of -flimit-debug-info by taking a more
systematic approach to avoid emitting debug info definitions for types
that only require declarations. The previous ad-hoc approach (3 cases
removed in this patch) had many holes.

The general approach (adding a bit to TagDecl and callback through
ASTConsumer) has been discussed with Richard Smith - though always open
to revision.

llvm-svn: 186262

11 years agoCorrectly classify pack expansions as NON_CANONICAL_UNLESS_DEPENDENT
David Blaikie [Sat, 13 Jul 2013 21:08:08 +0000 (21:08 +0000)]
Correctly classify pack expansions as NON_CANONICAL_UNLESS_DEPENDENT

Test coverage for non-dependent pack expansions doesn't demonstrate a
failure prior to this patch (a follow-up commit improving debug info
will cover this commit specifically) but covers a related hole in our
test coverage.

Reviewed by Richard Smith & Eli Friedman.

llvm-svn: 186261

11 years agoSimplify getTypeInfoImpl handling of 'non-canonical unless dependent' types.
David Blaikie [Sat, 13 Jul 2013 21:08:03 +0000 (21:08 +0000)]
Simplify getTypeInfoImpl handling of 'non-canonical unless dependent' types.

These types are not dependent in this context, so just look through
the sugar.

Review by Richard Smith & Eli Friedman.

llvm-svn: 186260

11 years agoScopInfo: Add getTupe() method to MemoryAccess
Tobias Grosser [Sat, 13 Jul 2013 20:41:24 +0000 (20:41 +0000)]
ScopInfo: Add getTupe() method to MemoryAccess

We also move the enum to UPPERCASE.

llvm-svn: 186259

11 years agoConvert CodeGen/*/*.ll tests to use the new CHECK-LABEL for easier debugging. No...
Stephen Lin [Sat, 13 Jul 2013 20:38:47 +0000 (20:38 +0000)]
Convert CodeGen/*/*.ll tests to use the new CHECK-LABEL for easier debugging. No functionality change and all tests pass after conversion.

This was done with the following sed invocation to catch label lines demarking function boundaries:
    sed -i '' "s/^;\( *\)\([A-Z0-9_]*\):\( *\)test\([A-Za-z0-9_-]*\):\( *\)$/;\1\2-LABEL:\3test\4:\5/g" test/CodeGen/*/*.ll
which was written conservatively to avoid false positives rather than false negatives. I scanned through all the changes and everything looks correct.

llvm-svn: 186258