platform/upstream/llvm.git
11 years agoReplace archive members in the old position.
Rafael Espindola [Mon, 22 Jul 2013 15:11:51 +0000 (15:11 +0000)]
Replace archive members in the old position.

This matches gnu archive behavior and since archive member order can change
which member is used, not changing the order on replacement looks like the
right thing to do.

This patch also refactors the logic for which archive member to keep and
whether to move it to a helper function (computeInsertAction). The
nesting in computeNewArchiveMembers was getting a bit confusing.

llvm-svn: 186829

11 years ago[ms-cxxabi] Emit linkonce complete dtors in TUs that need them
Reid Kleckner [Mon, 22 Jul 2013 13:51:44 +0000 (13:51 +0000)]
[ms-cxxabi] Emit linkonce complete dtors in TUs that need them

Based on Peter Collingbourne's destructor patches.

Prior to this change, clang was considering ?1 to be the complete
destructor and the base destructor, which was wrong.  This lead to
crashes when clang tried to emit two LLVM functions with the same name.

In this ABI, TUs with non-inline dtors might not emit a complete
destructor.  They are emitted as inline thunks in TUs that need them,
and they always delegate to the base dtors of the complete class and its
virtual bases.  This change uses the DeferredDecls machinery to emit
complete dtors as needed.

Currently in clang try body destructors can catch exceptions thrown by
virtual base destructors.  In the Microsoft C++ ABI, clang may not have
the destructor definition, in which case clang won't wrap the virtual
virtual base destructor calls in a try-catch.  Diagnosing this in user
code is TODO.

Finally, for classes that don't use virtual inheritance, MSVC always
calls the base destructor (?1) directly.  This is a useful code size
optimization that avoids emitting lots of extra thunks or aliases.
Implementing it also means our existing tests continue to pass, and is
consistent with MSVC's output.

We can do the same for Itanium by tweaking GetAddrOfCXXDestructor, but
it will require further testing.

Reviewers: rjmccall

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

llvm-svn: 186828

11 years agoRename D to GD to match the type, which is GlobalDecl
Reid Kleckner [Mon, 22 Jul 2013 13:07:10 +0000 (13:07 +0000)]
Rename D to GD to match the type, which is GlobalDecl

Now we can save GD.getDecl() in D and shorten some casts.

llvm-svn: 186826

11 years agoInstall git-clang-format along with clang-format by default.
Daniel Jasper [Mon, 22 Jul 2013 12:51:47 +0000 (12:51 +0000)]
Install git-clang-format along with clang-format by default.

llvm-svn: 186825

11 years agoForward declare OMPClause in Sema.h to avoid an include
Reid Kleckner [Mon, 22 Jul 2013 12:47:44 +0000 (12:47 +0000)]
Forward declare OMPClause in Sema.h to avoid an include

llvm-svn: 186824

11 years agoDon't depend on a llvm-ar specific behavior.
Rafael Espindola [Mon, 22 Jul 2013 12:41:04 +0000 (12:41 +0000)]
Don't depend on a llvm-ar specific behavior.

GNU ar when not given the a or b modifiers replaces archive members in the
same location of the old ones. I am about to implement that in llvm-ar. For
now, just don't depend on the current llvm-ar behavior on this test.

llvm-svn: 186823

11 years agoFactor out common string match code for POSIX log enable/disable
Ed Maste [Mon, 22 Jul 2013 12:39:17 +0000 (12:39 +0000)]
Factor out common string match code for POSIX log enable/disable

llvm-svn: 186822

11 years ago[lsan] Make __lsan_do_leak_check() honor the detect_leaks flag.
Sergey Matveev [Mon, 22 Jul 2013 12:38:17 +0000 (12:38 +0000)]
[lsan] Make __lsan_do_leak_check() honor the detect_leaks flag.

Also move detect_leaks to common flags.

llvm-svn: 186821

11 years ago[NVPTX] Use approximate FP ops when unsafe-fp-math is used, and append
Justin Holewinski [Mon, 22 Jul 2013 12:18:04 +0000 (12:18 +0000)]
[NVPTX] Use approximate FP ops when unsafe-fp-math is used, and append
.ftz to instructions if the nvptx-f32ftz attribute is set to "true"

llvm-svn: 186820

11 years ago[lsan] Print direct leaks first.
Sergey Matveev [Mon, 22 Jul 2013 11:18:32 +0000 (11:18 +0000)]
[lsan] Print direct leaks first.

