platform/upstream/llvm.git
10 years agoUpdate isl to ensure 'extern "C" {' is available
Tobias Grosser [Mon, 10 Mar 2014 13:46:52 +0000 (13:46 +0000)]
Update isl to ensure 'extern "C" {' is available

Older isl versions did not properly guard all function declarations for the
use in C++. Specifically, the isl/val_gmp.h header was not properly guarded.
This patch ensures we have the proper guards in place and do not accidentally
link to name-mangled C++ versions of those functions that are not available in
libisl.so.

llvm-svn: 203462

10 years agoReverting llvm::distance changes to use std::distance with iterators instead, per...
Aaron Ballman [Mon, 10 Mar 2014 13:43:55 +0000 (13:43 +0000)]
Reverting llvm::distance changes to use std::distance with iterators instead, per post-commit review feedback.

Replacing llvm::copy changes with SmallVector range-based construction which is a considerably cleaner approach.

llvm-svn: 203461

10 years agoRemoving llvm::distance and llvm::copy for iterator_range based on post-commit review...
Aaron Ballman [Mon, 10 Mar 2014 13:43:46 +0000 (13:43 +0000)]
Removing llvm::distance and llvm::copy for iterator_range based on post-commit review feedback. Adding an explicit range-based constructor to SmallVector, which supersedes the llvm::copy functionality.

llvm-svn: 203460

10 years ago[mips] Assembly parser must invoke the target streamer to handle .set reorder macro.
Matheus Almeida [Mon, 10 Mar 2014 13:21:10 +0000 (13:21 +0000)]
[mips] Assembly parser must invoke the target streamer to handle .set reorder macro.

llvm-svn: 203459

10 years agoPreserve hanging indent when breaking line comments.
Alexander Kornienko [Mon, 10 Mar 2014 13:14:56 +0000 (13:14 +0000)]
Preserve hanging indent when breaking line comments.

Summary:
If we need to break the second line here:
// something: aaaaa aaaaa aaaaaa aaaaa aaaaa
//            aaaaa aaaaa aaaaaa aaaaa aaaaa aaaaa

with the patch it will be turned to

// something: aaaaa aaaaa aaaaaa aaaaa aaaaa
//            aaaaa aaaaa aaaaaa aaaaa aaaaa
//            aaaaa

instead of

// something: aaaaa aaaaa aaaaaa aaaaa aaaaa
//            aaaaa aaaaa aaaaaa aaaaa aaaaa
// aaaaa

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2988

llvm-svn: 203458

10 years agoUse DiagnosticRenderer to convert clang diagnostics to clang-tidy ones.
Alexander Kornienko [Mon, 10 Mar 2014 13:11:17 +0000 (13:11 +0000)]
Use DiagnosticRenderer to convert clang diagnostics to clang-tidy ones.

Summary:
This is immediately useful for generating macro expansion notes, and
may be useful for other things later on.

Reviewers: klimek, djasper

Reviewed By: klimek

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

llvm-svn: 203457

10 years agowww: Fix link to Pluto
Tobias Grosser [Mon, 10 Mar 2014 12:28:20 +0000 (12:28 +0000)]
www: Fix link to Pluto

llvm-svn: 203456

10 years agoMake __LITTLE_ENDIAN__/__BIG_ENDOAN__ common PredefinedMacros
Robert Lytton [Mon, 10 Mar 2014 12:06:29 +0000 (12:06 +0000)]
Make __LITTLE_ENDIAN__/__BIG_ENDOAN__ common PredefinedMacros

llvm-svn: 203455

10 years agoclang-format: Add spaces around trailing/lambda return types.
Daniel Jasper [Mon, 10 Mar 2014 10:02:02 +0000 (10:02 +0000)]
clang-format: Add spaces around trailing/lambda return types.

Before:
  int c = []()->int { return 2; }();

After:
  int c = []() -> int { return 2; }();

llvm-svn: 203452

10 years agoDeduplicate clang-tidy error messages by file, offset and message.
Alexander Kornienko [Mon, 10 Mar 2014 09:45:49 +0000 (09:45 +0000)]
Deduplicate clang-tidy error messages by file, offset and message.

Summary: Peter, I guess, this can help you in testing your check.

Reviewers: djasper, pcc, klimek

Reviewed By: klimek

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

llvm-svn: 203451

10 years agoAArch64: fix LowerCONCAT_VECTORS for new CodeGen.
Tim Northover [Mon, 10 Mar 2014 09:34:07 +0000 (09:34 +0000)]
AArch64: fix LowerCONCAT_VECTORS for new CodeGen.

The function was making too many assumptions about its input:

1. The NEON_VDUP optimisation was far too aggressive, assuming (I
think) that the input would always be BUILD_VECTOR.

