summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix rdar://5905347 a crash on invalid builtin, due to theChris Lattner2008-05-051-4/+16
| | | | | | params not getting installed for builtins when synthesized. llvm-svn: 50676
* Add support for -Wimplicit-function-declaration, rdar://5907433Chris Lattner2008-05-051-2/+3
| | | | llvm-svn: 50672
* Replace Sema::CheckInitializerListTypes() with a helper class ↵Steve Naroff2008-05-011-0/+5
| | | | | | | (InitListChecker) that synthesizes implicit InitListExpr's when appropriate (see InitListExpr comments in Expr.h for more details). I also moved the code to SemaInit.cpp, to help reduce clutter in SemaDecl.cpp. NOTE: This work is incomplete and still fails many tests (as a result, it isn't enabled yet). Nevertheless, I wanted to check it in so I can work on it from home. llvm-svn: 50544
* Implicitly defined functions were getting the DeclContext of the function ↵Argyrios Kyrtzidis2008-05-011-7/+9
| | | | | | | | where they appeared, causing the bug: http://llvm.org/bugs/show_bug.cgi?id=2266. Fix it by making implicitly defined functions get the DeclContext of translation unit. llvm-svn: 50538
* fix 'var unused' warning.Chris Lattner2008-04-301-2/+2
| | | | llvm-svn: 50484
* Parsing of namespaces:Argyrios Kyrtzidis2008-04-271-35/+46
| | | | | | | | | -NamespaceDecl for the AST -Checks for name clashes between namespaces and tag/normal declarations. This commit doesn't implement proper name lookup for namespaces. llvm-svn: 50321
* initial support for recognizing __transparent_union__ attributesNuno Lopes2008-04-251-0/+26
| | | | | | comments on the ML will follow llvm-svn: 50262
* "This patch renames Chris Lattner2008-04-221-4/+4
| | | | | | | | | | | DeclContext *CtxDecl -> DeclContext *DeclCtx DeclContext *CD -> DeclContext *DC It makes the code more consistent." Patch by Zhongxing Xu! llvm-svn: 50105
* Clean up handling of function redeclarationsDouglas Gregor2008-04-211-9/+25
| | | | llvm-svn: 50021
* OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.Nate Begeman2008-04-181-7/+7
| | | | llvm-svn: 49942
* fix __attribute__(format) for struct function pointer fieldsNuno Lopes2008-04-181-3/+7
| | | | llvm-svn: 49938
* Use TranslationUnitDecl as DeclContext of builtin functions.Argyrios Kyrtzidis2008-04-171-1/+2
| | | | llvm-svn: 49856
* Addition of TranslationUnitDecl to the AST:Argyrios Kyrtzidis2008-04-171-2/+6
| | | | | | | | -Added TranslationUnitDecl class to serve as top declaration context -ASTContext gets a TUDecl member and a getTranslationUnitDecl() function -All ScopedDecls get the TUDecl as DeclContext when declared at global scope llvm-svn: 49855
* Remove FileVarDecl and BlockVarDecl. They are replaced by ↵Steve Naroff2008-04-151-31/+27
| | | | | | | | VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl(). This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it). llvm-svn: 49748
* Introduce support for finding class and enum names via ordinary name lookup ↵Douglas Gregor2008-04-131-4/+14
| | | | | | in C++ llvm-svn: 49621
* This patch is just the easy part of the class names patch, whichChris Lattner2008-04-131-1/+1
| | | | | | | | | | | | | | | | allows the parsing of "class" in addition to "struct" and "union" to declare a record. So this patch allows: class C { }; class C c1; But it does not contain the lookup bits, so this won't work yet: C c2; Patch by Doug Gregor! llvm-svn: 49613
* Added PushOnScopeChains method to Sema, that adds a decl to both the ↵Argyrios Kyrtzidis2008-04-121-20/+16
| | | | | | IdResolver and the Scope. llvm-svn: 49567
* Minor changes per Chris L's review.Fariborz Jahanian2008-04-111-12/+9
| | | | llvm-svn: 49539
* Switch sema to maintaining its own scope chain information for variableChris Lattner2008-04-111-50/+18
| | | | | | | shadowing, instead of threading it through the AST. This patch contributed by Argiris Kirtzidis! llvm-svn: 49520
* Patch for:Fariborz Jahanian2008-04-101-22/+59
| | | | | | | | 1) objc ivar processing is split out of ActOnField into its own ActOnIvar method. 2) the new objc ivar action takes visibility info directly, eliminating AllVisibilities in ParseObjCClassInstanceVariables. llvm-svn: 49506
* typedef void T;Chris Lattner2008-04-101-3/+3
| | | | | | | | void f(T); is only invalid in C++ mode, not C89 mode. llvm-svn: 49460
* Several improvements from Doug Gregor related to defaultChris Lattner2008-04-101-6/+10
| | | | | | argument handling. I'll fix up the c89 (void) thing next. llvm-svn: 49459
* Add support for C++ default arguments, and rework Parse-Sema Chris Lattner2008-04-081-61/+163
| | | | | | | | interaction for function parameters, fixing PR2046. Patch by Doug Gregor! llvm-svn: 49369
* remove the Decl::getCanonicalType() method.Chris Lattner2008-04-061-4/+5
| | | | llvm-svn: 49295
* Start switching clients over from CT.getCanonicalType() to ↵Chris Lattner2008-04-061-2/+2
| | | | | | | | Context.getCanonicalType(CT) for PR2189. While I'm at it, clean up a bit of maxIntegerType. llvm-svn: 49292
* This patch contains these changes:Chris Lattner2008-04-061-9/+9
| | | | | | | | | | -Renamed ContextDecl -> DeclContext -Removed DeclContext pointer from FieldDecl -EnumDecl inherits from DeclContext, instead of TagDecl Patch by Argiris Kirtzidis! llvm-svn: 49261
* Add explicit support for diagnosing implicit function decls.Steve Naroff2008-04-041-3/+11
| | | | | | Without this, the diagnostic is very confusing. The diag is now consistent with gcc as well. llvm-svn: 49214
* Introduce ContextDecl, patch by Argiris Kirtzidis!Chris Lattner2008-04-041-13/+33
| | | | | | | | | | | -Added ContextDecl (no TranslationUnitDecl) -ScopedDecl class has a ContextDecl member -FieldDecl class has a ContextDecl member, so that a Field or a ObjCIvar can be traced back to their RecordDecl/ObjCInterfaceDecl easily -FunctionDecl, ObjCMethodDecl, TagDecl, ObjCInterfaceDecl inherit from ContextDecl. With TagDecl as ContextDecl, enum constants have a EnumDecl as their context. -Moved Decl class to a "DeclBase.h" along with ContextDecl class -CurContext is handled by Sema llvm-svn: 49208
* Change ObjCInterfaceDecl to inherit from NamedDecl (not TypeDecl). While ↵Steve Naroff2008-04-021-12/+7
| | | | | | | | ObjCInterfaceDecl is arguably a TypeDecl, it isn't a ScopedDecl. Since TypeDecl's are scoped, it makes sense to simply treat them as NamedDecl's. I could have fiddled a bit more with the hierarchy (in terms of creating a non-scoped TypeDecl), however this probably isn't worth the effort. I also finished unifying access to scope decl change by converting Sema::getObjCInterfaceDecl() to use Sema::LookupDecl(). This is much cleaner now:-) llvm-svn: 49107
* Two changes to Sema::LookupDecl() interface. Steve Naroff2008-04-021-34/+18
| | | | | | | | | | | (1) Remove IdLoc (it's never used). (2) Add a bool to enable/disable lazy builtin creaation (defaults to true). This enables us to use LookupDecl() in Sema::isTypeName(), which is also part of this commit. To make this work, I changed isTypeName() to be a non-const member function. I'm not happy with this, however I fiddled with making LookupDecl() and friends const and it got ugly pretty quickly. We can certainly add it back if/when someone has time to fiddle with it. For now, I thought this simplification was more important than retaining the const-ness. llvm-svn: 49087
* Fix several bugs in array -> pointer decomposition.Chris Lattner2008-04-021-3/+2
| | | | | | | | | | | | | | | | First, we got several CVR propagation cases wrong, which Eli pointed out in PR2039. Second, we didn't propagate address space qualifiers correctly, leading to incorrect lowering of code in CodeGen/address-space.c. Third, we didn't uniformly propagate the specifier in the array to the pointer ("int[restrict 4]" -> "int *restrict"). This adds an ASTContext::getArrayDecayedType member that handles the non-trivial logic for this seemingly simple operation. llvm-svn: 49078
* Fix PR2017 and silence some bogus errors.Chris Lattner2008-04-021-3/+4
| | | | llvm-svn: 49068
* Fix a comment typo and add a couple suggestions from Chris.Steve Naroff2008-04-021-2/+2
| | | | llvm-svn: 49066
* Fairly large "cleaup" related to changing ObjCCompatibleAliasDecl superclass ↵Steve Naroff2008-04-011-37/+44
| | | | | | | | | | | | | (to inherit from NamedDecl, instead of ScopedDecl). - Added a DenseMap to associate an IdentifierInfo with the ObjCCompatibleAliasDecl. - Renamed LookupScopedDecl->LookupDecl and changed it's return type to Decl. Also added lookup for ObjCCompatibleAliasDecl's. - Removed Sema::LookupInterfaceDecl(). Converted clients to used LookupDecl(). - Some minor indentation changes. Will deal with ObjCInterfaceDecl and getObjCInterfaceDecl() in a separate commit... llvm-svn: 49058
* Alloc redeclaration of typedefs within ExternCSystemHeaderDir's AND ↵Steve Naroff2008-03-261-3/+4
| | | | | | SystemHeaderDir's. llvm-svn: 48841
* allow the format attribute to be specified in function pointer prototypesNuno Lopes2008-03-251-8/+24
| | | | | | # this is my first commit here, so please be gentle :) llvm-svn: 48807
* Extend QualType::getAddressSpace to do the right thing for array types, and inNate Begeman2008-03-251-8/+3
| | | | | | the future, RecordTypes. llvm-svn: 48784
* Fix http://llvm.org/bugs/show_bug.cgi?id=2161.Steve Naroff2008-03-191-2/+13
| | | | llvm-svn: 48568
* hoist a bunch of casting.Chris Lattner2008-03-161-6/+7
| | | | llvm-svn: 48409
* Add create methods for ObjCIvarDecl and ObjCInterfaceDeclChris Lattner2008-03-161-1/+1
| | | | llvm-svn: 48408
* switch the rest of the C decl classes to do their Chris Lattner2008-03-161-3/+3
| | | | | | allocation through ASTContext. llvm-svn: 48403
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+2297
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
OpenPOWER on IntegriCloud