summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* Two fixes:Steve Naroff2008-07-161-2/+2
| | | | | | | - Make sure ObjCIvarDecl propagates the bitfield width. - RewriteObjC::SynthesizeIvarOffsetComputation(): Avoid using the __OFFSETOF__ mumbo jumbo for bitfields (since it isn't legal C). This fixes <rdar://problem/5986079> clang ObjC rewriter: bitfields and ivar access don't mix. llvm-svn: 53694
* expand casts to handle what isIntegerConstantExpr handles.Chris Lattner2008-07-121-11/+52
| | | | | | Casts from pointers remain a problem. :) llvm-svn: 53501
* Add support for __builtin_type_compatible_p, enums, etc.Chris Lattner2008-07-121-16/+47
| | | | llvm-svn: 53500
* start remembering diagnostics for various cases, add some missingChris Lattner2008-07-121-28/+85
| | | | | | code. Switch to Eli's getIntWidth method. llvm-svn: 53499
* Provide a structure for passing down 'is evaluated' and passing up Chris Lattner2008-07-111-25/+62
| | | | | | diagnosic+loc info for i-c-e evaluation. llvm-svn: 53490
* simplify some code a bit.Chris Lattner2008-07-111-48/+42
| | | | llvm-svn: 53477
* share code between sizeof(expr) and sizeof(type)Chris Lattner2008-07-111-61/+44
| | | | llvm-svn: 53475
* implement support for __extension__, make sure the result of aChris Lattner2008-07-111-13/+30
| | | | | | comparison has the right width. llvm-svn: 53469
* add a new getIntTypeSizeInBits method.Chris Lattner2008-07-111-11/+12
| | | | llvm-svn: 53468
* rename "SInt" methods to "Int" in APValue.Chris Lattner2008-07-111-1/+1
| | | | llvm-svn: 53467
* make the new evaluator avoid conversions APValue<->APSInt in some cases.Chris Lattner2008-07-111-67/+51
| | | | | | Add some accessors to APValue. llvm-svn: 53465
* rearrange some code, no functionality changes.Chris Lattner2008-07-111-85/+98
| | | | llvm-svn: 53463
* Patch by Csaba Hruska and Peter Neumark:Ted Kremenek2008-07-101-21/+60
| | | | | | "adds support (de)serialization (from)to (in memory) buffer." llvm-svn: 53425
* revert my bogus attempt to fix the comment. sorry for the noise.Nuno Lopes2008-07-081-1/+1
| | | | llvm-svn: 53248
* Fix small bug. The evaluator now works well enough to pass all testsAnders Carlsson2008-07-081-1/+2
| | | | llvm-svn: 53238
* More constant expression work.Anders Carlsson2008-07-081-6/+112
| | | | llvm-svn: 53235
* Move out some methods.Anders Carlsson2008-07-081-159/+149
| | | | llvm-svn: 53234
* More work.Anders Carlsson2008-07-081-1/+78
| | | | llvm-svn: 53233
* Compilation fixSeo Sanghyeon2008-07-081-1/+1
| | | | llvm-svn: 53222
* Port more of Eli's evaluator over. This makes the int evaluator handle ↵Anders Carlsson2008-07-081-7/+143
| | | | | | binary and unary operators. llvm-svn: 53221
* Commit beginnings of int evaluator. Currently not used.Anders Carlsson2008-07-081-0/+40
| | | | llvm-svn: 53219
* fix CheckForConstantInitializer() for Compound LiteralsNuno Lopes2008-07-071-1/+1
| | | | | | also fix the correspondent test (it was expecting more errors than it should. please confirm my fix is correct (at least gcc agrees with me) llvm-svn: 53174
* Shuffle things around in preparation for integrating Eli's constant evaluator.Anders Carlsson2008-07-032-0/+61
| | | | llvm-svn: 53074
* Add Sema support for C++ classes.Argyrios Kyrtzidis2008-07-011-1/+3
| | | | llvm-svn: 52956
* Make a few related changes:Chris Lattner2008-06-301-0/+14
| | | | | | | | | | | | | | 1) add a new ASTContext::getFloatTypeSemantics method. 2) Use it from SemaExpr.cpp, CodeGenTypes.cpp and other places. 3) Change the TargetInfo.h get*Format methods to return their fltSemantics byref instead of by pointer. 4) Change CodeGenFunction::EmitBuiltinExpr to allow builtins which sometimes expand specially and othertimes fall back to libm. 5) Add support for __builtin_nan("") to codegen, cases that don't pass in an empty string are currently lowered to libm calls. 6) Fix codegen of __builtin_infl. llvm-svn: 52914
* Fix for PR2501; this patch makes usual arithmetic conversions for Eli Friedman2008-06-282-0/+42
| | | | | | | | integers which have the same width and different signedness work correctly. (The testcase in PR2501 uses a comparison between long and unsigned int). llvm-svn: 52853
* 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
OpenPOWER on IntegriCloud