2. We were treating most unknown concats as legal (by returning Op
rather than SDValue()). I think only concats of pairs of vectors are
actually legal.

http://llvm.org/PR19094

llvm-svn: 203450

10 years agoCorrectly add the QueueID to a pending block's extended thread backtrace thread.
Jason Molenda [Mon, 10 Mar 2014 08:42:03 +0000 (08:42 +0000)]
Correctly add the QueueID to a pending block's extended thread backtrace thread.
Seed the QueueItem objects with the item_refs and addresses when they are fetched
in one batch.  If additional information is needed from the QueueItem, fetch it
lazily one pending item per function call.
<rdar://problem/16270007>, <rdar://problem/16032150>

llvm-svn: 203449

10 years ago[LCG] Make this call graph a fully regular type by giving it assignment
Chandler Carruth [Mon, 10 Mar 2014 08:08:59 +0000 (08:08 +0000)]
[LCG] Make this call graph a fully regular type by giving it assignment
as well. I don't see any particular need but it imposes no cost to
support it and it makes the API cleaner.

llvm-svn: 203448

10 years ago[LCG] Make the iterator move constructable (and thus movable in general)
Chandler Carruth [Mon, 10 Mar 2014 08:08:47 +0000 (08:08 +0000)]
[LCG] Make the iterator move constructable (and thus movable in general)
now that there is essentially no cost to doing so. Yay C++11.

llvm-svn: 203447

10 years agoclang/test/Index/preamble-reparse-warn-*.c: Stabilize on win32.
NAKAMURA Takumi [Mon, 10 Mar 2014 06:02:13 +0000 (06:02 +0000)]
clang/test/Index/preamble-reparse-warn-*.c: Stabilize on win32.

llvm-svn: 203446

10 years agoclang/test/Index/preamble-reparse-warn-*.c: Use @LINE in FileCheck.
NAKAMURA Takumi [Mon, 10 Mar 2014 06:02:03 +0000 (06:02 +0000)]
clang/test/Index/preamble-reparse-warn-*.c: Use @LINE in FileCheck.

llvm-svn: 203445

10 years ago[C++11] Remove 'virtual' keyword from methods marked with 'override' keyword.
Craig Topper [Mon, 10 Mar 2014 05:29:18 +0000 (05:29 +0000)]
[C++11] Remove 'virtual' keyword from methods marked with 'override' keyword.

llvm-svn: 203444

