Граф коммитов

188 Коммитов

Автор SHA1 Сообщение Дата
Eric Christopher 73fb35003a Recommit:
Start handling debug line and scope information better:

    Migrate most of the location setting within the larger API in CGDebugInfo and
    update a lot of callers.
    Remove the existing file/scope change machinery in UpdateLineDirectiveRegion
    and replace it with DILexicalBlockFile usage.

    Finishes off the rest of rdar://10246360

after fixing a few bugs that were exposed in gdb testsuite testing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141893 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-13 21:45:18 +00:00
Eric Christopher 28e06354b5 Revert file/scope handling patches. gdb testing revealed a couple of bugs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141796 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-12 18:39:35 +00:00
Jim Goodnow II 55acb0d050 Removed extra line in comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141773 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-12 09:55:01 +00:00
Eric Christopher 4b2d549872 Start handling debug line and scope information better:
Migrate most of the location setting within the larger API in CGDebugInfo and
update a lot of callers.
Remove the existing file/scope change machinery in UpdateLineDirectiveRegion
and replace it with DILexicalBlockFile usage.

Finishes off the rest of rdar://10246360

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141732 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 23:00:55 +00:00
Eric Christopher 5321bc492b Rename EmitStopPoint in CGDebugInfo to EmitLocation. "stop points" don't
exist anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140739 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 00:00:41 +00:00
Peter Collingbourne e09cdf46aa Move all vtable layout data into new VTableLayout class
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140506 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26 01:56:50 +00:00
Peter Collingbourne 84fcc48817 Move vtable component accessors to VTableContext
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140504 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26 01:56:41 +00:00
Peter Collingbourne 1d2b317105 Create a VTableContext class and start moving CodeGenVTables methods to it
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140502 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26 01:56:30 +00:00
Douglas Gregor 690b2dbde0 Only trigger the initialize-an-array-via-elementwise-copy/move code
generation when we're dealing with an implicitly-defined copy or move
constructor. And, actually set the implicitly-defined bit for
implicitly-defined constructors and destructors. Should fix self-host.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140334 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-22 20:32:43 +00:00
Douglas Gregor b681fb180d Explicitly-defaulted copy/move constructors are not "implicit", but
they still need the logic to cope with array member
initialization. Fixes PR10720.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140302 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-22 15:15:51 +00:00
Richard Smith 416f63e42d PR10304: Do not call destructors for data members from union destructors. Prior to C++11, this
has no effect since any such destructors must be trivial, and in C++11 such destructors must not
be called.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139997 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-18 12:11:43 +00:00
John McCall 3460c0c761 Sorry, that assertion actually already exists.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139770 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 01:55:23 +00:00
John McCall 082aadee63 We don't generate null initializer expressions anymore, and
we don't need to.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139769 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 01:54:21 +00:00
Sebastian Redl 85ea7aa961 Declare and define implicit move constructor and assignment operator.
This makes the code duplication of implicit special member handling even worse,
but the cleanup will have to come later. For now, this works.
Follow-up with tests for explicit defaulting and enabling the __has_feature
flag to come.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138821 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-30 19:58:05 +00:00
John McCall 410ffb2bc5 Track whether an AggValueSlot is potentially aliased, and do not
emit call results into potentially aliased slots.  This allows us
to properly mark indirect return slots as noalias, at the cost
of requiring an extra memcpy when assigning an aggregate call
result into a l-value.  It also brings us into compliance with
the x86-64 ABI.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138599 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-25 23:04:34 +00:00
John McCall 7c2349be2d Use stronger typing for the flags on AggValueSlot and require
creators to tell us whether something needs GC barriers.
No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138581 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-25 20:40:09 +00:00
Eli Friedman c55db3b76d Cleanup; no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137126 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-09 17:38:12 +00:00
Chris Lattner 5f9e272e63 remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-23 10:55:15 +00:00
Chris Lattner 2acc6e3fed de-constify llvm::Type, patch by David Blaikie!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135370 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 04:24:23 +00:00
John McCall dd376cae98 Arrays are permitted to be zero-length in some situations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135036 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 07:37:11 +00:00
John McCall c3c0766277 Convert the standard default-construction loops to use phis and
partial destruction.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135033 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 06:10:41 +00:00
John McCall 8f62992730 Aggressive dead code elimination.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135029 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 03:03:51 +00:00
John McCall ad346f4f67 Generalize Cleanup::Emit's "isForEH" parameter into a set
of flags.  No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134997 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 20:27:29 +00:00
John McCall 9928c4805a Switch field destruction over to use the new destroyer-based API
and kill a lot of redundant code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134988 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 16:41:08 +00:00
John McCall bdc4d80956 A number of array-related IR-gen cleanups.
- Emit default-initialization of arrays that were partially initialized
    with initializer lists with a loop, rather than emitting the default
    initializer N times;
  - support destroying VLAs of non-trivial type, although this is not
    yet exposed to users; and
  - support the partial destruction of arrays initialized with
    initializer lists when an initializer throws an exception.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134784 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 01:37:26 +00:00
