summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Keep track of the Expr used to describe the size of an array type,Douglas Gregor2009-07-061-3/+12
| | | | | | from Enea Zaffanella! llvm-svn: 74831
* De-ASTContext-ify DeclContext.Argyrios Kyrtzidis2009-06-301-12/+12
| | | | | | | 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-301-1/+1
| | | | | | | | 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-301-35/+30
| | | | | | | | | 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
* Renamed MarcDestructorReferenced -> MarkDestructorReferencedFariborz Jahanian2009-06-271-1/+1
| | | | llvm-svn: 74386
* Patch to mark destructors when they are used.Fariborz Jahanian2009-06-261-1/+5
| | | | llvm-svn: 74359
* Improved semantic analysis and AST respresentation for functionDouglas Gregor2009-06-251-11/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | templates. For example, this now type-checks (but does not instantiate the body of deref<int>): template<typename T> T& deref(T* t) { return *t; } void test(int *ip) { int &ir = deref(ip); } Specific changes/additions: * Template argument deduction from a call to a function template. * Instantiation of a function template specializations (just the declarations) from the template arguments deduced from a call. * FunctionTemplateDecls are stored directly in declaration contexts and found via name lookup (all forms), rather than finding the FunctionDecl and then realizing it is a template. This is responsible for most of the churn, since some of the core declaration matching and lookup code assumes that all functions are FunctionDecls. llvm-svn: 74213
* Set the end range location of a FunctionDecl to the right paren.Argyrios Kyrtzidis2009-06-251-0/+3
| | | | llvm-svn: 74195
* Make sure that the template parameter lists get from the parser down to ↵Douglas Gregor2009-06-241-0/+2
| | | | | | ActOnFunctionDeclarator for function template definitions llvm-svn: 74040
* Support for [class.local]p4.Anders Carlsson2009-06-241-0/+9
| | | | llvm-svn: 74030
* When declaring a function template, create a FunctionTemplateDecl nodeDouglas Gregor2009-06-241-0/+20
| | | | | | and associate it with the FunctionDecl. llvm-svn: 74028
* Start propagating template parameter lists to the right places toDouglas Gregor2009-06-231-2/+18
| | | | | | | handle function templates. There's no actual code for function templates yet, but at least we complain about typedef templates. llvm-svn: 74021
* Eliminate DeclPtrTy() arguments to ActOnDeclarator that are just a very, ↵Douglas Gregor2009-06-231-1/+1
| | | | | | very weird way to pass "false". No functionality change llvm-svn: 74007
* Remove ImplicitMustBeDefined, use universal 'Used' flagFariborz Jahanian2009-06-221-4/+1
| | | | | | instead. Do the implicit default ctor checking in MarkDeclarationReferenced. llvm-svn: 73888
* Parsing and AST support for using declarations, from John Thompson!Douglas Gregor2009-06-201-2/+3
| | | | llvm-svn: 73812
* Keep track of when declarations are "used" according to C andDouglas Gregor2009-06-191-0/+13
| | | | | | | | | | | | C++. This logic is required to trigger implicit instantiation of function templates and member functions of class templates, which will be implemented separately. This commit includes support for -Wunused-parameter, printing warnings for named parameters that are not used within a function/Objective-C method/block. Fixes <rdar://problem/6505209>. llvm-svn: 73797
* Patch for implementation of C++'s object model. This isFariborz Jahanian2009-06-191-2/+6
| | | | | | work in progress. llvm-svn: 73782
* Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.Douglas Gregor2009-06-181-29/+36
| | | | llvm-svn: 73702
* Diagnose class members that shadow a template parameter. FixesDouglas Gregor2009-06-171-0/+8
| | | | | | | | | | <rdar://problem/6952203>. To do this, we actually remove a not-quite-correct optimization in the C++ name lookup routines. We'll revisit this optimization for the general case once more C++ is working. llvm-svn: 73659
* Fix some erroneous comments due to trigger-happy copy&paste.Argyrios Kyrtzidis2009-06-171-5/+2
| | | | | | No functionality change. llvm-svn: 73657
* Factor out some common code into ↵Argyrios Kyrtzidis2009-06-171-0/+24
| | | | | | Sema::EnterDeclaratorContext/ExitDeclaratorContext. llvm-svn: 73655
* Move CXXMethodDecl::OutOfLineDefinition into Decl::OutOfLine.Argyrios Kyrtzidis2009-06-171-1/+1
| | | | llvm-svn: 73651
* Support dependent extended vector types and template instantiationDouglas Gregor2009-06-171-8/+9
| | | | | | thereof. Patch by Anders Johnsen! llvm-svn: 73641
* move GetBuiltinType from Builtin::Context to ASTContext.Chris Lattner2009-06-141-4/+4
| | | | llvm-svn: 73316
* PR4350: Make sure we don't create invalid printf attributes. This isn't Eli Friedman2009-06-101-3/+5
| | | | | | | | visible anywhere normally because the printf format checks for this case, and we don't print out attribute values anywhere. Original patch by Roberto Bagnara. llvm-svn: 73157
* Use of DeclContext for objc's ivars. No functionalityFariborz Jahanian2009-06-051-9/+26
| | | | | | change. More to follow. llvm-svn: 72951
* Address review comments for #pragma weak.Eli Friedman2009-06-051-0/+1
| | | | llvm-svn: 72926
* Start of a Sema implementation for #pragma weak. This isn't really theEli Friedman2009-06-051-0/+30
| | | | | | right approach, but I'm still not sure what the best way to go about this is. llvm-svn: 72912
* Fix up this compatibility hack to be more compatible with gcc.Eli Friedman2009-06-041-3/+4
| | | | llvm-svn: 72901
* PR4287: allow a variadic prototype to make a subsequent K&R style Eli Friedman2009-06-011-11/+14
| | | | | | | | definition variadic. I'm not completely sure it's legal, but the standard can be interpreted as making it legal, and gcc seems to think it's legal, so I didn't add an extension warning. llvm-svn: 72689
* Disallow exception specs on typedefs.Sebastian Redl2009-05-311-1/+2
| | | | llvm-svn: 72664
* AddInitializerToDecl needs to take a full expression.Anders Carlsson2009-05-301-2/+2
| | | | llvm-svn: 72640
* Remove VarDecl from CheckInitializerTypes now that CXXConstructExpr doesn't ↵Anders Carlsson2009-05-301-1/+1
| | | | | | need to take a VarDecl anymore. (It still does, but it won't for long) llvm-svn: 72630
* Add a member lookup criteria constructor for searching for overridden ↵Anders Carlsson2009-05-301-13/+1
| | | | | | virtual member functions. Use this instead of regular name lookup when checking for overriding functions so we will see declarations that would otherwise be hidden. Fixes 6902298. llvm-svn: 72601
* Refactor and clean up the AST printer, so that it uses a DeclVisitor,Douglas Gregor2009-05-301-2/+4
| | | | | | | | | walks through DeclContexts properly, and prints more of the information available in the AST. The functionality is still available via -ast-print, -ast-dump, etc., and also via the new member functions Decl::dump() and Decl::print(). llvm-svn: 72597
* Reject incomplete types in exception specs.Sebastian Redl2009-05-291-1/+1
| | | | llvm-svn: 72580
* Now that we have declared/defined tag types within DeclGroups,Douglas Gregor2009-05-291-1/+1
| | | | | | | | | | | | | instantiation of tags local to member functions of class templates (and, eventually, function templates) works when the tag is defined as part of the decl-specifier-seq, e.g., struct S { T x, y; } s1; Also, make sure that we don't try to default-initialize a dependent type. llvm-svn: 72568
* If a declarator group declares a type, make sure to add that declaration Eli Friedman2009-05-291-2/+6
| | | | | | to the DeclGroup. llvm-svn: 72559
* When we parse a tag specifier, keep track of whether that tagDouglas Gregor2009-05-281-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specifier resulted in the creation of a new TagDecl node, which happens either when the tag specifier was a definition or when the tag specifier was the first declaration of that tag type. This information has several uses, the first of which is implemented in this commit: 1) In C++, one is not allowed to define tag types within a type specifier (e.g., static_cast<struct S { int x; } *>(0) is ill-formed) or within the result or parameter types of a function. We now diagnose this. 2) We can extend DeclGroups to contain information about any tags that are declared/defined within the declaration specifiers of a variable, e.g., struct Point { int x, y, z; } p; This will help improve AST printing and template instantiation, among other things. 3) For C99, we can keep track of whether a tag type is defined within the type of a parameter, to properly cope with cases like, e.g., int bar(struct T2 { int x; } y) { struct T2 z; } We can also do similar things wherever there is a type specifier, e.g., to keep track of where the definition of S occurs in this legal C99 code: (struct S { int x, y; } *)0 llvm-svn: 72555
* Reintroduce the home for exception specs, and make Sema fill it. However, ↵Sebastian Redl2009-05-271-0/+1
| | | | | | keep the spec out of the canonical type this time. Net effect is currently nothing, because the spec isn't checked anywhere. llvm-svn: 72498
* Add some more tests for instantiation of declaration references. Also,Douglas Gregor2009-05-271-1/+3
| | | | | | improve some error recovery with explicit template instantiation. llvm-svn: 72484
* Create CXXConstructExprs when constructing via copy initialization.Anders Carlsson2009-05-271-1/+1
| | | | llvm-svn: 72474
* When evaluating a VarDecl as a constant or determining whether it isDouglas Gregor2009-05-261-2/+2
| | | | | | | | an integral constant expression, maintain a cache of the value and the is-an-ICE flag within the VarDecl itself. This eliminates exponential-time behavior of the Fibonacci template metaprogram. llvm-svn: 72428
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-211-6/+7
| | | | llvm-svn: 72210
* Simplify struct/class tag mismatch warning, per Sebastian's suggestionDouglas Gregor2009-05-181-1/+0
| | | | llvm-svn: 72027
* Add OldMD to the list of methods NewMD overridesAnders Carlsson2009-05-161-6/+2
| | | | llvm-svn: 71969
* Fix another case where the extern-ness of extern "C" wasn't being captured. Anders Carlsson2009-05-161-1/+2
| | | | | | This makes me think that we should make hasExternalStorage perform this check... llvm-svn: 71962
* Avoid calling mergeTypes in C++. I think these are the correct C++ Eli Friedman2009-05-161-1/+7
| | | | | | | | | | | | alternatives, but please correct me if I'm wrong. I eventually plan to assert in mergeTypes that we aren't in C++ mode because composite types are fundamentally not a part of C++. The remaining callers for code in the regression tests are Sema::WarnConflictingTypedMethods and CodeGenFunction::EmitFunctionProlog; I'm not quite sure what the correct approach is for those callers. llvm-svn: 71946
* PR2044: reject declarations of functions returning variably modified Eli Friedman2009-05-161-0/+7
| | | | | | types. llvm-svn: 71941
* Implement a FIXME, we now pass in the locations of the braces for enums.Mike Stump2009-05-161-3/+2
| | | | llvm-svn: 71930
OpenPOWER on IntegriCloud