10 years agoFix bug I introduced (enabling implicit conversions from compare function to map...
Marshall Clow [Mon, 10 Mar 2014 04:50:10 +0000 (04:50 +0000)]
Fix bug I introduced (enabling implicit conversions from compare function to map) in r202994. Thanks to Sebastian Redl for the catch.

llvm-svn: 203443

10 years ago[C++11] Remove 'virtual' keyword from methods marked with 'override' keyword.
Craig Topper [Mon, 10 Mar 2014 03:53:12 +0000 (03:53 +0000)]
[C++11] Remove 'virtual' keyword from methods marked with 'override' keyword.

llvm-svn: 203442

10 years ago[AArch64] Fix a use of uninitialized memory introduced in r203125,
Chandler Carruth [Mon, 10 Mar 2014 03:52:47 +0000 (03:52 +0000)]
[AArch64] Fix a use of uninitialized memory introduced in r203125,
and caught by the MSan bootstrap build bot. This should hopefully get
the bot green at long last.

llvm-svn: 203441

10 years agoDe-virtualize a method since it doesn't override anything and isn't overridden itself.
Craig Topper [Mon, 10 Mar 2014 03:22:59 +0000 (03:22 +0000)]
De-virtualize a method since it doesn't override anything and isn't overridden itself.

llvm-svn: 203440

10 years ago[C++11] Add 'override' keyword to virtual methods that override their base class.
Craig Topper [Mon, 10 Mar 2014 03:19:03 +0000 (03:19 +0000)]
[C++11] Add 'override' keyword to virtual methods that override their base class.

llvm-svn: 203439

10 years ago[LCG] One more formatting fix that I failed to get into the prior
Chandler Carruth [Mon, 10 Mar 2014 02:50:21 +0000 (02:50 +0000)]
[LCG] One more formatting fix that I failed to get into the prior
commit. Sorry for the churn, just trying to keep it out of any
functionality changed.

llvm-svn: 203438

10 years ago[TTI] There is actually no realistic way to pop TTI implementations off
Chandler Carruth [Mon, 10 Mar 2014 02:45:14 +0000 (02:45 +0000)]
[TTI] There is actually no realistic way to pop TTI implementations off
the stack of the analysis group because they are all immutable passes.
This is made clear by Craig's recent work to use override
systematically -- we weren't overriding anything for 'finalizePass'
because there is no such thing.

This is kind of a lame restriction on the API -- we can no longer push
and pop things, we just set up the stack and run. However, I'm not
invested in building some better solution on top of the existing
(terrifying) immutable pass and legacy pass manager.

llvm-svn: 203437

10 years agoADT/PointerIntPairTest.cpp: Appease msc17.
NAKAMURA Takumi [Mon, 10 Mar 2014 02:33:17 +0000 (02:33 +0000)]
ADT/PointerIntPairTest.cpp: Appease msc17.

  - Use constructor instead of initializer list.
  - Disable ManyUnusedBits for now.

llvm-svn: 203436

10 years ago[LCG] Ran clang-format over this too and it pointed out some fixes.
Chandler Carruth [Mon, 10 Mar 2014 02:14:14 +0000 (02:14 +0000)]
[LCG] Ran clang-format over this too and it pointed out some fixes.

llvm-svn: 203435

10 years ago[PM] While I'm here, fix a few other clang-format issues. Pulls some
Chandler Carruth [Mon, 10 Mar 2014 02:12:14 +0000 (02:12 +0000)]
[PM] While I'm here, fix a few other clang-format issues. Pulls some
lines under 80-columns, etc.

llvm-svn: 203434

10 years ago[C++11] Add 'override' keyword to virtual methods that override their base class.
Craig Topper [Mon, 10 Mar 2014 02:09:33 +0000 (02:09 +0000)]
[C++11] Add 'override' keyword to virtual methods that override their base class.

llvm-svn: 203433

10 years ago[PM] Cleanup formatting and namespace commenting. Mostly done with
Chandler Carruth [Mon, 10 Mar 2014 01:42:03 +0000 (01:42 +0000)]
[PM] Cleanup formatting and namespace commenting. Mostly done with
clang-format, but with some modifications by me where it got things
wrong or got confused.

llvm-svn: 203432

10 years ago[PM] As Dave noticed in review, I had erroneously copied the move
Chandler Carruth [Mon, 10 Mar 2014 01:32:25 +0000 (01:32 +0000)]
[PM] As Dave noticed in review, I had erroneously copied the move
constructors from the classes which only have a single reference member
to many other places. This resulted in them copying their single member
instead of moving. =/ Fix this.

There's really not a useful test to add sadly because these move
constructors are only called when something deep inside some standard
library implementation *needs* to move them. Many of the types aren't
even user-impacting types. Or, the objects are copyable anyways and so
the result was merely a performance problem rather than a correctness
problem.

Anyways, thanks for the review. And this is a great example of why
I wish I colud have the compiler write these for me.

llvm-svn: 203431

10 years agoMC: Appease the buildbots
David Majnemer [Mon, 10 Mar 2014 01:04:18 +0000 (01:04 +0000)]
MC: Appease the buildbots

This is fallout from r203429.

llvm-svn: 203430

10 years agoMC: Cleanup MCSectionMachO::ParseSectionSpecifier
David Majnemer [Mon, 10 Mar 2014 00:55:07 +0000 (00:55 +0000)]
MC: Cleanup MCSectionMachO::ParseSectionSpecifier

Split by comma once instead of multiple times.  Moving this upfront
makes the rest of the code considerably simpler.

No functional change.

llvm-svn: 203429

10 years ago[PM] Add a comment I missed and add the special members to one more
Chandler Carruth [Mon, 10 Mar 2014 00:54:01 +0000 (00:54 +0000)]
[PM] Add a comment I missed and add the special members to one more
class that might (at some point) need them.

llvm-svn: 203428

10 years ago[PM] Comment on all of the totally pointless definitions of special
Chandler Carruth [Mon, 10 Mar 2014 00:50:56 +0000 (00:50 +0000)]
[PM] Comment on all of the totally pointless definitions of special
members as being te workaround MSVC.

llvm-svn: 203427

10 years ago[PM] I have been educated by several folks that MSVC will never
Chandler Carruth [Mon, 10 Mar 2014 00:35:47 +0000 (00:35 +0000)]
[PM] I have been educated by several folks that MSVC will never
synthesize a move constructor. Thus, for any types where move semantics
are important (yea, that's essentially every type...) you must
explicitly define the special members. Do so systematically throughout
the pass manager as the core of the design relies heavily on move
semantics.

This will hopefully fix the build with MSVC 2013. We still don't know
why MSVC 2012 accepted this code, but it almost certainly wasn't doing
the right thing.

I've also added explicit to a few single-argument constructors spotted
in passing.

llvm-svn: 203426

10 years agoWhen a type's definition is instantiated, the definition becomes visible, even
Richard Smith [Mon, 10 Mar 2014 00:04:29 +0000 (00:04 +0000)]
When a type's definition is instantiated, the definition becomes visible, even
if the type's declaration was previously instantiated in an unimported module.
(For an imported type definition, this already worked, because the source
location is set to the location of the definition, but for locally-instantiated
type definitions, it did not.)

llvm-svn: 203425

10 years ago[Sparc] Add support for decoding 'swap' instruction.
Venkatraman Govindaraju [Sun, 9 Mar 2014 23:32:07 +0000 (23:32 +0000)]
[Sparc] Add support for decoding 'swap' instruction.

llvm-svn: 203424

10 years agoFix inconsistent whitespace.
Bob Wilson [Sun, 9 Mar 2014 23:17:28 +0000 (23:17 +0000)]
Fix inconsistent whitespace.

llvm-svn: 203423

10 years agoRemove trailing whitespace.
Bob Wilson [Sun, 9 Mar 2014 23:02:27 +0000 (23:02 +0000)]
Remove trailing whitespace.

llvm-svn: 203422

10 years agolibBacktraceRecording __introspection_dispatch_queue_get_pending_items is
Jason Molenda [Sun, 9 Mar 2014 21:17:08 +0000 (21:17 +0000)]
libBacktraceRecording __introspection_dispatch_queue_get_pending_items is
changing the data it returns; this change accepts either the old format or
the new format.  It doesn't yet benefit from the new format's additions -
but I need to get this checked in so we aren't rev-locked.
Also add a missing .i entry for SBQueue::GetNumRunningItems() missing from
the last checkin.
<rdar://problem/16272115>

llvm-svn: 203421

10 years agoSBQueue::GetNumPendingItems() should not force a fetch of the pending
Jason Molenda [Sun, 9 Mar 2014 19:41:30 +0000 (19:41 +0000)]
SBQueue::GetNumPendingItems() should not force a fetch of the pending
items; the backing Queue object has the number of pending items
already cached.  Also, add SBQueue::GetNumRunningItems() to provide
that information.
<rdar://problem/16272016>

llvm-svn: 203420

10 years agoWork around FreeBSD rtld rpath $ORIGIN limitation
Ed Maste [Sun, 9 Mar 2014 18:48:45 +0000 (18:48 +0000)]
Work around FreeBSD rtld rpath $ORIGIN limitation

FreeBSD's rtld requires the DF_ORIGIN flag set in order to process
$ORIGIN in rpath.

FreeBSD bug http://bugs.freebsd.org/187114

llvm-svn: 203419

10 years ago[C++11] Add 'override' keyword to virtual methods that override their base class.
Craig Topper [Sun, 9 Mar 2014 18:03:14 +0000 (18:03 +0000)]
[C++11] Add 'override' keyword to virtual methods that override their base class.

llvm-svn: 203418

10 years agoTab to spaces. No functionality change.
Nick Lewycky [Sun, 9 Mar 2014 17:09:28 +0000 (17:09 +0000)]
Tab to spaces. No functionality change.

llvm-svn: 203417

10 years agoFix uninitialized value in AttributedTypeLoc.
Logan Chien [Sun, 9 Mar 2014 16:21:03 +0000 (16:21 +0000)]
Fix uninitialized value in AttributedTypeLoc.

Clang might crash while reading the precompiled headers if
we don't initialize the AttrEnumOperandLoc properly.

This commit fixes the combination of string attribute
operand and enum operand.  Besides, this commit also adds
several assertions to avoid unexpected operand kind.

llvm-svn: 203416

10 years agoStackColoring: Use range-based for loops.
Benjamin Kramer [Sun, 9 Mar 2014 15:44:45 +0000 (15:44 +0000)]
StackColoring: Use range-based for loops.

No functionality change.

llvm-svn: 203415

10 years agoMachineModuleInfo: Turn nested std::pairs into a proper struct.
Benjamin Kramer [Sun, 9 Mar 2014 15:44:39 +0000 (15:44 +0000)]
MachineModuleInfo: Turn nested std::pairs into a proper struct.

llvm-svn: 203414

10 years agoSimplifyCFG: Simplify the weight scaling algorithm.
Benjamin Kramer [Sun, 9 Mar 2014 14:42:55 +0000 (14:42 +0000)]
SimplifyCFG: Simplify the weight scaling algorithm.

No change in functionality.

llvm-svn: 203413

10 years ago[Mips] Fix addendum reading for R_MIPS_26 relocation.
Simon Atanasyan [Sun, 9 Mar 2014 13:20:01 +0000 (13:20 +0000)]
[Mips] Fix addendum reading for R_MIPS_26 relocation.

llvm-svn: 203412

10 years ago[Mips] Fix addendum reading for R_MIPS_32 relocation.
Simon Atanasyan [Sun, 9 Mar 2014 13:19:54 +0000 (13:19 +0000)]
[Mips] Fix addendum reading for R_MIPS_32 relocation.

llvm-svn: 203411

10 years ago[Mips] Fix addendum reading for R_MIPS_HI16 / R_MIPS_LO16 relocations.
Simon Atanasyan [Sun, 9 Mar 2014 13:19:46 +0000 (13:19 +0000)]
[Mips] Fix addendum reading for R_MIPS_HI16 / R_MIPS_LO16 relocations.

llvm-svn: 203410

10 years ago[Mips] Create ELF object reader for MIPS target.
Simon Atanasyan [Sun, 9 Mar 2014 13:19:36 +0000 (13:19 +0000)]
[Mips] Create ELF object reader for MIPS target.

llvm-svn: 203409

10 years ago[ELF] Factor out the code creates a Reference for the specified symbol
Simon Atanasyan [Sun, 9 Mar 2014 13:19:29 +0000 (13:19 +0000)]
[ELF] Factor out the code creates a Reference for the specified symbol
and relocation entry into the two virtual functions.

llvm-svn: 203408

10 years ago[Mips] Rename R_MIPS_26 relocation handling test case.
Simon Atanasyan [Sun, 9 Mar 2014 13:05:39 +0000 (13:05 +0000)]
[Mips] Rename R_MIPS_26 relocation handling test case.

llvm-svn: 203407

10 years ago[Mips] Remove redundant 'mips' prefix from names of MipsELFWriter class
Simon Atanasyan [Sun, 9 Mar 2014 13:05:33 +0000 (13:05 +0000)]
[Mips] Remove redundant 'mips' prefix from names of MipsELFWriter class
fields.

llvm-svn: 203406

10 years ago[Mips] Reduce the code indentation.
Simon Atanasyan [Sun, 9 Mar 2014 13:05:26 +0000 (13:05 +0000)]
[Mips] Reduce the code indentation.

llvm-svn: 203405

10 years ago[Mips] Change unused return type from 'bool' to 'void'.
Simon Atanasyan [Sun, 9 Mar 2014 13:05:20 +0000 (13:05 +0000)]
[Mips] Change unused return type from 'bool' to 'void'.

llvm-svn: 203404

10 years ago[Mips] Remove unnecessary LLVM_ATTRIBUTE_UNUSED attribute.
Simon Atanasyan [Sun, 9 Mar 2014 13:05:15 +0000 (13:05 +0000)]
[Mips] Remove unnecessary LLVM_ATTRIBUTE_UNUSED attribute.

llvm-svn: 203403

10 years ago[Mips] Do not inherit MipsDynamicLibraryWriter and MipsExecutableWriter
Simon Atanasyan [Sun, 9 Mar 2014 13:05:09 +0000 (13:05 +0000)]
[Mips] Do not inherit MipsDynamicLibraryWriter and MipsExecutableWriter
from MipsELFWriter class. MipsELFWriter is just a helper.

llvm-svn: 203402

10 years ago[Mips] Mark class by 'final' keyword.
Simon Atanasyan [Sun, 9 Mar 2014 13:05:03 +0000 (13:05 +0000)]
[Mips] Mark class by 'final' keyword.

llvm-svn: 203401

10 years ago[Mips] Remove redundant 'mips' prefix from names of MipsTargetHandler
Simon Atanasyan [Sun, 9 Mar 2014 13:04:56 +0000 (13:04 +0000)]
[Mips] Remove redundant 'mips' prefix from names of MipsTargetHandler
and MipsDynamicSymbolTable classes fields.

llvm-svn: 203400

10 years ago[Mips] Remove redundant call to the unique_ptr::get() method followed
Simon Atanasyan [Sun, 9 Mar 2014 13:04:50 +0000 (13:04 +0000)]
[Mips] Remove redundant call to the unique_ptr::get() method followed
by the returned pointer dereferencing.

llvm-svn: 203399

10 years ago[Mips] Remove unused class field.
Simon Atanasyan [Sun, 9 Mar 2014 13:04:45 +0000 (13:04 +0000)]
[Mips] Remove unused class field.

llvm-svn: 203398

10 years ago[C++11] Replacing some using declarations which are not supported on all compilers...
Aaron Ballman [Sun, 9 Mar 2014 12:59:45 +0000 (12:59 +0000)]
[C++11] Replacing some using declarations which are not supported on all compilers (such as MSVC 2012) with a less problematic typedef.

llvm-svn: 203397

10 years ago[C++11] Use std::unique_ptr for ownership in a vector.
Ahmed Charles [Sun, 9 Mar 2014 12:24:23 +0000 (12:24 +0000)]
[C++11] Use std::unique_ptr for ownership in a vector.

Also change to using range-based for loops. No functional change intended.

llvm-svn: 203396

10 years ago[LCG] Simplify a bunch of the LCG code with range for loops and auto.
Chandler Carruth [Sun, 9 Mar 2014 12:20:34 +0000 (12:20 +0000)]
[LCG] Simplify a bunch of the LCG code with range for loops and auto.
Still more work to be done here to leverage C++11, but this clears out
the glaring issues.

llvm-svn: 203395

10 years ago[C++11] Add range views for various parts of a Module.
Chandler Carruth [Sun, 9 Mar 2014 12:20:30 +0000 (12:20 +0000)]
[C++11] Add range views for various parts of a Module.

llvm-svn: 203394

10 years agoChange documentation based on feedback from Chandler.
Ahmed Charles [Sun, 9 Mar 2014 12:12:23 +0000 (12:12 +0000)]
Change documentation based on feedback from Chandler.

llvm-svn: 203393

10 years ago[C++11] Now that we have C++11 and I've replaced the use of this
Chandler Carruth [Sun, 9 Mar 2014 11:51:11 +0000 (11:51 +0000)]
[C++11] Now that we have C++11 and I've replaced the use of this
horrible smart pointer by std::unique_ptr and strict move semantics, rip
this out.

llvm-svn: 203392

10 years ago[PM] Switch new pass manager from polymorphic_ptr to unique_ptr now that
Chandler Carruth [Sun, 9 Mar 2014 11:49:53 +0000 (11:49 +0000)]
[PM] Switch new pass manager from polymorphic_ptr to unique_ptr now that
it is available. Also make the move semantics sufficiently correct to
tolerate move-only passes, as the PassManagers *are* move-only passes.

llvm-svn: 203391

10 years agoFix build break, replace take() with release().
Ahmed Charles [Sun, 9 Mar 2014 11:46:32 +0000 (11:46 +0000)]
Fix build break, replace take() with release().

llvm-svn: 203390

10 years ago[C++11] Replace OwningPtr include with <memory>.
Ahmed Charles [Sun, 9 Mar 2014 11:36:40 +0000 (11:36 +0000)]
[C++11] Replace OwningPtr include with <memory>.

llvm-svn: 203389

10 years ago[C++11] Remove the remaining uses of OwningPtr.
Ahmed Charles [Sun, 9 Mar 2014 11:34:25 +0000 (11:34 +0000)]
[C++11] Remove the remaining uses of OwningPtr.

Replace OwningArrayPtr with std::unique_ptr<T[]>.

llvm-svn: 203388

10 years ago[C++11] Add llvm::make_unique, according to N3656.
Ahmed Charles [Sun, 9 Mar 2014 11:20:17 +0000 (11:20 +0000)]
[C++11] Add llvm::make_unique, according to N3656.

llvm-svn: 203387

10 years agoRevert r203230, "CodeGenPrep: sink extends of illegal types into use block."
NAKAMURA Takumi [Sun, 9 Mar 2014 11:01:07 +0000 (11:01 +0000)]
Revert r203230, "CodeGenPrep: sink extends of illegal types into use block."

It choked i686 stage2.

llvm-svn: 203386

10 years agoFix unwind_plan test conditions (could result in NULL memory access).
Virgile Bello [Sun, 9 Mar 2014 10:01:25 +0000 (10:01 +0000)]
Fix unwind_plan test conditions (could result in NULL memory access).

llvm-svn: 203385

10 years agoPlatformWindows: Fix ObjectFile presence test conditions (could result in NULL memory...
Virgile Bello [Sun, 9 Mar 2014 10:00:40 +0000 (10:00 +0000)]
PlatformWindows: Fix ObjectFile presence test conditions (could result in NULL memory access)

llvm-svn: 203384

10 years agoImplement ObjectFilePECOFF::GetModuleSpecifications().
Virgile Bello [Sun, 9 Mar 2014 09:59:36 +0000 (09:59 +0000)]
Implement ObjectFilePECOFF::GetModuleSpecifications().

llvm-svn: 203383

10 years ago[C++11] Replace OwningPtr with std::unique_ptr.
Ahmed Charles [Sun, 9 Mar 2014 09:24:40 +0000 (09:24 +0000)]
[C++11] Replace OwningPtr with std::unique_ptr.

This removes all references to OwningPtr, which should be fairly
undisruptive to out-of-tree projects since they are unlikely to use
clang-tools-extra as a library instead of a set of tools.

llvm-svn: 203382

10 years ago[C++11] Update to reflect the Value::use_iterator and
Chandler Carruth [Sun, 9 Mar 2014 08:29:29 +0000 (08:29 +0000)]
[C++11] Update to reflect the Value::use_iterator and
Value::user_iterator changes in LLVM r203364. Converts several of these
loops to nice range based loops in the process.

Built and tested cleanly for me, yay for being able to fully build and
test Polly changes!

llvm-svn: 203381

10 years ago[-Wunreachable-code] Handle Objective-C bool literals in 'isConfigurationValue'.
Ted Kremenek [Sun, 9 Mar 2014 08:13:49 +0000 (08:13 +0000)]
[-Wunreachable-code] Handle Objective-C bool literals in 'isConfigurationValue'.

This includes special casing 'YES' and 'NO', which are constants
defined as macros.

llvm-svn: 203380

10 years agoDe-virtualize some methods since they don't override anything.
Craig Topper [Sun, 9 Mar 2014 07:58:15 +0000 (07:58 +0000)]
De-virtualize some methods since they don't override anything.

llvm-svn: 203379

10 years ago[C++11] Add 'override' keyword to virtual methods that override their base class.
Craig Topper [Sun, 9 Mar 2014 07:44:38 +0000 (07:44 +0000)]
[C++11] Add 'override' keyword to virtual methods that override their base class.

llvm-svn: 203378

10 years agoUpdate clang to account for changes made to LLVM in r203376
David Majnemer [Sun, 9 Mar 2014 07:09:06 +0000 (07:09 +0000)]
Update clang to account for changes made to LLVM in r203376

llvm-svn: 203377

10 years agoIR: Change inalloca's grammar a bit
David Majnemer [Sun, 9 Mar 2014 06:41:58 +0000 (06:41 +0000)]
IR: Change inalloca's grammar a bit

The grammar for LLVM IR is not well specified in any document but seems
to obey the following rules:

 - Attributes which have parenthesized arguments are never preceded by
   commas.  This form of attribute is the only one which ever has
   optional arguments.  However, not all of these attributes support
   optional arguments: 'thread_local' supports an optional argument but
   'addrspace' does not.  Interestingly, 'addrspace' is documented as
   being a "qualifier".  What constitutes a qualifier?  I cannot find a
   definition.

 - Some attributes use a space between the keyword and the value.
   Examples of this form are 'align' and 'section'.  These are always
   preceded by a comma.

 - Otherwise, the attribute has no argument.  These attributes do not
   have a preceding comma.

Sometimes an attribute goes before the instruction, between the
instruction and it's type, or after it's type.  'atomicrmw' has
'volatile' between the instruction and the type while 'call' has 'tail'
preceding the instruction.

With all this in mind, it seems most consistent for 'inalloca' on an
'inalloca' instruction to occur before between the instruction and the
type.  Unlike the current formulation, there would be no preceding
comma.  The combination 'alloca inalloca' doesn't look particularly
appetizing, perhaps a better spelling of 'inalloca' is down the road.

llvm-svn: 203376

10 years agoRevert "Clean up SmallString a bit"
David Blaikie [Sun, 9 Mar 2014 06:22:58 +0000 (06:22 +0000)]
Revert "Clean up SmallString a bit"

This reverts commit r203374.

Ambiguities in assign... oh well. I'm just going to revert this and
probably not try to recommit it as it's not terribly important.

llvm-svn: 203375

10 years agoClean up SmallString a bit
David Blaikie [Sun, 9 Mar 2014 06:17:01 +0000 (06:17 +0000)]
Clean up SmallString a bit

Move a common utility (assign(iter, iter)) into SmallVector (some of the
others could be moved there too, but this one seemed particularly
generic) and replace repetitions overrides with using directives.

And simplify SmallVector::assign(num, element) while I'm here rather
than thrashing these files (that cause everyone to rebuild) again.

llvm-svn: 203374

10 years agoRemove uses of SmallString::equals in favor of SmallVectorImpl<char>'s operator==
David Blaikie [Sun, 9 Mar 2014 05:18:27 +0000 (05:18 +0000)]
Remove uses of SmallString::equals in favor of SmallVectorImpl<char>'s operator==

llvm-svn: 203373

10 years ago[Sema] Fix assertion hit with #pragma weak.
Argyrios Kyrtzidis [Sun, 9 Mar 2014 05:15:28 +0000 (05:15 +0000)]
[Sema] Fix assertion hit with #pragma weak.

rdar://16264844

llvm-svn: 203372

10 years ago[C++11] Fix break due to MSVC bug.
Ahmed Charles [Sun, 9 Mar 2014 04:57:09 +0000 (04:57 +0000)]
[C++11] Fix break due to MSVC bug.

MSVC (2012, 2013, 2013 Nov CTP) fail on the following code:

int main() {
  int arr[] = {1, 2};
  for (int i : arr)
    do {} while (0);
}

The fix is to put {} around the for loop. I've reported this to the MSVC
team.

llvm-svn: 203371

10 years ago[libclang] Don't pad the main buffer for the preamble.
Argyrios Kyrtzidis [Sun, 9 Mar 2014 04:24:57 +0000 (04:24 +0000)]
[libclang] Don't pad the main buffer for the preamble.

Padding does not seem to be useful currently, and it leads to bogus location if an error
points to the end of the file.

rdar://15836513

llvm-svn: 203370

10 years agoclang-tools-extra/test/pp-trace/pp-trace-modules.cpp: Flush module cache to let robus...
NAKAMURA Takumi [Sun, 9 Mar 2014 04:10:17 +0000 (04:10 +0000)]
clang-tools-extra/test/pp-trace/pp-trace-modules.cpp: Flush module cache to let robust around r203317.

llvm-svn: 203369

10 years agoclang-tools-extra/test/pp-trace/pp-trace-modules.cpp: Use [[@LINE]].
NAKAMURA Takumi [Sun, 9 Mar 2014 04:10:05 +0000 (04:10 +0000)]
clang-tools-extra/test/pp-trace/pp-trace-modules.cpp: Use [[@LINE]].

llvm-svn: 203368

10 years agoretain-comments-from-system-headers.c: Flush module cache, or incremental test would...
NAKAMURA Takumi [Sun, 9 Mar 2014 03:56:18 +0000 (03:56 +0000)]
retain-comments-from-system-headers.c: Flush module cache, or incremental test would fail since r203317.

llvm-svn: 203367

10 years agoFix build break.
Ahmed Charles [Sun, 9 Mar 2014 03:50:36 +0000 (03:50 +0000)]
Fix build break.

llvm-svn: 203366

10 years ago[C++11] Update Clang for the change to LLVM's Use-Def chain iterators in
Chandler Carruth [Sun, 9 Mar 2014 03:16:50 +0000 (03:16 +0000)]
[C++11] Update Clang for the change to LLVM's Use-Def chain iterators in
r203364: what was use_iterator is now user_iterator, and there is
a use_iterator for directly iterating over the uses.

This also switches to use the range-based APIs where appropriate.

llvm-svn: 203365

10 years ago[C++11] Add range based accessors for the Use-Def chain of a Value.
Chandler Carruth [Sun, 9 Mar 2014 03:16:01 +0000 (03:16 +0000)]
[C++11] Add range based accessors for the Use-Def chain of a Value.

This requires a number of steps.
1) Move value_use_iterator into the Value class as an implementation
   detail
2) Change it to actually be a *Use* iterator rather than a *User*
   iterator.
3) Add an adaptor which is a User iterator that always looks through the
   Use to the User.
