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

21384 Коммитов

Автор SHA1 Сообщение Дата
Anders Carlsson e99bdb6969 Don't build an aggregate constructor loop when the constructor is trivial.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102912 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-03 15:09:17 +00:00
Anders Carlsson 33d73fa9db Add test case that I forgot to check in.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102905 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-03 14:22:40 +00:00
Benjamin Kramer d566381800 Replace a char*/size pair with stringref.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102902 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-03 13:08:54 +00:00
Anders Carlsson 28e9483a19 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102896 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-03 02:07:56 +00:00
Anders Carlsson 0d7c583a4b Don't copy or initialize empty classes. Fixes PR7012.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102891 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-03 01:20:20 +00:00
Anders Carlsson 3855a07db0 Store the entire base subobject in SubVTTIndices.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102890 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-03 00:55:11 +00:00
Anders Carlsson 43373963ac Remove OldGetAddressOfBaseClass - bye bye ambiguities.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102889 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-03 00:32:27 +00:00
Anders Carlsson 8246cc7f85 Get rid of the last caller of OldGetAddressOfBaseClass.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-03 00:29:58 +00:00
Anders Carlsson 4235840554 More work towards getting rid of OldGetAddressOfBaseClass.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102887 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-03 00:07:07 +00:00
Anders Carlsson 77fae58f6d Get rid of a call to GetAddressOfDirectBaseInCompleteClass.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102886 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-02 23:57:15 +00:00
Anders Carlsson c11bb21910 Have getSubVTTIndex take a BaseSubobject instead of just a base.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102885 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-02 23:53:25 +00:00
Anders Carlsson fcaeef2ae0 Change CXXConstructExpr::Create to take a ConstructionKind.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102884 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-02 23:53:04 +00:00
Anders Carlsson 314e622d20 Pass ForVirtualBase all the way to GetVTTParameter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102883 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-02 23:33:10 +00:00
Anders Carlsson 8e6404ca28 Add the same 'ForVirtualBase' parameter to EmitCXXDestructorCall.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102882 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-02 23:29:11 +00:00
Anders Carlsson 155ed4a233 Revert my last change and add a 'ForVirtualBase' parameter to EmitCXXConstructorCall instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102881 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-02 23:20:53 +00:00
Anders Carlsson 24eb78e38a Pass the construction kind down to EmitCXXConstructorCall.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102880 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-02 23:01:10 +00:00
Anders Carlsson 72e96fd181 Add an enum to CXXConstructExpr so we can determine if the construction expression constructs a non-virtual or virtual base.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102879 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-02 22:54:08 +00:00
Anders Carlsson 82929316cc Remove another unused function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102871 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-02 18:13:35 +00:00
Anders Carlsson 05dd1f6292 Remove an unused function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102870 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-02 18:12:22 +00:00
Benjamin Kramer 81bf3b3566 CodeGen: Shrink RValue. 4 words -> 2 words.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102863 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-02 14:59:10 +00:00
David Chisnall 4b02afcb45 As per Chris' request, return the Instruction from EmitCall and add the metadata in the caller.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102862 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-02 13:41:58 +00:00
Douglas Gregor 06a9f3680d Complete reimplementation of the synthesis for implicitly-defined copy
assignment operators. 

Previously, Sema provided type-checking and template instantiation for
copy assignment operators, then CodeGen would synthesize the actual
body of the copy constructor. Unfortunately, the two were not in sync,
and CodeGen might pick a copy-assignment operator that is different
from what Sema chose, leading to strange failures, e.g., link-time
failures when CodeGen called a copy-assignment operator that was not
instantiation, run-time failures when copy-assignment operators were
overloaded for const/non-const references and the wrong one was
picked, and run-time failures when by-value copy-assignment operators
did not have their arguments properly copy-initialized.

This implementation synthesizes the implicitly-defined copy assignment
operator bodies in Sema, so that the resulting ASTs encode exactly
what CodeGen needs to do; there is no longer any special code in
CodeGen to synthesize copy-assignment operators. The synthesis of the
body is relatively simple, and we generate one of three different
kinds of copy statements for each base or member:

  - For a class subobject, call the appropriate copy-assignment
    operator, after overload resolution has determined what that is.
  - For an array of scalar types or an array of class types that have
    trivial copy assignment operators, construct a call to
    __builtin_memcpy.
  - For an array of class types with non-trivial copy assignment
    operators, synthesize a (possibly nested!) for loop whose inner
    statement calls the copy constructor.
  - For a scalar type, use built-in assignment.

This patch fixes at least a few tests cases in Boost.Spirit that were
failing because CodeGen picked the wrong copy-assignment operator
(leading to link-time failures), and I suspect a number of undiagnosed
problems will also go away with this change.

