summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* Update serialization for ObjCMessageExpr to handle additional bit-swizziling ↵Ted Kremenek2008-06-241-8/+12
| | | | | | of receiver information. llvm-svn: 52679
* ObjCMessageExpr objects that represent messages to class methods now can ↵Ted Kremenek2008-06-241-1/+35
| | | | | | contain the ObjCInterfaceDecl* of the target class if it was available when the ObjCMessageExpr object was constructed. The original interfaces of the class has been preserved (requiring no functionality changes from clients), but now a "getClasSInfo" method returns both the ObjCInterfaceDecl* and IdentifierInfo* of the target class. llvm-svn: 52676
* remove dead enums.Chris Lattner2008-06-211-2/+0
| | | | llvm-svn: 52581
* Switch 'super' from being a weird cast thing to being a predefined expr node.Chris Lattner2008-06-212-11/+10
| | | | | | Patch by David Chisnall with objc rewriter and stmtdumper updates from me. llvm-svn: 52580
* Added ParentMap, a class to represent a lazily constructed mapping from ↵Ted Kremenek2008-06-201-0/+54
| | | | | | child to parents. llvm-svn: 52553
* Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.Chris Lattner2008-06-173-2/+11
| | | | | | Patch by David Chisnall! llvm-svn: 52422
* Fix more strict-aliasing warnings.Ted Kremenek2008-06-172-22/+18
| | | | | | Fix indentation of class declarations in ExprCXX.h llvm-svn: 52380
* This patch is motivated by numerous strict-aliasing warnings when compilingTed Kremenek2008-06-172-110/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang as a Release build. The big change is that all AST nodes (subclasses of Stmt) whose children are Expr* store their children as Stmt* or arrays of Stmt*. This is to remove strict-aliasing warnings when using StmtIterator. None of the interfaces of any of the classes have changed (except those with arg_iterators, see below), as the accessor methods introduce the needed casts (via cast<>). While this extra casting may seem cumbersome, it actually adds some important sanity checks throughout the codebase, as clients using StmtIterator can potentially overwrite children that are expected to be Expr* with Stmt* (that aren't Expr*). The casts provide extra sanity checks that are operational in debug builds to catch invariant violations such as these. For classes that have arg_iterators (e.g., CallExpr), the definition of arg_iterator has been replaced. Instead of it being Expr**, it is an actual class (called ExprIterator) that wraps a Stmt**, and provides the necessary operators for iteration. The nice thing about this class is that it also uses cast<> to type-checking, which introduces extra sanity checks throughout the codebase that are useful for debugging. A few of the CodeGen functions that use arg_iterator (especially from OverloadExpr) have been modified to take begin and end iterators instead of a base Expr** and the number of arguments. This matches more with the abstraction of iteration. This still needs to be cleaned up a little bit, as clients expect that ExprIterator is a RandomAccessIterator (which we may or may not wish to allow for efficiency of representation). This is a fairly large patch. It passes the tests (except CodeGen/bitfield.c, which was already broken) on both a Debug and Release build, but it should obviously be reviewed. llvm-svn: 52378
* Silence uninitialized value warning in Release build.Ted Kremenek2008-06-161-4/+5
| | | | llvm-svn: 52376
* Silence uninitialized value warning during Release build.Ted Kremenek2008-06-161-4/+5
| | | | llvm-svn: 52375
* Fix "copy & paste" error.Argyrios Kyrtzidis2008-06-111-3/+3
| | | | llvm-svn: 52227
* -Add DeclChain member to DeclContext.Argyrios Kyrtzidis2008-06-102-17/+47
| | | | | | | -ScopedDecls get chained to their DeclContext. -DeclContext's DeclChain replaces FunctionDecl's DeclChain and EnumDecl's ElementList. llvm-svn: 52164
* Dump the name of CXXStruct/CXXUnion/CXXClass Decl subclasses.Argyrios Kyrtzidis2008-06-091-0/+3
| | | | llvm-svn: 52161
* -Changes to TagDecl:Argyrios Kyrtzidis2008-06-094-24/+37
| | | | | | | | | Added TagKind enum. Added getTagKind() method. Added convenience methods: isEnum(), isStruct(), isUnion(), isClass(). -RecordDecl/CXXRecordDecl::Create() accept a TagKind enum instead of a DeclKind one. llvm-svn: 52160
* Added new C++ AST Decl subclasses.Argyrios Kyrtzidis2008-06-094-2/+69
| | | | llvm-svn: 52155
* capture whether a CharacterLiteral was wide or not in the AST. Chris Lattner2008-06-072-2/+5
| | | | | | Patch by Mike Stump! llvm-svn: 52081
* Fix ast dumping to work with long double literals, e.g. we dump:Chris Lattner2008-06-073-2/+12
| | | | | | | | | | | | | long double X() { return 1.0L; } as: long double X() (CompoundStmt 0xb06a00 <t.c:2:17, col:32> (ReturnStmt 0xb068d0 <col:19, col:26> (FloatingLiteral 0xb02cf0 <col:26> 'long double' 1.000000))) llvm-svn: 52080
* Fix the line endings in the newly added DeclBase.cpp.Eli Friedman2008-06-071-325/+325
| | | | llvm-svn: 52075
* Reclaim memory owned by ObjCForwardProtocolDecls.Ted Kremenek2008-06-062-2/+24
| | | | llvm-svn: 52063
* Implement "Destroy" and destructor for ObjCClassDecl, allowing us to reclaim ↵Ted Kremenek2008-06-062-6/+38
| | | | | | its memory and the memory of the Decls it owns. llvm-svn: 52059
* Implement "Destroy" and destructor for ObjCProtocolDecl, allowing us to ↵Ted Kremenek2008-06-062-1/+39
| | | | | | reclaim its memory and the memory of the Decls it owns. llvm-svn: 52055
* Because of a lack of a clear ownership role between ObjCInterfaceDecls andTed Kremenek2008-06-062-7/+19
| | | | | | | ObjCPropertyDecls, have TranslationUnit destroy ObjCPropertyDecls. This is a horrible hack, and must be removed eventually. llvm-svn: 52051
* Initial work on additional memory collection for ObjC AST objects. We nowTed Kremenek2008-06-061-4/+43
| | | | | | | | have Destroy methods of ObjcMethodDecl and ObjCInterfaceDecl which recursively destroy their owned Decls and Stmts. There are a few cases where it is not clear what to do (FIXMEs included in the patch). llvm-svn: 52050
* During interface layout, don't forget super class.Devang Patel2008-06-061-2/+14
| | | | llvm-svn: 52035
* Undo previous check-in.Devang Patel2008-06-061-9/+1
| | | | llvm-svn: 52034
* During interface layout, don't forget super class.Devang Patel2008-06-061-1/+9
| | | | llvm-svn: 52033
* Fix <rdar://problem/5987482> clang on xcode: null dereference in ↵Steve Naroff2008-06-051-0/+22
| | | | | | | | Sema::ActOnMemberReferenceExpr. In addition to fixing the crasher, this commit fixes further improves property lookup (by searching protocols of qualified interfaces..."NSObject <prot>"). llvm-svn: 52001
* Add ObjCInterface layout support.Devang Patel2008-06-041-0/+43
| | | | | | Reuse RecordLayout. llvm-svn: 51968
* Refactoring. Devang Patel2008-06-041-74/+80
| | | | | | Move field layout code in a ASTRecordLayout member fn. llvm-svn: 51966
* Moved LangOptions from TranslationUnit to ASTContext. This induced a ↵Ted Kremenek2008-06-042-10/+10
| | | | | | variety of cleanups in some ASTConsumers. llvm-svn: 51943
* ASTContext::typesAreCompatible(): id is compatible with all qualified id types.Steve Naroff2008-06-041-1/+10
| | | | llvm-svn: 51939
* Move Decl and DeclContext implementations into a new DeclBase.cpp file.Argyrios Kyrtzidis2008-06-042-312/+326
| | | | llvm-svn: 51936
* Make sure we look through categories when searching for a classes property.Steve Naroff2008-06-041-0/+7
| | | | | | Fixes <rdar://problem/5984338> clang on xcode: property implementation must have its declaration in interface 'PBXOpenQuicklyModule' llvm-svn: 51925
* Put back my temporary hack until Eli addresses this in a more complete fashion.Steve Naroff2008-06-031-0/+5
| | | | llvm-svn: 51920
* Re-fix r51907 in a way which doesn't affect valid code. This essentially Eli Friedman2008-06-031-5/+0
| | | | | | | | | | | | | moves the check for the invalid construct to a point where it doesn't affect other uses of isIntegerConstantExpr, and we can warn properly when the extension is used. This makes it a bit more complicated, but it's a lot cleaner. Steve, please tell me if this check is sufficient to handle the relevant system header. I know it's enough to handle the testcase, but I don't know what exactly the original looks like. llvm-svn: 51918
* Change Expr::isIntegerConstantExpr() to allow for pointer types (for GCC ↵Steve Naroff2008-06-031-0/+5
| | | | | | | | compatibility). Note FIXME. Fix <rdar://problem/5977870> clang on xcode: error: arrays with static storage duration must have constant integer length llvm-svn: 51907
* Fix <rdar://problem/5979875> clang on xcode: error: use of undeclared ↵Steve Naroff2008-06-023-1/+20
| | | | | | identifier 'super' llvm-svn: 51888
* fix decl attributes cleaningNuno Lopes2008-06-011-8/+16
| | | | | | this plugs the leak of attributes and also fixes a crash in the test llvm-svn: 51862
* Added "InitializeTU" to ASTConsumer. This is used by Sema::ParseAST to pass aTed Kremenek2008-05-311-0/+6
| | | | | | | | | | | TranslationUnit object instead of an ASTContext. By default it calls Initialize(ASTConstext& Context) (to match with the current interface used by most ASTConsumers). Modified the ObjC-Rewriter to use InitializeTU, and to tell the TranslationUnit to not free its Decls. This is a workaround for: <rdar://problem/5966749> llvm-svn: 51825
* Teach Expr::isLvalue() about ObjC properties. For now, all properties are ↵Steve Naroff2008-05-301-0/+2
| | | | | | writable. Added a FIXME for another day. llvm-svn: 51800
* Fix some strict-aliasing warnings by using Stmt* instead of Expr* in ↵Ted Kremenek2008-05-301-3/+3
| | | | | | VariableArrayType, EnumConstantDecl, and VarDecl. llvm-svn: 51772
* Cleanup/refactoring of Sema struct layout. This patch unifies the structEli Friedman2008-05-301-98/+79
| | | | | | | | | | and union codepaths and fixes some minor bugs. I'm reasonably confident this is accurate, at least for X86. I'll correct any bugs as I find them; I haven't found any for a while, though. llvm-svn: 51762
* Add basic support for properties references (a missing feature).Steve Naroff2008-05-303-0/+32
| | | | | | While it is far from complete, it does fix the following <rdar://problem/5967199> clang on xcode: error: member reference is not to a structure or union llvm-svn: 51719
* Fix one strict-aliasing warning.Ted Kremenek2008-05-291-8/+8
| | | | llvm-svn: 51707
* - Move ObjC Expresssion AST's from Expr.h => ExprObjC.hSteve Naroff2008-05-295-2/+5
| | | | | | - #include ExprObjC.h in many places llvm-svn: 51703
* Assume statement expressions have side effects; this gets rid of a lot Eli Friedman2008-05-271-2/+5
| | | | | | of extra warnings in the Python source. llvm-svn: 51594
* Don't swap function decls, and add them to the scope as they are Eli Friedman2008-05-271-57/+0
| | | | | | | | | | | | | encountered. Mixing up the decls is unintuitive, and confuses the AST destruction code. Fixes PR2360. Note that there is a need to look up the characteristics and declarations of a function associated with a particular name or decl, but the original swapping code doesn't solve it properly. http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-May/001644.html is one suggestion for how to fix that. llvm-svn: 51584
* Stop leaking the TUDecl.Eli Friedman2008-05-271-0/+2
| | | | llvm-svn: 51575
* Always initialize NEXT_CATCH; fixes a Valgrind uninitialized read error Eli Friedman2008-05-251-3/+2
| | | | | | (originally reported in PR1682). llvm-svn: 51551
* Call the correct destructor.Ted Kremenek2008-05-241-1/+1
| | | | llvm-svn: 51544
OpenPOWER on IntegriCloud