summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Add SourceLocations to ObjCClassDecl for the class identifiers referenced by ↵Ted Kremenek2009-11-181-5/+3
| | | | | | @class. llvm-svn: 89170
* Finish code completion for Objective-C message sendsDouglas Gregor2009-11-181-14/+32
| | | | llvm-svn: 89168
* Rename Objective-C message send completion functions to indicate that we're ↵Douglas Gregor2009-11-172-12/+11
| | | | | | referring to message sends llvm-svn: 89164
* Refactor code-completion support for message sends, collecting theDouglas Gregor2009-11-171-84/+97
| | | | | | | | | code to find and add Objective-C methods (starting at an ObjCContainerDecl) into a single, static function. Also, make sure that we search into the implementations of classes and categories to find even more methods. llvm-svn: 89163
* Pass source locations of identifiers referenced by @class through ↵Ted Kremenek2009-11-172-2/+4
| | | | | | Action::ActOnForwardClassDeclaration(). llvm-svn: 89162
* Do not register ObjCInterfaceDecls implicitly created by @class in theTed Kremenek2009-11-171-1/+14
| | | | | | | | | | | | | | | | | | current DeclContext. These "imaginary" declarations pose issues for clients searching DeclContext for actual declarations. Instead, register them for name lookup, and add the ObjCInterfaceDecl later to the DeclContext when we hit an actual @interface declaration. This also fixes a bug where the invariant that the Decls in a DeclContext are sorted in order of their appearance is no longer violated. What could happen is that an @class causes an ObjCInterfaceDecl to get added first to the DeclContext, then the ObjCClassDecl itself is added, and then later the SourceLocation of the ObjCInterfaceDecl is updated with the correct location (which is later in the file). This breaks an assumed invariant in ResolveLocation.cpp (and possibly other clients). llvm-svn: 89160
* Improve location information when adding conversion candidatesDouglas Gregor2009-11-171-2/+2
| | | | llvm-svn: 89141
* Start support of weak_import objective-c classes.Fariborz Jahanian2009-11-172-1/+3
| | | | | | (Radar 6815425). llvm-svn: 89124
* Adjust format attribute index for implicit object arguments. Fixes PR5521.Sebastian Redl2009-11-172-2/+27
| | | | llvm-svn: 89113
* Implement code completion for Objective-C message sends to "super".Douglas Gregor2009-11-171-2/+53
| | | | llvm-svn: 89112
* Fixes a typo, reported by Doug.Fariborz Jahanian2009-11-171-1/+1
| | | | llvm-svn: 89107
* Augment code-completion results to provide argument names andDouglas Gregor2009-11-171-0/+33
| | | | | | placeholder arguments for Objective-C message sends. llvm-svn: 89103
* StringRef'ify CodeCompletionStringDouglas Gregor2009-11-171-4/+6
| | | | llvm-svn: 89102
* Temporarily unbreak the clang-on-llvm tests. :) Not going to fix unresolvedJohn McCall2009-11-171-9/+1
| | | | | | lookup all in a night. llvm-svn: 89089
* Store "sugared" decls in LookupResults (i.e. decl aliases like using ↵John McCall2009-11-173-48/+53
| | | | | | | | | | | | declarations); strip the sugar off in getFoundDecl() and getAsSingleDecl(), but leave it on for clients like overload resolution who want to use the iterators. Refactor a few pieces of overload resolution to strip off using declarations in a single place. Don't do anything useful with the extra context knowledge yet. llvm-svn: 89061
* Silence some warnings produced by Clang, and add a missing headerDouglas Gregor2009-11-173-3/+3
| | | | llvm-svn: 89051
* Implement template instantiation for using directives, which is dead simple.Douglas Gregor2009-11-171-2/+22
| | | | | | | | Also, make the "don't know how to instantiate a particular kind of declaration" diagnostic nicer, so we don't have to trap Clang in a debugger to figure out what went wrong. llvm-svn: 89050
* Instead of hanging a using declaration's target decls directly off the using John McCall2009-11-176-20/+109
| | | | | | | decl, create shadow declarations and put them in scope like normal. Work in progress. llvm-svn: 89048
* Require the object type of a member access expression ("." or "->") toDouglas Gregor2009-11-172-7/+14
| | | | | | be complete. llvm-svn: 89042
* Unify the way destructor epilogues are generated for synthesized and regular ↵Anders Carlsson2009-11-173-65/+50
| | | | | | destructors. Also fix PR5529. llvm-svn: 89034
* Carry lookup configuration throughout lookup on the LookupResult. GiveJohn McCall2009-11-1711-223/+325
| | | | | | | | | | | | | LookupResult RAII powers to diagnose ambiguity in the results. Other diagnostics (e.g. access control and deprecation) will be moved to automatically trigger during lookup as part of this same mechanism. This abstraction makes it much easier to encapsulate aliasing declarations (e.g. using declarations) inside the lookup system: eventually, lookup will just produce the aliases in the LookupResult, and the standard access methods will naturally strip the aliases off. llvm-svn: 89027
* PR5526: Make sure to set the right cast kinds for the inserted implicit casts.Eli Friedman2009-11-171-2/+2
| | | | llvm-svn: 89023
* Simplify the AST a bit by skipping creating member initializers for membersEli Friedman2009-11-161-8/+14
| | | | | | with a trivial constructor. llvm-svn: 88990
* First part of changes to eliminate problems with cv-qualifiers andDouglas Gregor2009-11-1613-68/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sugared types. The basic problem is that our qualifier accessors (getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at the current QualType and not at any qualifiers that come from sugared types, meaning that we won't see these qualifiers through, e.g., typedefs: typedef const int CInt; typedef CInt Self; Self.isConstQualified() currently returns false! Various bugs (e.g., PR5383) have cropped up all over the front end due to such problems. I'm addressing this problem by splitting each qualifier accessor into two versions: - the "local" version only returns qualifiers on this particular QualType instance - the "normal" version that will eventually combine qualifiers from this QualType instance with the qualifiers on the canonical type to produce the full set of qualifiers. This commit adds the local versions and switches a few callers from the "normal" version (e.g., isConstQualified) over to the "local" version (e.g., isLocalConstQualified) when that is the right thing to do, e.g., because we're printing or serializing the qualifiers. Also, switch a bunch of Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType() expressions over to Context.hasSameUnqualifiedType(T1, T2) llvm-svn: 88969
* Repair broken FindCompositePointerType. Correct early termination condition. ↵Sebastian Redl2009-11-161-12/+14
| | | | | | Get CVR qualifiers from canonical types. Traverse collected qualifiers in reverse order on rebuilding the pointer, so that we don't swap inner and outer qualifiers. That last one fixes PR5509. llvm-svn: 88960
* Fix PR5488: special-case the overloaded arrow operator so that we don't try toEli Friedman2009-11-161-0/+3
| | | | | | treat it as a unary operator. llvm-svn: 88938
* Handle case of missing '@end' in implementation contextFariborz Jahanian2009-11-162-1/+9
| | | | | | | | gracefully, on par with gcc, by: Issuing a warning, doing final sematinc check of its definitions and generating its meta-data. llvm-svn: 88934
* Set the cast kind for a few more code paths.Eli Friedman2009-11-161-2/+8
| | | | llvm-svn: 88893
* Make sure that virtual destructors have delete operators.Anders Carlsson2009-11-153-5/+33
| | | | llvm-svn: 88877
* Deallocation functions must also be static.Anders Carlsson2009-11-151-1/+7
| | | | llvm-svn: 88859
* allocation functions are always static.Anders Carlsson2009-11-151-1/+10
| | | | llvm-svn: 88858
* Factor finding a deallocation function for a record type out into a separate ↵Anders Carlsson2009-11-152-40/+65
| | | | | | function. llvm-svn: 88857
* If we find a deallocation function in the class scope, but it is a placement ↵Anders Carlsson2009-11-151-1/+16
| | | | | | function we should not look for a deallocation function in the global scope. llvm-svn: 88851
* When performing a static downcast as part of a static_cast, make sureDouglas Gregor2009-11-151-12/+17
| | | | | | | | | | that we're dealing with canonical types like the documentation say (yay, CanQualType). Alas, this is another instance where using getQualifiers() on a non-canonical QualType got us in trouble. Good news: with this fix, Clang can now parse all of its own headers! llvm-svn: 88848
* Don't gratuitously mark the default constructors of base or member ↵Douglas Gregor2009-11-151-22/+4
| | | | | | initializers as used llvm-svn: 88847
* When adding the underlying declaration of a decl to a lookup-resultsDouglas Gregor2009-11-151-1/+14
| | | | | | | | | set, expand overloaded function declarations. Long-term, this should actually be done by the name-lookup code rather than here, but this part of the code (involving using declarations) is getting a makeover now and the test-case is useful. llvm-svn: 88846
* When looking for operator() to type-check a call to an object of classDouglas Gregor2009-11-151-7/+9
| | | | | | | | | type, use full qualified name lookup rather than the poking the declaration context directly. This makes sure that we see operator()'s in superclasses. Also, move the complete-type check before this name lookup. llvm-svn: 88842
* If any errors have occurred by the time we hit the end of a function body, ↵Douglas Gregor2009-11-151-0/+6
| | | | | | clear out any remaining temporaries so they aren't seen later. llvm-svn: 88834
* Always build a builtin operator expression for the __extension__ unary operator.Anders Carlsson2009-11-141-1/+2
| | | | llvm-svn: 88811
* - Have TryStaticImplicitCast set the cast kind to NoOp when binding a ↵Sebastian Redl2009-11-145-57/+80
| | | | | | | | | reference. CheckReferenceInit already inserts implicit casts to the necessary types. This fixes an assertion in CodeGen for some casts and brings a fix for PR5453 close, if I understand that bug correctly. - Also, perform calculated implicit cast sequences if they're determined to work. This finally diagnoses static_cast to ambiguous or implicit bases and fixes two long-standing fixmes in the test case. For the C-style cast, this requires propagating the access check suppression pretty deep into other functions. - Pass the expressions for TryStaticCast and TryStaticImplicitCast by reference. This should lead to a better AST being emitted for such casts, and also fixes a memory leak, because CheckReferenceInit and PerformImplicitConversion wrap the node passed to them. These wrappers were previously lost. llvm-svn: 88809
* PR5462: Don't run off the edge of the argument array for vararg handlingEli Friedman2009-11-141-1/+1
| | | | | | when there are more parameters in the prototype than arguments to the call. llvm-svn: 88759
* Fix for PR5489: don't skip the complete type requrirement for variableEli Friedman2009-11-141-2/+7
| | | | | | definitions just because the type happens to be an array type. llvm-svn: 88752
* When type-checking a static cast (or the static_cast part of a C-styleDouglas Gregor2009-11-143-46/+125
| | | | | | | | cast) that is converting to a class type, enumerate its constructors as in any other direct initialization. This ensures that we get the proper conversion sequence. llvm-svn: 88751
* Diagnose ambiguity of operator delete and operator delete[]. Sebastian, ↵Anders Carlsson2009-11-141-1/+6
| | | | | | please review. llvm-svn: 88747
* If we attempt to add a constructor template specialization that looksDouglas Gregor2009-11-144-22/+40
| | | | | | | | | | | | like a copy constructor to the overload set, just ignore it. This ensures that we don't try to use such a constructor as a copy constructor *without* triggering diagnostics at the point of declaration. Note that we *do* diagnose such copy constructors when explicitly written by the user (e.g., as an explicit specialization). llvm-svn: 88733
* Revert r88718, which does NOT solve the ↵Douglas Gregor2009-11-134-37/+19
| | | | | | constructor-template-as-copy-constructor issue. Big thanks to John for finding this llvm-svn: 88724
* Template argument deduction of a non-type template parameter from aDouglas Gregor2009-11-131-2/+41
| | | | | | template argument. llvm-svn: 88722
* A constructor template cannot be instantiated to a copyDouglas Gregor2009-11-134-19/+37
| | | | | | constructor. Make sure that such declarations can never be formed. llvm-svn: 88718
* Clear temporaries in more places.Anders Carlsson2009-11-131-0/+9
| | | | llvm-svn: 88687
* Fix bug Doug noticed.Anders Carlsson2009-11-132-0/+15
| | | | llvm-svn: 88679
OpenPOWER on IntegriCloud