Direct leaks are higher priority, so it makes sense to have them on top.

llvm-svn: 186819

11 years agoRevert "More Intel syntax alias fixes."
Tim Northover [Mon, 22 Jul 2013 11:02:32 +0000 (11:02 +0000)]
Revert "More Intel syntax alias fixes."

This reverts commit r186813, which broke the bots.

llvm-svn: 186818

11 years agoImplement the part of C89 6.5.7 p3 requiring a constant initializer list
Enea Zaffanella [Mon, 22 Jul 2013 10:58:26 +0000 (10:58 +0000)]
Implement the part of C89 6.5.7 p3 requiring a constant initializer list
when initializing aggregate/union types, no matter if static or not.

llvm-svn: 186817

11 years agoImprove clarity/consistency of a few UsingDecl methods and related helpers.
Enea Zaffanella [Mon, 22 Jul 2013 10:54:09 +0000 (10:54 +0000)]
Improve clarity/consistency of a few UsingDecl methods and related helpers.
No functionality change.

In Sema helper functions:
 * renamed isTypeName as HasTypenameKeyword
In UsingDecl:
 * renamed get/setUsingLocation to get/setUsingLoc
 * renamed is/setTypeName as has/setTypename

llvm-svn: 186816

11 years agoFix typo. Change %cl to CL in Intel pattern.
Craig Topper [Mon, 22 Jul 2013 10:07:26 +0000 (10:07 +0000)]
Fix typo. Change %cl to CL in Intel pattern.

llvm-svn: 186815

11 years agoMore Intel syntax alias fixes.
Craig Topper [Mon, 22 Jul 2013 09:58:07 +0000 (09:58 +0000)]
More Intel syntax alias fixes.

llvm-svn: 186814

11 years agoMore Intel syntax alias fixes.
Craig Topper [Mon, 22 Jul 2013 09:42:31 +0000 (09:42 +0000)]
More Intel syntax alias fixes.

llvm-svn: 186813

11 years agoChange %xmm0 to XMM0 in Intel side of asm strings for PBLENDVB.
Craig Topper [Mon, 22 Jul 2013 09:22:49 +0000 (09:22 +0000)]
Change %xmm0 to XMM0 in Intel side of asm strings for PBLENDVB.

llvm-svn: 186812

11 years agoAdd Intel variants to aliases for some FP instructions.
Craig Topper [Mon, 22 Jul 2013 09:18:43 +0000 (09:18 +0000)]
Add Intel variants to aliases for some FP instructions.

llvm-svn: 186811

11 years agoARM: remove now unneeded custom Asm converters
Tim Northover [Mon, 22 Jul 2013 09:06:12 +0000 (09:06 +0000)]
ARM: remove now unneeded custom Asm converters

After Ulrich's r180677 (thanks!) TableGen is intelligent enough to
handle tied constraints involving complex operands properly, so
virtually all of the ARM custom converters are now unnecessary.

llvm-svn: 186810

11 years agoReverse operands for Intel syntax form of 'bt' alias.
Craig Topper [Mon, 22 Jul 2013 07:47:51 +0000 (07:47 +0000)]
Reverse operands for Intel syntax form of 'bt' alias.

llvm-svn: 186809

11 years agoDelete unused helper functions.
Nadav Rotem [Mon, 22 Jul 2013 05:19:22 +0000 (05:19 +0000)]
Delete unused helper functions.

llvm-svn: 186808

11 years agoRemove superfluous cast.
Robert Wilhelm [Mon, 22 Jul 2013 05:04:01 +0000 (05:04 +0000)]
Remove superfluous cast.

llvm-svn: 186807

11 years agoRegisterPass: Unhide -polly-show and -polly-show-only
Tobias Grosser [Mon, 22 Jul 2013 04:11:00 +0000 (04:11 +0000)]
RegisterPass: Unhide -polly-show and -polly-show-only

llvm-svn: 186806

11 years agoScopDetect: move "return false" out of INVALID macro.
Tobias Grosser [Mon, 22 Jul 2013 03:50:33 +0000 (03:50 +0000)]
ScopDetect: move "return false" out of INVALID macro.

Contributed-by: Star Tan <tanmx_star@yeah.net>
llvm-svn: 186805

