summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Complain when we try to initialize an object of Objective-C class typeDouglas Gregor2010-05-031-3/+7
| | | | | | | | (which is ill-formed) with an initializer list. Also, change the fallback from an assertion to a generic error message, which is far friendlier. Fixes <rdar://problem/7730948>. llvm-svn: 102930
* It's okay to reference an enum in a template definition, even thoughDouglas Gregor2010-05-031-9/+12
| | | | | | it's ill-formed to form an enum template. Fixes <rdar://problem/7933063>. llvm-svn: 102926
* When computing the address of a virtual member function pointer, use the ↵Anders Carlsson2010-05-032-2/+12
| | | | | | pointer width instead of hardcoding for 64-bit. llvm-svn: 102921
* Do not issue warning on unimplemented property in the class, if itFariborz Jahanian2010-05-032-1/+40
| | | | | | | | conforms to a protocol as one of its super classes does. This is because conforming super class will implement the property. This implements new warning rules for unimplemented properties (radar 7884086). llvm-svn: 102919
* The array form of 'new' can never have initializers.Anders Carlsson2010-05-031-0/+9
| | | | llvm-svn: 102917
* When creating the declaration reference for implicit copy-constructionDouglas Gregor2010-05-031-1/+1
| | | | | | of a base class, give it real source-location information. Fixes PR7017. llvm-svn: 102916
* When declaring a namespace alias, ignore previous declarations thatDouglas Gregor2010-05-031-3/+7
| | | | | | aren't in scope. Fixes PR7014. llvm-svn: 102915
* When instantiating a member function declared via a typedef, don't tryDouglas Gregor2010-05-031-14/+18
| | | | | | | to enter the instantiated parameter declarations into the local instantiation scope; they can't be referenced anyway. Fixes PR7022. llvm-svn: 102914
* When a class contains a non-empty anonymous union or struct, mark isDouglas Gregor2010-05-031-2/+5
| | | | | | as non-empty. Fixes PR7021. llvm-svn: 102913
* Don't build an aggregate constructor loop when the constructor is trivial.Anders Carlsson2010-05-031-5/+7
| | | | llvm-svn: 102912
* Replace a char*/size pair with stringref.Benjamin Kramer2010-05-033-7/+5
| | | | llvm-svn: 102902
* Simplify.Anders Carlsson2010-05-031-4/+4
| | | | llvm-svn: 102896
* Don't copy or initialize empty classes. Fixes PR7012.Anders Carlsson2010-05-032-0/+16
| | | | llvm-svn: 102891
* Store the entire base subobject in SubVTTIndices.Anders Carlsson2010-05-032-16/+13
| | | | llvm-svn: 102890
* Remove OldGetAddressOfBaseClass - bye bye ambiguities.Anders Carlsson2010-05-032-95/+0
| | | | llvm-svn: 102889
* Get rid of the last caller of OldGetAddressOfBaseClass.Anders Carlsson2010-05-031-8/+16
| | | | llvm-svn: 102888
* More work towards getting rid of OldGetAddressOfBaseClass.Anders Carlsson2010-05-032-1/+12
| | | | llvm-svn: 102887
* Get rid of a call to GetAddressOfDirectBaseInCompleteClass.Anders Carlsson2010-05-021-4/+7
| | | | llvm-svn: 102886
* Have getSubVTTIndex take a BaseSubobject instead of just a base.Anders Carlsson2010-05-023-4/+10
| | | | llvm-svn: 102885
* Change CXXConstructExpr::Create to take a ConstructionKind.Anders Carlsson2010-05-021-3/+2
| | | | llvm-svn: 102884
* Pass ForVirtualBase all the way to GetVTTParameter.Anders Carlsson2010-05-021-4/+8
| | | | llvm-svn: 102883
* Add the same 'ForVirtualBase' parameter to EmitCXXDestructorCall.Anders Carlsson2010-05-027-15/+27
| | | | llvm-svn: 102882
* Revert my last change and add a 'ForVirtualBase' parameter to ↵Anders Carlsson2010-05-023-12/+15
| | | | | | EmitCXXConstructorCall instead. llvm-svn: 102881
* Pass the construction kind down to EmitCXXConstructorCall.Anders Carlsson2010-05-023-7/+10
| | | | llvm-svn: 102880
* Add an enum to CXXConstructExpr so we can determine if the construction ↵Anders Carlsson2010-05-024-24/+34
| | | | | | expression constructs a non-virtual or virtual base. llvm-svn: 102879
* Remove another unused function.Anders Carlsson2010-05-022-39/+0
| | | | llvm-svn: 102871
* Remove an unused function.Anders Carlsson2010-05-022-89/+0
| | | | llvm-svn: 102870
* CodeGen: Shrink RValue. 4 words -> 2 words.Benjamin Kramer2010-05-021-30/+25
| | | | llvm-svn: 102863
* As per Chris' request, return the Instruction from EmitCall and add the ↵David Chisnall2010-05-023-9/+12
| | | | | | metadata in the caller. llvm-svn: 102862
* Complete reimplementation of the synthesis for implicitly-defined copyDouglas Gregor2010-05-017-192/+432
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 102853
* Simplify EmitCopyCtorCall.Anders Carlsson2010-05-011-12/+5
| | | | llvm-svn: 102849
* Simplify EmitClassAggrMemberwiseCopy.Anders Carlsson2010-05-013-22/+10
| | | | llvm-svn: 102848
* Bump default template instantiation depth to 1024, as required by C++0xDouglas Gregor2010-05-011-1/+1
| | | | llvm-svn: 102847
* Clean up EmitClassMemberwiseCopy further.Anders Carlsson2010-05-012-22/+10
| | | | llvm-svn: 102846
* Get rid of a parameter from EmitClassMemberwiseCopy.Anders Carlsson2010-05-012-5/+4
| | | | llvm-svn: 102845
* When defining implicit copy constructors, use SetBaseOrMemberInitializers to ↵Anders Carlsson2010-05-012-32/+18
| | | | | | initialize the bases. llvm-svn: 102842
* Added an RAII object that helps set up/tear down the Sema contextDouglas Gregor2010-05-013-24/+35
| | | | | | | | | | | 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. llvm-svn: 102840
* Attach message send metadata to the lookup as well as to the call (GNU runtime).David Chisnall2010-05-011-7/+10
| | | | llvm-svn: 102839
* Make super message lookups cacheable (GNUstep Runtime)David Chisnall2010-05-011-14/+34
| | | | llvm-svn: 102837
* Tweaked EmitCall() to permit the caller to provide some metadata to attach ↵David Chisnall2010-05-013-11/+28
| | | | | | | | to the call site. Used this in CGObjCGNU to attach metadata about message sends to permit speculative inlining. llvm-svn: 102833
* It turns out that basically every caller to RequireCompleteDeclContextJohn McCall2010-05-018-61/+49
| | | | | | | already knows what context it's looking in. Just pass that context in instead of (questionably) recalculating it. llvm-svn: 102818
* Add null check in CFGBuilder::VisitStmt() to make CFG constructionTed Kremenek2010-04-301-0/+4
| | | | | | more resilient to bad code. llvm-svn: 102793
* Don't perform AnalysisBasedWarnings in Sema or run the static analyzer when aTed Kremenek2010-04-302-7/+6
| | | | | | fatal error has occurred. llvm-svn: 102778
* After substituting a template argument for a non-type templateDouglas Gregor2010-04-301-1/+13
| | | | | | | | | 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. llvm-svn: 102777
* When synthesizing Objective C records, give the synthetic fields publicJohn McCall2010-04-302-1/+9
| | | | | | | | access. Fixes an assertion. Fixes rdar://problem/7927811. Too lazy to reduce a test case. llvm-svn: 102776
* Fix a thinko that caused us not to compute __builtin_offset as aDouglas Gregor2010-04-302-1/+5
| | | | | | constant expression in C. llvm-svn: 102762
* Remove an unnecessary parameter from EmitClassCopyAssignment.Anders Carlsson2010-04-302-13/+7
| | | | llvm-svn: 102747
* Clean up our handling of local instantiation scopes, which keep trackDouglas Gregor2010-04-305-77/+72
| | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 102732
* Fixed incorrect type of alloca (GNU runtime).David Chisnall2010-04-301-2/+5
| | | | llvm-svn: 102711
* Add calling convention related attributes to related declaration. Mark ↵Abramo Bagnara2010-04-303-19/+69
| | | | | | attributes invalid on type related checking so to add them to declarations only when everything is ok. llvm-svn: 102710
OpenPOWER on IntegriCloud