summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Attribute noreturn is now put in declaration attributes. Fixed a double ↵Abramo Bagnara2010-04-302-18/+16
| | | | | | warning generation. llvm-svn: 102705
* An edge from a call expression to the exit block is only an abnormal edgeJohn McCall2010-04-301-1/+2
| | | | | | | | | | | if *none* of the successors of the call expression is the exit block. This matters when a call of bool type is the condition of (say) a while loop in a function with no statements after the loop. This *can* happen in C, but it's much more common in C++ because of overloaded operators. Suppresses some substantial number of spurious -Wmissing-noreturn warnings. llvm-svn: 102696
* Fix ADL for types declared in transparent decls, from Alp Toker!Douglas Gregor2010-04-301-18/+16
| | | | llvm-svn: 102695
* Introduce a sequence number into class template partialDouglas Gregor2010-04-304-37/+32
| | | | | | | | | | | specializations, which keeps track of the order in which they were originally declared. We use this number so that we can always walk the list of partial specializations in a predictable order during matching or template instantiation. This also fixes a failure in Boost.Proto, where SourceManager::isBeforeInTranslationUnit was behaving poorly in inconsistent ways. llvm-svn: 102693
* Account for the VTT argument when making an implicit copy constructor forJohn McCall2010-04-301-1/+13
| | | | | | | | | a class with virtual bases. Just a patch until Sema starts (correctly) doing most of this analysis. Fixes PR 6622. llvm-svn: 102692
* When we start the definition of a class template, set theDouglas Gregor2010-04-301-0/+9
| | | | | | | | | InjectedClassNameType's Decl to point at the definition. It's a little messy, but we do the same thing with classes and their record types, since much of Clang expects that the TagDecl* one gets out of a type is the definition. Fixes several Boost.Proto failures. llvm-svn: 102691
* Remove unused trait.Zhongxing Xu2010-04-301-9/+0
| | | | llvm-svn: 102690
* Refactor the AnalysisConsumer to analyze functions after the whole Zhongxing Xu2010-04-301-125/+63
| | | | | | | | | | | | | | | | | | | | | | | | | translation unit is parsed. This enables us to inline some calls when still analyzing one function at a time. Actions are classified into Function, CXXMethod, ObjCMethod, ObjCImplementation. This does not hurt performance much. The analysis time for sqlite3.c: before: real 17m52.440s user 17m49.460s sys 0m2.010s after: real 18m0.500s user 17m56.900s sys 0m2.330s DisplayProgress option is broken now. -inine-call action is removed. It will be reenabled in another form, perhaps as an indenpendant option. llvm-svn: 102689
* Fix a tentative-parse error with unqualified template ids in cast expressions.John McCall2010-04-301-0/+13
| | | | | | Also resolve a long-working FIXME in the test case I modified. llvm-svn: 102688
* Add Clang version inspection macros. Fixes PR6681.Douglas Gregor2010-04-301-1/+15
| | | | llvm-svn: 102686
* Fix -fno-rtti -fexceptions by forcing the emission of (non-"builtin") RTTIJohn McCall2010-04-303-11/+23
| | | | | | when used by the exceptions routines. Fixes PR 6974. llvm-svn: 102684
* logical ops, unary ops, pairwise opsNate Begeman2010-04-301-17/+90
| | | | llvm-svn: 102681
* Teach EHCleanupBlock to deal appropriately with the possibility that thereJohn McCall2010-04-301-1/+5
| | | | | | might not have been an insertion block set at start. Fixes PR6975. llvm-svn: 102677
* Get the base class addresses before calling EmitClassCopyAssignment.Anders Carlsson2010-04-301-5/+8
| | | | llvm-svn: 102676
* Remove an unnecessary argument to EmitClassCopyAssignment.Anders Carlsson2010-04-292-11/+8
| | | | llvm-svn: 102674
* Rebuild the nested name specifiers in member-pointer declarator chunks whenJohn McCall2010-04-293-69/+158
| | | | | | | | | entering the current instantiation. Set up a little to preserve type location information for typename types while we're in there. Fixes a Boost failure. llvm-svn: 102673
* Comparisons.Nate Begeman2010-04-291-0/+54
| | | | llvm-svn: 102669
* Do not enable '-analyze-check-security-syntactic' by default when using ↵Ted Kremenek2010-04-291-1/+3
| | | | | | | | '--analyze'. There are several known issues to address for it should be turned on by default. llvm-svn: 102664
* When determining a standard conversion sequence involves resolving theDouglas Gregor2010-04-293-51/+46
| | | | | | | | | | | | | | | | | | | | | address of an overloaded function (or function template), perform that resolution prior to determining the implicit conversion sequence. This resolution is not part of the implicit conversion sequence itself. Previously, we would always consider this resolution to be a function pointer decay, which was a lie: there might be an explicit & in the expression, in which case decay should not occur. This caused the CodeGen assertion in PR6973 (where we created a pointer to a pointer to a function when we should have had a pointer to a function), but it's likely that there are corner cases of overload resolution where this would have failed. Cleaned up the code involved in determining the type that will produced afer resolving the overloaded function reference, and added an assertion to make sure the result is correct. Fixes PR6973. llvm-svn: 102650
* Properties cannot be synthesized by-dafult inFariborz Jahanian2010-04-291-1/+1
| | | | | | | categories. Issue usual warnings instead of confusing error message. Radar 7920807 llvm-svn: 102645
* Use clang::VarDecl name instead of llvm::GlobalVariable name.Devang Patel2010-04-291-1/+1
| | | | | | llvm::GLobalVariable name may not match user visibile name for function static variables. llvm-svn: 102644
* Start stamping out the __builtin_neon stuff.Nate Begeman2010-04-291-25/+94
| | | | llvm-svn: 102638
OpenPOWER on IntegriCloud