summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Fix a problem with false diagnostics when comparing distinct NULL pointer ↵Douglas Gregor2009-07-061-7/+13
| | | | | | types, from David Majnemer llvm-svn: 74850
* Keep track of the Expr used to describe the size of an array type,Douglas Gregor2009-07-066-18/+47
| | | | | | from Enea Zaffanella! llvm-svn: 74831
* Catch function redeclarations with incompatible exception specifications.Sebastian Redl2009-07-043-0/+57
| | | | llvm-svn: 74787
* Patch to allocate list of bases in CXXRecordDeclFariborz Jahanian2009-07-021-1/+1
| | | | | | using ASTContxt allocation. llvm-svn: 74717
* Add support for retrieving the Doxygen comment associated with a givenDouglas Gregor2009-07-022-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | declaration in the AST. The new ASTContext::getCommentForDecl function searches for a comment that is attached to the given declaration, and returns that comment, which may be composed of several comment blocks. Comments are always available in an AST. However, to avoid harming performance, we don't actually parse the comments. Rather, we keep the source ranges of all of the comments within a large, sorted vector, then lazily extract comments via a binary search in that vector only when needed (which never occurs in a "normal" compile). Comments are written to a precompiled header/AST file as a blob of source ranges. That blob is only lazily loaded when one requests a comment for a declaration (this never occurs in a "normal" compile). The indexer testbed now supports comment extraction. When the -point-at location points to a declaration with a Doxygen-style comment, the indexer testbed prints the associated comment block(s). See test/Index/comments.c for an example. Some notes: - We don't actually attempt to parse the comment blocks themselves, beyond identifying them as Doxygen comment blocks to associate them with a declaration. - We won't find comment blocks that aren't adjacent to the declaration, because we start our search based on the location of the declaration. - We don't go through the necessary hops to find, for example, whether some redeclaration of a declaration has comments when our current declaration does not. Similarly, we don't attempt to associate a \param Foo marker in a function body comment with the parameter named Foo (although that is certainly possible). - Verification of my "no performance impact" claims is still "to be done". llvm-svn: 74704
* Use Destroy for member initializer list clean up.Fariborz Jahanian2009-07-011-1/+6
| | | | | | Per Doug's comments. Doug please review. llvm-svn: 74666
* Keep track of more information within the template instantiation stack, e.g.,Douglas Gregor2009-07-014-31/+107
| | | | | | | | | | | | | | by distinguishing between substitution that occurs for template argument deduction vs. explicitly-specifiad template arguments. This is used both to improve diagnostics and to make sure we only provide SFINAE in those cases where SFINAE should apply. In addition, deal with the sticky issue where SFINAE only considers substitution of template arguments into the *type* of a function template; we need to issue hard errors beyond this point, as test/SemaTemplate/operator-template.cpp illustrates. llvm-svn: 74651
* Patch to implement template types in ctor-initializer list.Fariborz Jahanian2009-07-012-3/+6
| | | | | | Also has fix for bugzilla-4469. llvm-svn: 74631
* Rework Sema::CheckConditionalOperands(). No functionality change.Steve Naroff2009-07-011-98/+130
| | | | | | | | | This was necessary to simplify some other changes I'm making (wrt ObjC type cleanups). The idea is to separate the constraint checks for block pointers, ObjC pointers, and C pointers (the previous code combined them into one clause). Note: This routine will be further simplified when I integrate the ObjC type cleanups (forthcoming). llvm-svn: 74604
* Cope with explicitly-specified function template arguments when thereDouglas Gregor2009-07-015-12/+39
| | | | | | | are fewer template arguments than there are template parameters for that function. llvm-svn: 74578
* When explicit template arguments are provided for a function call,Douglas Gregor2009-06-304-27/+167
| | | | | | | | | substitute those template arguments into the function parameter types prior to template argument deduction. There's still a bit of work to do to make this work properly when only some of the template arguments are specified. llvm-svn: 74576
* Patch to support optional nested-name-specifier in in ctor-initializerFariborz Jahanian2009-06-302-15/+18
| | | | | | list. llvm-svn: 74571
* Preliminary parsing and ASTs for template-ids that refer to functionDouglas Gregor2009-06-304-12/+92
| | | | | | | templates, such as make<int&>. These template-ids are only barely functional for function calls; much more to come. llvm-svn: 74563
* Diagnose multiple initialization of anonymous unionFariborz Jahanian2009-06-301-1/+8
| | | | | | fields in the ctor-initializer list. llvm-svn: 74554
* More diagnostics related to initialization of direct basesFariborz Jahanian2009-06-301-0/+9
| | | | | | in ctor-initializer list. llvm-svn: 74541
* When recursively instantiating function templates, keep track of theDouglas Gregor2009-06-303-8/+34
| | | | | | | | | | | | instantiation stack so that we provide a full instantiation backtrace. Previously, we performed all of the instantiations implied by the recursion, but each looked like a "top-level" instantiation. The included test case tests the previous fix for the instantiation of DeclRefExprs. Note that the "instantiated from" diagnostics still don't tell us which template arguments we're instantiating with. llvm-svn: 74540
* Compute ending of iterator in for-loop once.Fariborz Jahanian2009-06-301-16/+12
| | | | llvm-svn: 74533
* Refactor ActOnDeclarationNameExpr into a "parsing action" part and aDouglas Gregor2009-06-304-54/+72
| | | | | | | | | | | "semantic analysis" part. Use the "semantic analysis" part when performing template instantiation on a DeclRefExpr, rather than an ad hoc list of rules to construct DeclRefExprs from the instantiation. A test case for this change will come in with a large commit, which illustrates what I was actually trying to work on. llvm-svn: 74528
* Implement PR4175, catching some questionable comparisons. Patch byChris Lattner2009-06-301-2/+19
| | | | | | David Majnemer! llvm-svn: 74513
* De-ASTContext-ify DeclContext.Argyrios Kyrtzidis2009-06-3015-228/+210
| | | | | | | Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating". Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit. llvm-svn: 74506
* Remove the ASTContext parameter from the getBody() methods of Decl and ↵Argyrios Kyrtzidis2009-06-305-8/+8
| | | | | | | | subclasses. Timings showed no significant difference before and after the commit. llvm-svn: 74504
* Remove the ASTContext parameter from the attribute-related methods of Decl.Argyrios Kyrtzidis2009-06-3010-114/+104
| | | | | | | | | The implementations of these methods can Use Decl::getASTContext() to get the ASTContext. This commit touches a lot of files since call sites for these methods are everywhere. I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it. llvm-svn: 74501
* Take care of Chris's comments.Fariborz Jahanian2009-06-301-14/+15
| | | | llvm-svn: 74486
* Make an error message more clear.Anders Carlsson2009-06-301-1/+1
| | | | llvm-svn: 74481
* A more detailed diagnosis of ill-formed ctor-initializerFariborz Jahanian2009-06-301-8/+15
| | | | | | list. llvm-svn: 74480
* Improvements to decltype. We now don't crash anymore when the expr is an ↵Anders Carlsson2009-06-293-3/+23
| | | | | | overloaded function decl. llvm-svn: 74472
* Diagnose multiple initialzation of data-member/base Fariborz Jahanian2009-06-291-0/+18
| | | | | | in the ctor-initializer list. More to come. llvm-svn: 74465
* Remove some dead codeAnders Carlsson2009-06-291-3/+0
| | | | llvm-svn: 74460
* Keep track of function template specializations, to eliminateDouglas Gregor2009-06-292-10/+40
| | | | | | | redundant, implicit instantiations of function templates and provide a place where we can hang function template specializations. llvm-svn: 74454
* Fix the FloatingLiteral API to take the isexact flag by value instead ofChris Lattner2009-06-291-2/+2
| | | | | | by pointer. llvm-svn: 74432
* Remove ASTContext::getObjCQualifiedIdType().Steve Naroff2009-06-291-4/+4
| | | | | | Convert clients to use ASTContext::getObjCObjectPointerType(). llvm-svn: 74424
* Move the check for vprintf* functions inside of SemaCheckStringLiteral. ↵Anders Carlsson2009-06-281-25/+22
| | | | | | Fixes PR4470. llvm-svn: 74413
* Fix incorrect AST's being produced, noticed by Eli.Nate Begeman2009-06-281-10/+4
| | | | | | The issue this was working around is no longer present in TOT clang. llvm-svn: 74411
* OpenCL 1.0 support: Nate Begeman2009-06-281-29/+46
| | | | | | | | Handle rules for ExtVector + ExtVector and ExtVector + Scalar operations. Fix problem Eli noticed where we were allowing pointer types to be splatted to vector elements. llvm-svn: 74404
* Implement feedback from Eli re: the purpose of lax vector conversionsNate Begeman2009-06-271-13/+2
| | | | llvm-svn: 74397
* Improve support for overloaded operator templates.Douglas Gregor2009-06-273-19/+42
| | | | llvm-svn: 74390
* Renamed MarcDestructorReferenced -> MarkDestructorReferencedFariborz Jahanian2009-06-274-6/+6
| | | | llvm-svn: 74386
* Fix a bogus error overloading an operator where the only class Eli Friedman2009-06-271-2/+3
| | | | | | parameter has a dependent type. llvm-svn: 74380
* Implement support for the format_arg attribute. Fixes PR4442.Anders Carlsson2009-06-271-0/+21
| | | | llvm-svn: 74369
* Make it possible for using decls to point to operators. Fixes PR4441.Anders Carlsson2009-06-272-3/+10
| | | | llvm-svn: 74362
* Patch to mark destructors when they are used.Fariborz Jahanian2009-06-265-7/+84
| | | | llvm-svn: 74359
* Set the rest of the flags we need to perform template argumentDouglas Gregor2009-06-261-5/+28
| | | | | | | deduction using a base class of the argument type. No actual functionality change; this is just a hook. llvm-svn: 74356
* During template argument deduction from a function call, allowDouglas Gregor2009-06-261-28/+69
| | | | | | | | deduction from pointer and pointer-to-member types to work even in the presence of a qualification conversion (C++ [temp.deduct.type]p3 bullet 2). llvm-svn: 74354
* More auto work.Anders Carlsson2009-06-261-0/+46
| | | | llvm-svn: 74339
* A little template argument deduction test uncovered an "oops". As partDouglas Gregor2009-06-261-87/+61
| | | | | | | | | | of template instantiation, we were dropping cv-qualifiers on the instantiated type in a few places. This change reshuffles the type-instantiation code a little bit so that there's a single place where we add qualifiers to the instantiated type, so that we won't end up with this same bug in the future. llvm-svn: 74331
* Template argument deduction is no longer responsible for checkingDouglas Gregor2009-06-261-32/+100
| | | | | | | | | | | | | non-dependent parameter types. Instead, class template partial specializations perform a final check of all of the instantiated arguments. This model is cleaner, and works better for function templates where the "final check" occurs during overload resolution. Also, cope with cv-qualifiers when the parameter type was originally a reference type, so that the deduced argument can be more qualified than the transformed argument. llvm-svn: 74323
* Can't have arrays of auto.Anders Carlsson2009-06-261-0/+6
| | | | llvm-svn: 74314
* An auto variable can't appear in its own initializer.Anders Carlsson2009-06-261-0/+6
| | | | llvm-svn: 74312
* Implement enough of the 'auto' keyword so we can claim to support N2546.Anders Carlsson2009-06-261-0/+5
| | | | llvm-svn: 74307
* Improve template argument deduction for reference parameters whenDouglas Gregor2009-06-261-4/+42
| | | | | | | deducing template arguments from a function call. Plus, add a bunch of tests. llvm-svn: 74301
OpenPOWER on IntegriCloud