Commit Graph

154086 Commits

Author SHA1 Message Date
Rafael Espindola 623c3d8489 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
2013-07-22 15:11:51 +00:00
Reid Kleckner e7de47efbe [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
2013-07-22 13:51:44 +00:00
Reid Kleckner f6ce2b5f2e 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
2013-07-22 13:07:10 +00:00
Daniel Jasper 5f08421e2d Install git-clang-format along with clang-format by default.
llvm-svn: 186825
2013-07-22 12:51:47 +00:00
Reid Kleckner 0a514eeaa7 Forward declare OMPClause in Sema.h to avoid an include
llvm-svn: 186824
2013-07-22 12:47:44 +00:00
Rafael Espindola 9cea44a5f2 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
2013-07-22 12:41:04 +00:00
Ed Maste 76ad5d7589 Factor out common string match code for POSIX log enable/disable
llvm-svn: 186822
2013-07-22 12:39:17 +00:00
Sergey Matveev 9c012165ad [lsan] Make __lsan_do_leak_check() honor the detect_leaks flag.
Also move detect_leaks to common flags.

llvm-svn: 186821
2013-07-22 12:38:17 +00:00
Justin Holewinski cd069e6dec [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
2013-07-22 12:18:04 +00:00
Sergey Matveev 1ac4824841 [lsan] Print direct leaks first.
Direct leaks are higher priority, so it makes sense to have them on top.

llvm-svn: 186819
2013-07-22 11:18:32 +00:00
Tim Northover 1a9dafcd6f Revert "More Intel syntax alias fixes."
This reverts commit r186813, which broke the bots.

llvm-svn: 186818
2013-07-22 11:02:32 +00:00
Enea Zaffanella 1aac546d31 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
2013-07-22 10:58:26 +00:00
Enea Zaffanella e05a3cf648 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
2013-07-22 10:54:09 +00:00
Craig Topper b095c09330 Fix typo. Change %cl to CL in Intel pattern.
llvm-svn: 186815
2013-07-22 10:07:26 +00:00
Craig Topper 61da939a17 More Intel syntax alias fixes.
llvm-svn: 186814
2013-07-22 09:58:07 +00:00
Craig Topper 1b9e4e7e9d More Intel syntax alias fixes.
llvm-svn: 186813
2013-07-22 09:42:31 +00:00
Craig Topper 03db790dc6 Change %xmm0 to XMM0 in Intel side of asm strings for PBLENDVB.
llvm-svn: 186812
2013-07-22 09:22:49 +00:00
Craig Topper 8f9402a989 Add Intel variants to aliases for some FP instructions.
llvm-svn: 186811
2013-07-22 09:18:43 +00:00
Tim Northover eb5e4d532c 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
2013-07-22 09:06:12 +00:00
Craig Topper d0ed3a417e Reverse operands for Intel syntax form of 'bt' alias.
llvm-svn: 186809
2013-07-22 07:47:51 +00:00
Nadav Rotem d7ff88a8d9 Delete unused helper functions.
llvm-svn: 186808
2013-07-22 05:19:22 +00:00
Robert Wilhelm e3cea80ddb Remove superfluous cast.
llvm-svn: 186807
2013-07-22 05:04:01 +00:00
Tobias Grosser 54cb789d39 RegisterPass: Unhide -polly-show and -polly-show-only
llvm-svn: 186806
2013-07-22 04:11:00 +00:00
Tobias Grosser 5b1a7f2245 ScopDetect: move "return false" out of INVALID macro.
Contributed-by: Star Tan <tanmx_star@yeah.net>
llvm-svn: 186805
2013-07-22 03:50:33 +00:00
Richard Smith 35828f1db6 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
2013-07-22 03:31:14 +00:00
Richard Smith bc46e4341e 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
2013-07-22 02:56:56 +00:00
NAKAMURA Takumi 75a7c32a3c SemaTemplate.cpp: Prune a stray "\param NumParamLists" in comment. [-Wdocumentation]
llvm-svn: 186802
2013-07-22 01:27:42 +00:00
Michael Gottesman da6365f4ed 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
2013-07-22 00:52:55 +00:00
Richard Smith 4e155170e8 Test updates missed from r186799.
llvm-svn: 186800
2013-07-21 23:13:17 +00:00
Richard Smith 8d0dc31dca 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
2013-07-21 23:12:18 +00:00
Richard Smith 70523c7926 Treat nothrow forms of ::operator delete and ::operator delete[] as
deallocation functions.

llvm-svn: 186798
2013-07-21 23:11:42 +00:00
Craig Topper a9bcac5825 Const-correct some iterators. No functional change.
llvm-svn: 186797
2013-07-21 22:20:10 +00:00
Craig Topper ea6caba325 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
2013-07-21 21:56:18 +00:00
Craig Topper 31e71a3997 Revert r186649 because it wasn't unnecessary and add a comment.
llvm-svn: 186795
2013-07-21 18:58:40 +00:00
Robert Wilhelm f2d2e8ff02 Convert Sema::MatchTemplateParametersToScopeSpecifier to ArrayRef.
llvm-svn: 186794
2013-07-21 15:20:44 +00:00
Lubos Lunak 1f490f3aea report unused-value warning also for warn_unused types
llvm-svn: 186793
2013-07-21 13:15:58 +00:00
Rafael Espindola 9cd2435b9a 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
2013-07-21 12:58:07 +00:00
Rafael Espindola 5dfe843a2c Remove unused fields.
llvm-svn: 186791
2013-07-21 12:42:16 +00:00
Benjamin Kramer 2fdb758ca8 mem2reg: Minor STL usage cleanup. No functionality change.
llvm-svn: 186790
2013-07-21 11:03:40 +00:00
Daniel Jasper 68c03c82df 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
2013-07-21 10:45:33 +00:00
Chandler Carruth 7aa9ebb546 Make the mem2reg interface use an ArrayRef as it keeps a copy of these
to iterate over.

llvm-svn: 186788
2013-07-21 08:37:58 +00:00
Craig Topper 8956fe0dbc Mark that the _ftol2 function used by windows on x86 to handle fptoui modifies ECX.
llvm-svn: 186787
2013-07-21 07:28:13 +00:00
Nadav Rotem f6bb6a464c Revert a part of r186420. Don't forbid multiple store chains that merge.
llvm-svn: 186786
2013-07-21 06:12:57 +00:00
Logan Chien 8a61aab88e 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
2013-07-21 03:46:55 +00:00
Chandler Carruth b1ca98c4d0 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
2013-07-21 01:52:33 +00:00
Chandler Carruth f9e7e1dd87 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
2013-07-21 01:44:07 +00:00
Chandler Carruth e99f931516 Remove a method made dead by the prior refactoring.
llvm-svn: 186782
2013-07-21 00:01:34 +00:00
Chandler Carruth 420fafef93 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
2013-07-20 23:59:51 +00:00
Chandler Carruth 48e11fd76d 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
2013-07-20 23:39:26 +00:00
Chandler Carruth 4711793e8a Sink a typedef and comparator down to the function that actually uses them.
llvm-svn: 186779
2013-07-20 23:36:19 +00:00