11 years agoPR16288: A template is only missing a default template argument if it provides
Richard Smith [Mon, 22 Jul 2013 03:31:14 +0000 (03:31 +0000)]
PR16288: A template is only missing a default template argument if it provides
any default template arguments, not if it inherits some.

llvm-svn: 186804

11 years agoImplement DR257 / fix PR16659:
Richard Smith [Mon, 22 Jul 2013 02:56:56 +0000 (02:56 +0000)]
Implement DR257 / fix PR16659:
  A constructor for an abstract class does not call constructors for virtual
  base classes, so it is not an error if no initializer is present for the
  virtual base and the virtual base cannot be default initialized.

Also provide a (disabled by default, for now) warning for the case where a
virtual base class's initializer is ignored in an abstract class's constructor,
and address a defect in DR257 where it was not carried through to C++11's rules
for implicit deletion of special member functions.

Based on a patch by Maurice Bos.

llvm-svn: 186803

11 years agoSemaTemplate.cpp: Prune a stray "\param NumParamLists" in comment. [-Wdocumentation]
NAKAMURA Takumi [Mon, 22 Jul 2013 01:27:42 +0000 (01:27 +0000)]
SemaTemplate.cpp: Prune a stray "\param NumParamLists" in comment. [-Wdocumentation]

llvm-svn: 186802

11 years agoAdded missing - in the header of PrologEpilogInserter.h so that editors properly...
Michael Gottesman [Mon, 22 Jul 2013 00:52:55 +0000 (00:52 +0000)]
Added missing - in the header of PrologEpilogInserter.h so that editors properly realize it is a c++ header and not a c header.

llvm-svn: 186801

11 years agoTest updates missed from r186799.
Richard Smith [Sun, 21 Jul 2013 23:13:17 +0000 (23:13 +0000)]
Test updates missed from r186799.

llvm-svn: 186800

11 years agoTighten up the set of operator new/operator delete calls we're permitted to
Richard Smith [Sun, 21 Jul 2013 23:12:18 +0000 (23:12 +0000)]
Tighten up the set of operator new/operator delete calls we're permitted to
optimize, to follow the permissions granted in N3664. Under those rules, only
calls generated by new-expressions and delete-expressions are permitted to be
optimized, and direct calls to ::operator new and ::operator delete must be
treated as normal calls.

llvm-svn: 186799

11 years agoTreat nothrow forms of ::operator delete and ::operator delete[] as
Richard Smith [Sun, 21 Jul 2013 23:11:42 +0000 (23:11 +0000)]
Treat nothrow forms of ::operator delete and ::operator delete[] as
deallocation functions.

llvm-svn: 186798

11 years agoConst-correct some iterators. No functional change.
Craig Topper [Sun, 21 Jul 2013 22:20:10 +0000 (22:20 +0000)]
Const-correct some iterators. No functional change.

llvm-svn: 186797

11 years agoReplace 'unsigned short' with 'uint16_t' in a packed data structure for consistency...
Craig Topper [Sun, 21 Jul 2013 21:56:18 +0000 (21:56 +0000)]
Replace 'unsigned short' with 'uint16_t' in a packed data structure for consistency with other fields and to be explicit about bit count.

llvm-svn: 186796

11 years agoRevert r186649 because it wasn't unnecessary and add a comment.
Craig Topper [Sun, 21 Jul 2013 18:58:40 +0000 (18:58 +0000)]
Revert r186649 because it wasn't unnecessary and add a comment.

llvm-svn: 186795

11 years agoConvert Sema::MatchTemplateParametersToScopeSpecifier to ArrayRef.
Robert Wilhelm [Sun, 21 Jul 2013 15:20:44 +0000 (15:20 +0000)]
Convert  Sema::MatchTemplateParametersToScopeSpecifier to ArrayRef.

llvm-svn: 186794

11 years agoreport unused-value warning also for warn_unused types
Lubos Lunak [Sun, 21 Jul 2013 13:15:58 +0000 (13:15 +0000)]
report unused-value warning also for warn_unused types

llvm-svn: 186793

11 years agoHandle replacement into a position past the original member.
Rafael Espindola [Sun, 21 Jul 2013 12:58:07 +0000 (12:58 +0000)]
Handle replacement into a position past the original member.

We were incorrectly computing where to insert a member if it was replacing
a previous member that was before the insert point.

llvm-svn: 186792