Some of the diagnostics we had previously have gotten worse with this
change, since we're going through generic code for our
type-checking. I will improve this in a subsequent patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102853 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-01 20:49:11 +00:00
Chris Lattner 4c50b697bb fix a broken link, diagnostickinds.td was fissioned.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102851 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-01 17:35:19 +00:00
Anders Carlsson bfe7e91c12 Simplify EmitCopyCtorCall.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-01 17:07:40 +00:00
Anders Carlsson 43db20e955 Simplify EmitClassAggrMemberwiseCopy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102848 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-01 17:02:18 +00:00
Douglas Gregor e2e69ef80a Bump default template instantiation depth to 1024, as required by C++0x
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-01 16:59:21 +00:00
Anders Carlsson f62756f45b Clean up EmitClassMemberwiseCopy further.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102846 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-01 16:54:05 +00:00
Anders Carlsson 1d1d1185b4 Get rid of a parameter from EmitClassMemberwiseCopy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-01 16:49:43 +00:00
Anders Carlsson 59b7f1538d When defining implicit copy constructors, use SetBaseOrMemberInitializers to initialize the bases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102842 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-01 16:39:01 +00:00
Douglas Gregor 39957dce3d Added an RAII object that helps set up/tear down the Sema context
information required to implicitly define a C++ special member
function. Use it rather than explicitly setting CurContext on entry
and exit, which is fragile. 

Use this RAII object for the implicitly-defined default constructor,
copy constructor, copy assignment operator, and destructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102840 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-01 15:04:51 +00:00
David Chisnall 63e742bed9 Attach message send metadata to the lookup as well as to the call (GNU runtime).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102839 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-01 12:56:56 +00:00
David Chisnall db831948f3 Make super message lookups cacheable (GNUstep Runtime)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102837 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-01 12:37:16 +00:00
David Chisnall dd5c98f709 Tweaked EmitCall() to permit the caller to provide some metadata to attach to the call site.
Used this in CGObjCGNU to attach metadata about message sends to permit speculative inlining.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102833 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-01 11:15:56 +00:00
Benjamin Kramer afaf0fa8c2 Remove empty directory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102832 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-01 10:30:16 +00:00
Chris Lattner 62cf344e40 with recent optimizer changes, these all get devirtualized.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102825 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-01 01:42:06 +00:00
John McCall 77bb1aa78b It turns out that basically every caller to RequireCompleteDeclContext
already knows what context it's looking in.  Just pass that context in
instead of (questionably) recalculating it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102818 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-01 00:40:08 +00:00
Daniel Dunbar cdb65d8724 Fix NON_ANSI_COMPILE_FLAGS setting, for MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102811 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-01 00:06:42 +00:00
Ted Kremenek f42e337107 Add null check in CFGBuilder::VisitStmt() to make CFG construction
more resilient to bad code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102793 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 22:25:53 +00:00
Daniel Dunbar f51f20fa34 Rename 'CIndex' to 'libclang', since it has basically become our stable public
(C) API, and will likely grow further in this direction in the future.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102779 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 21:51:10 +00:00
Ted Kremenek 99e8192c4c Don't perform AnalysisBasedWarnings in Sema or run the static analyzer when a
fatal error has occurred.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 21:49:25 +00:00
Douglas Gregor c0c8300329 After substituting a template argument for a non-type template
parameter with pointer-to-member type, we may have to perform a
qualification conversion, since the pointee type of the parameter
might be more qualified than the pointee type of the argument we form
from the declaration. Fixes PR6986.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102777 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 21:46:38 +00:00
John McCall 2888b65aae When synthesizing Objective C records, give the synthetic fields public
access.  Fixes an assertion.

Fixes rdar://problem/7927811.  Too lazy to reduce a test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 21:35:41 +00:00
Douglas Gregor 72be24f39c Fix a thinko that caused us not to compute __builtin_offset as a
constant expression in C. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102762 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 20:35:01 +00:00
Douglas Gregor 42748ec5cb Teach clang_getLocation() to cope with a NULL file argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102748 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 19:45:53 +00:00
Anders Carlsson 106d9ea61c Remove an unnecessary parameter from EmitClassCopyAssignment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102747 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 19:45:28 +00:00
Douglas Gregor 895162da2d Clean up our handling of local instantiation scopes, which keep track
of the mapping from local declarations to their instantiated
counterparts during template instantiation. Previously, we tried to do
some unholy merging of local instantiation scopes that involved
storing a single hash table along with an "undo" list on the
side... which was ugly, and never handled function parameters
properly.

Now, we just keep separate hash tables for each local instantiation
scope, and "combining" two scopes means that we'll look in each of the
combined hash tables. The combined scope stack is rarely deep, and
this makes it easy to avoid the "undo" issues we were hitting. Also,
I've simplified the logic for function parameters: if we're declaring
a function and we need the function parameters to live longer, we just
push them back into the local instantiation scope where we need them. 

Fixes PR6990.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102732 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 18:55:50 +00:00
Daniel Dunbar 25cf7b4e91 Move include installation steps to better location, inside each include dir instead of at the top-level.
Also, don't set NO_INSTALL=1 for c-index-test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 17:59:38 +00:00
David Chisnall 866163bf6c Fixed incorrect type of alloca (GNU runtime).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102711 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 13:36:12 +00:00
Abramo Bagnara e215f7232d Add calling convention related attributes to related declaration. Mark attributes invalid on type related checking so to add them to declarations only when everything is ok.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102710 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 13:10:51 +00:00
Abramo Bagnara b1f1b26735 Attribute noreturn is now put in declaration attributes. Fixed a double warning generation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102705 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 09:13:03 +00:00