John McCall 545d996ec5 LValue carries a type now, so simplify the main EmitLoad/Store APIs
by removing the redundant type parameter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133860 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-25 02:11:03 +00:00
John McCall a07398ed98 Restore correct use of GC barriers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133144 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-16 04:16:24 +00:00
John McCall f85e193739 Automatic Reference Counting.
Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.

Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133103 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-15 23:02:42 +00:00
Richard Smith 7a614d8380 Implement support for C++11 in-class initialization of non-static data members.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132878 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-11 17:19:42 +00:00
Anders Carlsson e3d6cf2149 Fix another regression from the "skip vtable pointer initialization"
optimization. Make sure to require a vtable when trying to get the address
of a VTT, otherwise we would never end up emitting the VTT.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131400 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 04:08:36 +00:00
Anders Carlsson adf5dc340d Re-enable the fix for PR9181 now that all the edge cases are handled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131385 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-15 17:36:21 +00:00
Anders Carlsson 1493e2369c Disable the optimization until the bug noticed by Sean Hunt has been fixed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131372 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-15 01:50:14 +00:00
Anders Carlsson ffb945ffb5 When emitting the destructor for a class with a vtable, if we can determine
that the destructor body is trivial and that all member variables also have either
trivial destructors or trivial destructor bodies, we don't need to initialize the
vtable pointers since no virtual member functions will be called on the destructor.

Fixes PR9181.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131368 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-14 23:26:09 +00:00
Anders Carlsson a2447e0d1e Move code to emit the callee of an CXXOperatorCallExpr out into a separate function in CGClass.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131075 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-08 20:32:23 +00:00
Sean Hunt b76af9c969 Ensure that destructors are properly inovked when an exception leaves
the body of a delegating constructor call.

This means that the delegating constructor implementation should be
complete and correct, though there are some rough edges (diagnostic
quality with the cycle detection and using a deleted destructor).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130803 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 23:05:34 +00:00
Sean Hunt d49bd5515b Fix delegating constructors stylistic issues.
Material bugfixes to come this afternoon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130782 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 20:19:28 +00:00
Eli Friedman 04c9a49ee2 Simplify code a bit by using CallArgList::add. No intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130699 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 17:57:46 +00:00
Sean Hunt 059ce0d92e Fully implement delegating constructors!
As far as I know, this implementation is complete but might be missing a
few optimizations. Exceptions and virtual bases are handled correctly.

Because I'm an optimist, the web page has appropriately been updated. If
I'm wrong, feel free to downgrade its support categories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130642 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-01 07:04:31 +00:00
John McCall 642a75f883 When block-capturing a variable with a non-trivial destructor,
make sure to mark the destructor.  This normally isn't required,
because the destructor should have been marked as part of the
declaration of the local, but it's necessary when the variable
is a parameter because it's the call sites that are responsible
for those destructors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130372 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 02:15:35 +00:00
Anders Carlsson b924124316 Replace a couple of Builder.CreateICmpEQ with Builder.CreateIsNull. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129261 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-11 00:30:07 +00:00
Ken Dyck 14c65ca4cd [Reapply r128776, modified so that it does not break debug info.]
Change the return type of CodeGenVTables::getVirtualBaseOffsetOffset() to
CharUnits. No change in functionality intended.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129072 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 12:37:09 +00:00
Devang Patel 62c117db25 Revert r128770, r128771, r128773 and r128776 for now. It breaks debug info.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128842 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-04 20:36:06 +00:00
Ken Dyck 4fbabd37fd Change the return type of CodeGenVTables::getVirtualBaseOffsetOffset() to
CharUnits. No change in functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128776 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-02 17:52:22 +00:00
Jay Foad bbf3bacb3e Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128538 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 11:28:58 +00:00
Ken Dyck 4230d529a8 Convert the BaseOffset member of BaseSubobject to CharUnits from bits. No
change in functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128190 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-24 01:21:01 +00:00
Ken Dyck d6fb21fa10 Convert OffsetFromNearestVBast parameter of InitializeVTablePointer(s) to
CharUnits. No change in functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128129 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-23 01:04:18 +00:00
Ken Dyck 9a8ad9b28d Convert NonVirtual parameter of ApplyNonVirtualAndVirtualOffset() to
CharUnits. No change in functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128126 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-23 00:45:26 +00:00
Ken Dyck 5fff46b653 Convert Offset variable in GetAddressOfDirectBaseInCompleteClass() to
CharUnits. No change in functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128060 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 01:21:15 +00:00
Ken Dyck 55c02585de Change return value of ComputeNonVirtualBaseClassOffset() to CharUnits. No
change in functionality intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128050 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 00:53:26 +00:00
John McCall 413ebdb1af Use a slightly more semantic interface for emitting call arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127494 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11 20:59:21 +00:00