11 years agoRemove unused fields.
Rafael Espindola [Sun, 21 Jul 2013 12:42:16 +0000 (12:42 +0000)]
Remove unused fields.

llvm-svn: 186791

11 years agomem2reg: Minor STL usage cleanup. No functionality change.
Benjamin Kramer [Sun, 21 Jul 2013 11:03:40 +0000 (11:03 +0000)]
mem2reg: Minor STL usage cleanup. No functionality change.

llvm-svn: 186790

11 years agoclang-format: Smarter replacement in the vim integration.
Daniel Jasper [Sun, 21 Jul 2013 10:45:33 +0000 (10:45 +0000)]
clang-format: Smarter replacement in the vim integration.

With this fix, only changed regions will be replaced in vim's buffer.
Thereby, marks should mostly be left intact. Furthermore, this is a
better fix for the performance problem in conjunction with
'foldmethod=syntax' (see r186660).

llvm-svn: 186789

11 years agoMake the mem2reg interface use an ArrayRef as it keeps a copy of these
Chandler Carruth [Sun, 21 Jul 2013 08:37:58 +0000 (08:37 +0000)]
Make the mem2reg interface use an ArrayRef as it keeps a copy of these
to iterate over.

llvm-svn: 186788

11 years agoMark that the _ftol2 function used by windows on x86 to handle fptoui modifies ECX.
Craig Topper [Sun, 21 Jul 2013 07:28:13 +0000 (07:28 +0000)]
Mark that the _ftol2 function used by windows on x86 to handle fptoui modifies ECX.

llvm-svn: 186787

11 years agoRevert a part of r186420. Don't forbid multiple store chains that merge.
Nadav Rotem [Sun, 21 Jul 2013 06:12:57 +0000 (06:12 +0000)]
Revert a part of r186420. Don't forbid multiple store chains that merge.

llvm-svn: 186786

11 years agoFix exception demo: Add mcjit to link component.
Logan Chien [Sun, 21 Jul 2013 03:46:55 +0000 (03:46 +0000)]
Fix exception demo: Add mcjit to link component.

Fix exception demo when we are building the examples with configure/make.
This commit updates the link components in the Makefile.

llvm-svn: 186785

11 years agoHoist the rest of the logic for promoting single-store allocas into the
Chandler Carruth [Sun, 21 Jul 2013 01:52:33 +0000 (01:52 +0000)]
Hoist the rest of the logic for promoting single-store allocas into the
helper function. This leaves both trivial cases handled entirely in
helper functions and merely manages the list of allocas to process in
the run method.

The next step will be to handle all of the trivial promotion work prior
to even creating the core class and the subsequent simplifications that
enables.

llvm-svn: 186784

11 years agoHoist the rest of the logic for fully promoting allocas with all uses in
Chandler Carruth [Sun, 21 Jul 2013 01:44:07 +0000 (01:44 +0000)]
Hoist the rest of the logic for fully promoting allocas with all uses in
a single block into the helper routine. This takes advantage of the fact
that we can directly replace uses prior to any store with undef to
simplify matters and unconditionally promote allocas only used within
one block.

I've removed the special handling for the case of no stores existing.
This has no semantic effect but might slow things down. I'll fix that in
a later patch when I refactor this entire thing to be easier to manage
the different cases.

llvm-svn: 186783

11 years agoRemove a method made dead by the prior refactoring.
Chandler Carruth [Sun, 21 Jul 2013 00:01:34 +0000 (00:01 +0000)]
Remove a method made dead by the prior refactoring.

llvm-svn: 186782

11 years agoHoist the two trivial promotion routines out of the big class that
Chandler Carruth [Sat, 20 Jul 2013 23:59:51 +0000 (23:59 +0000)]
Hoist the two trivial promotion routines out of the big class that
handles the general cases.

The hope is to refactor this so that we don't end up building the entire
class for the trivial cases. I also want to lift a lot of the early
pre-processing in the initial segment of run() into a separate routine,
and really none of it needs to happen inside the primary promotion
class.

These routines in particular used none of the actual state in the
promotion class, so they don't really make sense as members.

llvm-svn: 186781

11 years agoHoist the AllocaInfo struct to the top of the file.
Chandler Carruth [Sat, 20 Jul 2013 23:39:26 +0000 (23:39 +0000)]
Hoist the AllocaInfo struct to the top of the file.

This struct is nicely independent of everything else, and we already
needed a foward declaration here. It's simpler to just define it
immediately.

