summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* simplify max type computation by making it return an integer (like Chris Lattner2008-04-061-3/+3
| | | | | | getFloatingTypeOrder) instead of a type. Fix a fixme. llvm-svn: 49297
* minor simplifications/cleanups to type comparisons.Chris Lattner2008-04-061-5/+5
| | | | llvm-svn: 49296
* remove the Decl::getCanonicalType() method.Chris Lattner2008-04-062-5/+7
| | | | 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
* move a semantic check out of the parser into sema.Chris Lattner2008-04-061-3/+22
| | | | llvm-svn: 49273
* This patch contains these changes:Chris Lattner2008-04-064-16/+15
| | | | | | | | | | -Renamed ContextDecl -> DeclContext -Removed DeclContext pointer from FieldDecl -EnumDecl inherits from DeclContext, instead of TagDecl Patch by Argiris Kirtzidis! llvm-svn: 49261
* Fix handling of implicit int, resolving PR2012 and reverting (andChris Lattner2008-04-051-2/+24
| | | | | | subsuming) my patch for PR1999. llvm-svn: 49251
* 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-044-38/+73
| | | | | | | | | | | -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
* Ignore qualifiers when checking vector operands, just like scalar operands.Nate Begeman2008-04-041-2/+5
| | | | | | | This prevents things like a += b[0]; where a is a float4 and b is a float4 * (address_space 1) llvm-svn: 49199
* Fix a bug where we didn't check the RHS for null, we checkedChris Lattner2008-04-031-5/+7
| | | | | | the LHS for null twice. llvm-svn: 49138
* Change ObjCInterfaceDecl to inherit from NamedDecl (not TypeDecl). While ↵Steve Naroff2008-04-023-23/+19
| | | | | | | | 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
* simplify some code by using PointerLikeType.Chris Lattner2008-04-021-2/+2
| | | | llvm-svn: 49101
* add a common base class "PointerLikeType" for PointerType and ReferenceType,Chris Lattner2008-04-021-20/+15
| | | | | | | allowing them to be treated the same in some contexts. A suggestion for a better name is welcome :) llvm-svn: 49100
* properly handle array decay in objc message exprs.Chris Lattner2008-04-021-4/+4
| | | | llvm-svn: 49098
* Two changes to Sema::LookupDecl() interface. Steve Naroff2008-04-025-52/+32
| | | | | | | | | | | (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
* Various parts of the standard require something to be an "incomplete or Chris Lattner2008-04-022-14/+13
| | | | | | | | object type". Add a predicate that checks exactly this, as it is equivalent to checking ot see if the type is *not* a function type, which is faster to check. llvm-svn: 49082
* 1) Enforce C99 6.7.3p2: "Types other than pointer types derived fromChris Lattner2008-04-021-9/+80
| | | | | | | | | | | | | | object or incomplete types shall not be restrict-qualified." 2) Warn about qualifiers on function types: C99 6.7.3p8: "If the specification of a function type includes any type qualifiers, the behavior is undefined." 3) Implement restrict on C++ references. 4) fix some locations for various C++ reference diagnostics. llvm-svn: 49081
* Fix several bugs in array -> pointer decomposition.Chris Lattner2008-04-023-23/+11
| | | | | | | | | | | | | | | | 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
* rename some variables, fix 80 col violation. No Chris Lattner2008-04-021-47/+48
| | | | | | functionality change. llvm-svn: 49072
* Fix PR2017 and silence some bogus errors.Chris Lattner2008-04-022-5/+8
| | | | llvm-svn: 49068
* Fix a comment typo and add a couple suggestions from Chris.Steve Naroff2008-04-022-3/+4
| | | | llvm-svn: 49066
* Fairly large "cleaup" related to changing ObjCCompatibleAliasDecl superclass ↵Steve Naroff2008-04-015-66/+83
| | | | | | | | | | | | | (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
* rename Decl::CompatibleAlias -> ObjCCompatibleAlias.Chris Lattner2008-03-311-13/+26
| | | | | | | | | | | | | | Fix objc ivar lookup. Ivar lookup should occur between lookup of method-local values and lookup of globals. Emulate this with some logic in the handling of Sema::ActOnIdentifierExpr. Two todo's left: 1) sema shouldn't turn a bare reference to an ivar into "self->ivar" in the AST. This is a hack. 2) The new ScopedDecl::isDefinedOutsideFunctionOrMethod method does not correctly handle typedefs and enum constants yet. llvm-svn: 48972
* Make sure Sema::ActOnClassMessage() correctly diagnoses "super".Steve Naroff2008-03-281-1/+4
| | | | llvm-svn: 48924
* 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 typo.Steve Naroff2008-03-191-1/+1
| | | | llvm-svn: 48571
* Fix http://llvm.org/bugs/show_bug.cgi?id=2161.Steve Naroff2008-03-191-2/+13
| | | | llvm-svn: 48568
* Check in a couple fixes for vector extensions. Nate Begeman2008-03-171-2/+2
| | | | llvm-svn: 48461
* clean up property memory allocation to move it into the ast classesChris Lattner2008-03-171-15/+14
| | | | | | like the rest of the classes. llvm-svn: 48434
* make property addition work list all other "add" methods. Do Chris Lattner2008-03-161-7/+2
| | | | | | the allocation in the class, not in sema. llvm-svn: 48433
* add the last two Create methods for decls, woo!Chris Lattner2008-03-161-20/+22
| | | | llvm-svn: 48432
* add two more Create methods.Chris Lattner2008-03-161-3/+5
| | | | llvm-svn: 48428
* simplify the way ObjCCategoryDecl's get their referenced protocols listChris Lattner2008-03-161-5/+8
| | | | | | | | specified. Previously, the ctor would allocate memory for the list and then it would get filled in later. Move the allocation+filling in to be more consistent with other stuff, e.g. the addMethods method. llvm-svn: 48427
* Add create methods for ObjCCategoryDecl, ObjCForwardProtocolDecl, ObjCClassDecl.Chris Lattner2008-03-161-5/+7
| | | | llvm-svn: 48426
* minor cleanups, make getNumInstanceMethods always return unsigned.Chris Lattner2008-03-161-7/+7
| | | | llvm-svn: 48423
* fix a crasher where an invalid program that multiply definedChris Lattner2008-03-161-7/+9
| | | | | | a protocol could smash more references in than are allocated. llvm-svn: 48411
* Give ObjCProtocolDecl a Create method.Chris Lattner2008-03-161-4/+4
| | | | llvm-svn: 48410
* hoist a bunch of casting.Chris Lattner2008-03-161-6/+7
| | | | llvm-svn: 48409
* Add create methods for ObjCIvarDecl and ObjCInterfaceDeclChris Lattner2008-03-163-7/+10
| | | | llvm-svn: 48408
* Make the parameter count of ObjCMethodDecl unsigned, youChris Lattner2008-03-162-3/+3
| | | | | | can't have negative arguments. llvm-svn: 48407
* remove some dead arguments to ObjCMethodDecl.Chris Lattner2008-03-161-1/+1
| | | | llvm-svn: 48406
* Give ObjCMethodDecl a Create method.Chris Lattner2008-03-161-12/+12
| | | | llvm-svn: 48405
* switch the rest of the C decl classes to do their Chris Lattner2008-03-162-5/+5
| | | | | | allocation through ASTContext. llvm-svn: 48403
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-1513-0/+9151
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