4) Wrap these in Value::use_iterator and Value::user_iterator typedefs.
5) Add the range adaptors as Value::uses() and Value::users().
6) Update *all* of the callers to correctly distinguish between whether
   they wanted a use_iterator (and to explicitly dig out the User when
   needed), or a user_iterator which makes the Use itself totally
   opaque.

Because #6 requires churning essentially everything that walked the
Use-Def chains, I went ahead and added all of the range adaptors and
switched them to range-based loops where appropriate. Also because the
renaming requires at least churning every line of code, it didn't make
any sense to split these up into multiple commits -- all of which would
touch all of the same lies of code.

The result is still not quite optimal. The Value::use_iterator is a nice
regular iterator, but Value::user_iterator is an iterator over User*s
rather than over the User objects themselves. As a consequence, it fits
a bit awkwardly into the range-based world and it has the weird
extra-dereferencing 'operator->' that so many of our iterators have.
I think this could be fixed by providing something which transforms
a range of T&s into a range of T*s, but that *can* be separated into
another patch, and it isn't yet 100% clear whether this is the right
move.

However, this change gets us most of the benefit and cleans up
a substantial amount of code around Use and User. =]

llvm-svn: 203364

10 years ago[-Wunreachable-code] Tweak heuristic for configuration values to include arithmetic...
Ted Kremenek [Sat, 8 Mar 2014 23:20:11 +0000 (23:20 +0000)]
[-Wunreachable-code] Tweak heuristic for configuration values to include arithmetic operations involving sizeof(), but not raw integers.

This case was motivated by a false positive with the
llvm::AlignOf<> specialization in LLVM.

llvm-svn: 203363

10 years ago[C++11] Replacing Decl iterators attr_begin() and attr_end() with iterator_range...
Aaron Ballman [Sat, 8 Mar 2014 22:19:01 +0000 (22:19 +0000)]
[C++11] Replacing Decl iterators attr_begin() and attr_end() with iterator_range attrs(). Updating all of the usages of the iterators with range-based for loops.

This is a reapplication of r203236 with modifications to the definition of attrs() and following the new style guidelines on auto usage.

llvm-svn: 203362

10 years agoUpdate comment from r203315 based on review
Adam Nemet [Sat, 8 Mar 2014 21:51:55 +0000 (21:51 +0000)]
Update comment from r203315 based on review

llvm-svn: 203361