llvm-svn: 186780

11 years agoSink a typedef and comparator down to the function that actually uses them.
Chandler Carruth [Sat, 20 Jul 2013 23:36:19 +0000 (23:36 +0000)]
Sink a typedef and comparator down to the function that actually uses them.

llvm-svn: 186779

11 years agoDon't crash when llvm.compiler.used becomes empty.
Rafael Espindola [Sat, 20 Jul 2013 23:33:15 +0000 (23:33 +0000)]
Don't crash when llvm.compiler.used becomes empty.

GlobalOpt simplifies llvm.compiler.used by removing any members that are also
in the more strict llvm.used. Handle the special case where llvm.compiler.used
becomes empty.

llvm-svn: 186778

11 years agoDon't allocate the DIBuilder on the heap and remove all the complexity
Chandler Carruth [Sat, 20 Jul 2013 23:33:06 +0000 (23:33 +0000)]
Don't allocate the DIBuilder on the heap and remove all the complexity
that ensued from that.

llvm-svn: 186777

11 years agoRename constructor parameters to follow the common member-shadowing
Chandler Carruth [Sat, 20 Jul 2013 23:23:47 +0000 (23:23 +0000)]
Rename constructor parameters to follow the common member-shadowing
pattern and conform to the naming conventions.

llvm-svn: 186776

11 years agoReformat the implementation of mem2reg with clang-format so that my
Chandler Carruth [Sat, 20 Jul 2013 23:20:08 +0000 (23:20 +0000)]
Reformat the implementation of mem2reg with clang-format so that my
subsequent changes don't introduce inconsistencies.

llvm-svn: 186775

11 years agoComment: try to clarify loop iteration order.
Andrew Trick [Sat, 20 Jul 2013 23:10:31 +0000 (23:10 +0000)]
Comment: try to clarify loop iteration order.

llvm-svn: 186774

11 years agoRemove a DenseMapInfo specialization for std::pair -- we have one of
Chandler Carruth [Sat, 20 Jul 2013 23:09:05 +0000 (23:09 +0000)]
Remove a DenseMapInfo specialization for std::pair -- we have one of
those baked into DenseMap now.

llvm-svn: 186773

11 years agoUpdate mem2reg's comments to conform to the new doxygen standards. No
Chandler Carruth [Sat, 20 Jul 2013 22:20:05 +0000 (22:20 +0000)]
Update mem2reg's comments to conform to the new doxygen standards. No
functionality changed.

llvm-svn: 186772

11 years ago[PECOFF] Fix use-after-free.
Rui Ueyama [Sat, 20 Jul 2013 21:00:47 +0000 (21:00 +0000)]
[PECOFF] Fix use-after-free.

llvm-svn: 186771

11 years agoAdded preproc callback for pragma directives.
Enea Zaffanella [Sat, 20 Jul 2013 20:09:11 +0000 (20:09 +0000)]
Added preproc callback for pragma directives.

llvm-svn: 186770

11 years agoAdd missing check for creating an instance of an abstract class through an
Richard Smith [Sat, 20 Jul 2013 19:41:36 +0000 (19:41 +0000)]
Add missing check for creating an instance of an abstract class through an
implicit conversion sequence.

llvm-svn: 186769

11 years agoUndisable a test for a c++98-compat warning for inheriting constructors now that...
Richard Smith [Sat, 20 Jul 2013 19:22:08 +0000 (19:22 +0000)]
Undisable a test for a c++98-compat warning for inheriting constructors now that we implement them.

llvm-svn: 186768

11 years agoDisallow global aliases to bitcast between address spaces
Matt Arsenault [Sat, 20 Jul 2013 17:46:05 +0000 (17:46 +0000)]
Disallow global aliases to bitcast between address spaces

llvm-svn: 186767

11 years agoRemove trailing whitespace, fix file path in comment
Matt Arsenault [Sat, 20 Jul 2013 17:46:00 +0000 (17:46 +0000)]
Remove trailing whitespace, fix file path in comment

llvm-svn: 186766

11 years agoadd type attribute warn_unused, for -Wunused-variable warnings (pr#14253)
Lubos Lunak [Sat, 20 Jul 2013 15:05:36 +0000 (15:05 +0000)]
add type attribute warn_unused, for -Wunused-variable warnings (pr#14253)

The functionality is equivalent to the GCC attribute. Variables of tagged
types will be warned about as unused if they are not used in any way
except for possible (even non-trivial) ctors/dtors called. Useful for tagging
classes like std::string (which is not part of this commit).

llvm-svn: 186765

11 years agoavoid bogus warnings about "unknown" pragmas with -frewrite-includes (pr#14831)
Lubos Lunak [Sat, 20 Jul 2013 14:30:01 +0000 (14:30 +0000)]
avoid bogus warnings about "unknown" pragmas with -frewrite-includes (pr#14831)

llvm-svn: 186764

11 years agofix sometimes incorrect line numbers in -frewrite-includes mode (pr#14795)
Lubos Lunak [Sat, 20 Jul 2013 14:23:27 +0000 (14:23 +0000)]
fix sometimes incorrect line numbers in -frewrite-includes mode (pr#14795)

Every #include is surrounded by #if 0 in order to comment it out, which adds
lines. That is fixed up right after, but that all can be inside #if part
that is not processed, so fix up also after every end of a conditional part.

llvm-svn: 186763

11 years agoSilence GCC warning for using both enum and unsigned in a ternary expr.
Benjamin Kramer [Sat, 20 Jul 2013 12:06:17 +0000 (12:06 +0000)]
Silence GCC warning for using both enum and unsigned in a ternary expr.

llvm-svn: 186762

11 years agoSROA: Microoptimization: Remove dead entries first, then sort.
Benjamin Kramer [Sat, 20 Jul 2013 08:38:34 +0000 (08:38 +0000)]
SROA: Microoptimization: Remove dead entries first, then sort.

While there replace an explicit struct with std::mem_fun.

llvm-svn: 186761

11 years agoDiagnosticIDs: Forbid Diag ID from being valid
David Majnemer [Sat, 20 Jul 2013 07:15:15 +0000 (07:15 +0000)]
DiagnosticIDs: Forbid Diag ID from being valid

Diag ID is used throughout clang as a sentinel id meaning "this is an
invalid diagnostic id."  Confusingly, Diag ID maps to a valid, usable,
diagnostic id.  Instead, start diagnostic ids at ID one.

Incidently, remove an unused element from StaticDiagInfo.

llvm-svn: 186760

11 years agoInstCombine: call FoldOpIntoSelect for all floating binops, not just fmul
Stephen Lin [Sat, 20 Jul 2013 07:13:13 +0000 (07:13 +0000)]
InstCombine: call FoldOpIntoSelect for all floating binops, not just fmul

llvm-svn: 186759

11 years agoHave InlineCost check constant fcmps
Matt Arsenault [Sat, 20 Jul 2013 04:09:00 +0000 (04:09 +0000)]
Have InlineCost check constant fcmps

llvm-svn: 186758

11 years agoIf a default argument is a dependent type, get the real type from the desugared
Richard Trieu [Sat, 20 Jul 2013 03:49:02 +0000 (03:49 +0000)]
If a default argument is a dependent type, get the real type from the desugared
template.  Passing around dependent types can lead to integral arguments that
cannot be evaluated.

llvm-svn: 186757

11 years agoAdd Option unit tests to the make build
Hans Wennborg [Sat, 20 Jul 2013 03:04:36 +0000 (03:04 +0000)]
Add Option unit tests to the make build

Previously, they were only built and run in the CMake build.

llvm-svn: 186756

11 years ago[mach-o] factor out all cputype <-> arch conversions to one table driven location
Nick Kledzik [Sat, 20 Jul 2013 02:08:23 +0000 (02:08 +0000)]
[mach-o] factor out all cputype <-> arch conversions to one table driven location

llvm-svn: 186755

11 years agoFix bug in computing POD-for-layout.
Eli Friedman [Sat, 20 Jul 2013 01:06:31 +0000 (01:06 +0000)]
Fix bug in computing POD-for-layout.

A class with a field of non-POD-for-layout type is not POD-for-layout.
This computation should not depend on whether the field is of POD type
in the language sense.

Fixes PR16537.

Patch by Josh Magee.

llvm-svn: 186741

11 years agoUse -lines option instead of -offset/-length. This fixes problems with files using...
Alexander Kornienko [Sat, 20 Jul 2013 01:01:25 +0000 (01:01 +0000)]
Use -lines option instead of -offset/-length. This fixes problems with files using dos newlines (<CR><LF>).

llvm-svn: 186740

11 years ago[PECOFF][Driver] Add -base command line option.
Rui Ueyama [Sat, 20 Jul 2013 00:45:00 +0000 (00:45 +0000)]
[PECOFF][Driver] Add -base command line option.

llvm-svn: 186739

11 years agoMake IgnoreParens() look through ChooseExprs.
Eli Friedman [Sat, 20 Jul 2013 00:40:58 +0000 (00:40 +0000)]
Make IgnoreParens() look through ChooseExprs.

This is the same way GenericSelectionExpr works, and it's generally a
more consistent approach.

A large part of this patch is devoted to caching the value of the condition
of a ChooseExpr; it's needed to avoid threading an ASTContext into
IgnoreParens().

Fixes <rdar://problem/14438917>.

llvm-svn: 186738

11 years agoDebug Info Verifier: simplify DIxxx::Verify
Manman Ren [Sat, 20 Jul 2013 00:38:46 +0000 (00:38 +0000)]
Debug Info Verifier: simplify DIxxx::Verify

Simplify DIxxx:Verify to not call Verify on an operand. Instead, we use
DebugInfoFinder to list all MDNodes that should be a DIScope and all MDNodes
that should be a DIType and we will call Verify on those lists.

llvm-svn: 186737

11 years agoFix size_t -> uint warnings with MSVC 64-bit build
Matt Arsenault [Sat, 20 Jul 2013 00:20:10 +0000 (00:20 +0000)]
Fix size_t -> uint warnings with MSVC 64-bit build

llvm-svn: 186736

11 years agoRefactor AnalyzeBranch on ARM. The previous version did not always analyze
Lang Hames [Fri, 19 Jul 2013 23:52:47 +0000 (23:52 +0000)]
Refactor AnalyzeBranch on ARM. The previous version did not always analyze
indirect branches correctly. Under some circumstances, this led to the deletion
of basic blocks that were the destination of indirect branches. In that case it
left indirect branches to nowhere in the code.

This patch replaces, and is more general than either of the previous fixes for
indirect-branch-analysis issues, r181161 and r186461.

For other branches (not indirect) this refactor should have *almost* identical
behavior to the previous version. There are some corner cases where this
refactor is able to analyze blocks that the previous version could not (e.g.
this necessitated the update to thumb2-ifcvt2.ll).

<rdar://problem/14464830>

llvm-svn: 186735

11 years agoRetry submitting r186623: COFFDumper: Dump data directory entries.
Rui Ueyama [Fri, 19 Jul 2013 23:23:29 +0000 (23:23 +0000)]
Retry submitting r186623: COFFDumper: Dump data directory entries.

The original change was rolled back in r186627 because of test
failures on the big endian machine. I believe I fixed the issue
so re-submitting.

llvm-svn: 186734

11 years agofix an 80-col line.
Nadav Rotem [Fri, 19 Jul 2013 23:14:01 +0000 (23:14 +0000)]
fix an 80-col line.

llvm-svn: 186733

11 years agoUse LLVMs ADTs that improve the compile time of this pass.
Nadav Rotem [Fri, 19 Jul 2013 23:12:19 +0000 (23:12 +0000)]
Use LLVMs ADTs that improve the compile time of this pass.

llvm-svn: 186732

11 years agoSLPVectorizer: Improve the compile time of isConsecutive by reordering the conditions...
Nadav Rotem [Fri, 19 Jul 2013 23:11:15 +0000 (23:11 +0000)]
SLPVectorizer: Improve the compile time of isConsecutive by reordering the conditions that check GEPs and eliminate two of the calls to accumulateConstantOffset.

llvm-svn: 186731

11 years agoFIXME fix: improving diagnostics for template arguments deduction of class templates...
Larisse Voufo [Fri, 19 Jul 2013 23:00:19 +0000 (23:00 +0000)]
FIXME fix: improving diagnostics for template arguments deduction of class templates and explicit specializations
    This patch essentially removes all the FIXMEs following calls to DeduceTemplateArguments() that want to keep track of deduction failure info.

llvm-svn: 186730

11 years agoRevert "Use function overloading instead of template specialization for diagnosis...
Larisse Voufo [Fri, 19 Jul 2013 22:53:23 +0000 (22:53 +0000)]
Revert "Use function overloading instead of template specialization for diagnosis of bad template argument deductions."

This reverts commit a730f548325756d050d4caaa28fcbffdae8dfe95.

llvm-svn: 186729

11 years agoFix pack instantiation with function types.
Eli Friedman [Fri, 19 Jul 2013 22:50:29 +0000 (22:50 +0000)]
Fix pack instantiation with function types.

Make sure we correctly expand packs which expand to another
pack in a function type.

llvm-svn: 186728

11 years agoUse function overloading instead of template specialization for diagnosis of bad...
Larisse Voufo [Fri, 19 Jul 2013 22:34:32 +0000 (22:34 +0000)]
Use function overloading instead of template specialization for diagnosis of bad template argument deductions.

llvm-svn: 186727

11 years agoCorrectly handle packs for variadic type traits.
Eli Friedman [Fri, 19 Jul 2013 21:49:32 +0000 (21:49 +0000)]
Correctly handle packs for variadic type traits.

I'm not sure how to write a test for this; the following shows the
difference in -ast-dump:

template <int x> struct A {};
template <class T> struct B { };
template <class ...Args> using C = A<(__is_trivially_constructible(Args...))>;
template <class ...Args> using D = C<B<Args>...>;

However, I can't seem to write a test that triggers a visible difference
in behavior.

llvm-svn: 186726

11 years agoR600: Don't emit empty then clause and use alu_pop_after
Vincent Lejeune [Fri, 19 Jul 2013 21:45:15 +0000 (21:45 +0000)]
R600: Don't emit empty then clause and use alu_pop_after

llvm-svn: 186725

11 years agoR600: Simplify AMDILCFGStructurize by removing templates and assuming single exit
Vincent Lejeune [Fri, 19 Jul 2013 21:45:06 +0000 (21:45 +0000)]
R600: Simplify AMDILCFGStructurize by removing templates and assuming single exit

llvm-svn: 186724

11 years agoR600: Replace legacy debug code in AMDILCFGStructurizer.cpp
Vincent Lejeune [Fri, 19 Jul 2013 21:44:56 +0000 (21:44 +0000)]
R600: Replace legacy debug code in AMDILCFGStructurizer.cpp

llvm-svn: 186723

11 years agoRemove trailing whitespace
Craig Topper [Fri, 19 Jul 2013 21:43:59 +0000 (21:43 +0000)]
Remove trailing whitespace

llvm-svn: 186722

11 years agoFix inserting new elements in a specified location.
Rafael Espindola [Fri, 19 Jul 2013 21:23:28 +0000 (21:23 +0000)]
Fix inserting new elements in a specified location.

We were only handling the 'a' and 'b' options during moves before.

llvm-svn: 186721

11 years agoAdd a cl.exe compatible driver mode
Hans Wennborg [Fri, 19 Jul 2013 20:33:20 +0000 (20:33 +0000)]
Add a cl.exe compatible driver mode

The mode doesn't actually do anything yet, but this provides a
way to get into it.

llvm-svn: 186720

11 years agoUse an i686 triple for this test now that it uses stdcall
Reid Kleckner [Fri, 19 Jul 2013 20:32:18 +0000 (20:32 +0000)]
Use an i686 triple for this test now that it uses stdcall

There seems to be a crash here if we have a calling convention attribute
that gets ignored and then we instantiate templates.

llvm-svn: 186719

11 years agoFix another place where clang check objc selector name instead of checking the select...
Jean-Daniel Dupas [Fri, 19 Jul 2013 20:25:56 +0000 (20:25 +0000)]
Fix another place where clang check objc selector name instead of checking the selector family

Summary: In ARC mode, clang emits a warning if the result of an 'init' method is unused but miss cases where the method does not follows the Cocoa naming convention but is properly declared as an init family method.

CC: cfe-commits, eli.friedman
Differential Revision: http://llvm-reviews.chandlerc.com/D1163

llvm-svn: 186718

11 years agoReworked the test decorators to match the test results on the buildbots.
Ashok Thirumurthi [Fri, 19 Jul 2013 20:22:43 +0000 (20:22 +0000)]
Reworked the test decorators to match the test results on the buildbots.

llvm-svn: 186717

11 years agoObjectiveC migrator: Another use case of enum
Fariborz Jahanian [Fri, 19 Jul 2013 20:18:36 +0000 (20:18 +0000)]
ObjectiveC migrator: Another use case of enum
declaration which can be migrated to NS_ENUM.

llvm-svn: 186716