summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* implement PCH support for the rest of ExprObjC.h, includingChris Lattner2009-04-261-0/+10
| | | | | | the missing bits of ObjCMessageExpr. llvm-svn: 70100
* Change isNullPointerConstant to be strict; hopefully this won't cause Eli Friedman2009-04-251-6/+2
| | | | | | any issues now that we have our own tgmath.h. llvm-svn: 70090
* Silence gcc warnings.Eli Friedman2009-04-252-3/+3
| | | | llvm-svn: 70086
* fix PR4049, a crash on invalid, by making sema install the right number of Chris Lattner2009-04-251-3/+2
| | | | | | | | | | | | | | | | | | | | | parameters in a functiondecl, even if the decl is invalid and has a confusing Declarator. On the testcase, we now emit one beautiful diagnostic: t.c:2:1: error: unknown type name 'unknown_type' unknown_type f(void*) ^ GCC 4.0 produces: t.c:2: error: syntax error before ‘f’ t.c: In function ‘f’: t.c:2: error: parameter name omitted and GCC 4.2: t.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘f’ llvm-svn: 70016
* rename getNumParmVarDeclsFromType back to getNumParams(),Chris Lattner2009-04-251-13/+5
| | | | | | | | | remove a special case that was apparently for typeof() and generalize the code in SemaDecl that handles typedefs to handle any sugar type (including typedef, typeof, etc). Improve comment to make it more clear what is going on. llvm-svn: 70015
* add a new helper function to FunctionDecl instead of it beingChris Lattner2009-04-251-5/+8
| | | | | | static in Decl.cpp. llvm-svn: 70014
* Add CXXExprWithCleanupAnders Carlsson2009-04-242-0/+26
| | | | llvm-svn: 70000
* Make CXXTemporaryObjectExpr inherit from CXXConstructExpr.Anders Carlsson2009-04-241-23/+3
| | | | llvm-svn: 69981
* Fix assert.Anders Carlsson2009-04-241-2/+4
| | | | llvm-svn: 69961
* CXXTempVarDecls aren't looked up. Fixes tests.Anders Carlsson2009-04-241-0/+1
| | | | llvm-svn: 69960
* Add an ASTContext parameter to CXXTemporaryObjectExpr.Anders Carlsson2009-04-241-1/+1
| | | | llvm-svn: 69959
* Add a VarDecl parameter to the CXXTemporaryObjectExpr constructor. It's ↵Anders Carlsson2009-04-241-1/+2
| | | | | | unused for now, so no functionality change yet. Also, create CXXTempVarDecls to pass to the CXXTemporaryObjectExpr ctor. llvm-svn: 69957
* Make the CXXConstructExpr public and add a StmtClass to it. No functionality ↵Anders Carlsson2009-04-241-3/+4
| | | | | | change. llvm-svn: 69954
* Fix rdar://6821047 - clang crashes on subscript of interface in 64-bit modeChris Lattner2009-04-241-0/+4
| | | | | | | | | | | | | | Several changes here: 1. We change Type::isIncompleteType to realize that forward declared interfaces are incomplete. This eliminate special case code for this from the sizeof path, and starts us rejecting P[4] when P is a pointer to an incomplete interface. 2. Explicitly reject P[4] when P points to an interface in non-fragile ABI mode. 3. Switch the sizeof(interface) diagnostic back to an error instead of a warning in non-fragile abi mode. llvm-svn: 69943
* Eliminate Sema::ObjCImplementations, relying instead on name lookup. What's ↵Douglas Gregor2009-04-241-3/+7
| | | | | | | | | | | good for uniformity is good for PCH (or is it the other way around?). As part of this, make ObjCImplDecl inherit from NamedDecl (since ObjCImplementationDecls now need to have names so that they can be found). This brings ObjCImplDecl very, very close to ObjCContainerDecl; we may be able to merge them soon. llvm-svn: 69941
* PCH support for all of the predefined Objective-C types, such as id,Douglas Gregor2009-04-232-6/+39
| | | | | | | | SEL, Class, Protocol, CFConstantString, and __objcFastEnumerationState. With this, we can now run the Objective-C methods and properties PCH tests. llvm-svn: 69932
* The ivars in an ObjCImplementationDecl are now stored in theDouglas Gregor2009-04-231-6/+0
| | | | | | | DeclContext rather than in a separate list. This makes PCH (de-)serialization trivial, so that ivars can be loaded lazily. llvm-svn: 69857
* PCH (de-)serialization for ObjCImplDecl. This can't be tested yet.Douglas Gregor2009-04-231-0/+1
| | | | llvm-svn: 69855
* Add a CXXConstructExpr that represents an implicit call to a C++ ↵Anders Carlsson2009-04-232-0/+44
| | | | | | constructor. I think CXXTemporaryObjectExpr is going to become a subclass of CXXConstructExpr, since CXXTemporaryObjectExpr represents a syntactic temporary, for example T() llvm-svn: 69854
* Eliminate the three SmallVectors in ObjCImplDecl (for instanceDouglas Gregor2009-04-232-17/+52
| | | | | | | | | | | methods, class methods, and property implementations) and instead place all of these entities into the DeclContext. This eliminates more linear walks when looking for class or instance methods and should make PCH (de-)serialization of ObjCDecls trivial (and lazy). llvm-svn: 69849
* Remove the serialization code that predates precompiledDouglas Gregor2009-04-227-3007/+1
| | | | | | | headers. Future approaches to (de-)serializing ASTs will be based on the PCH infrastructure. llvm-svn: 69828
* Add handling for complex->int, int->complex float, and float->complex Eli Friedman2009-04-221-14/+38
| | | | | | | int. Note that constant int->complex float and float->complex int casts were being miscompiled. llvm-svn: 69821
* Lazy loading of builtins for precompiled headers.Douglas Gregor2009-04-222-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PCH files now contain complete information about builtins, including any declarations that have been synthesized as part of building the PCH file. When using a PCH file, we do not initialize builtins at all; when needed, they'll be found in the PCH file. This optimization translations into a 9% speedup for "Hello, World!" with Carbon.h as a prefix header and roughly a 5% speedup for 403.gcc with its prefix header. We're also reading less of the PCH file for "Hello, World!": *** PCH Statistics: 286/20693 types read (1.382110%) 1630/59230 declarations read (2.751984%) 764/44914 identifiers read (1.701029%) 1/32954 statements read (0.003035%) 5/6187 macros read (0.080815%) down from *** PCH Statistics: 411/20693 types read (1.986179%) 2553/59230 declarations read (4.310316%) 1093/44646 identifiers read (2.448148%) 1/32954 statements read (0.003035%) 21/6187 macros read (0.339421%) llvm-svn: 69815
* Reapply r69771, with updates & fixes:Daniel Dunbar2009-04-221-11/+28
| | | | | | | | | | | | | | | | | | | | | | Rework the shadow struct that is layed out for Objective-C classes. - Superclasses are now always laid out in their shadow structure at the first field. - Prior to this, the entire class heirarchy was flattened into a single structure which meant that alignment, padding, and bitfields were incorrect (the ASTRecordLayout was correct however, which meant our debug info didn't coincide with ivar offsets, for example). - This is still very suboptimal (for example, ivar are looked up recursively, but I believe the ivar layout itself is now at least close to correct. - <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding backwards llvm-svn: 69811
* Remove lookupFieldDeclFromIvar from ObjCIvarDecl interface.Daniel Dunbar2009-04-221-15/+0
| | | | | | - This is only used by CGObjCRuntime now. llvm-svn: 69800
* Simplify addRecordToClass, it is not legal to call it on a forwardDaniel Dunbar2009-04-221-15/+6
| | | | | | declaration now. llvm-svn: 69799
* ObjCQualifiedClass is dead, remove it.Chris Lattner2009-04-222-6/+1
| | | | llvm-svn: 69783
* Reorganize built-in initialization to separate the creation of target ↵Douglas Gregor2009-04-222-6/+8
| | | | | | builtins from marking IdentifierInfos as builtins. No functionality change llvm-svn: 69774
* Revert r69771, I missed some (obvious) details. :/Daniel Dunbar2009-04-222-56/+15
| | | | llvm-svn: 69773
* Mark another TypeForDecl const and make getObjCInterfaceType's argument const.Daniel Dunbar2009-04-222-3/+4
| | | | llvm-svn: 69772
* Rework the shadow struct that is layed out for Objective-C classes.Daniel Dunbar2009-04-222-15/+56
| | | | | | | | | | | | | | | | | | | - Superclasses are now always laid out their shadow structure at the first field. - Prior to this, the entire class heirarchy was flattened into a single structure which meant that alignment, padding, and bitfields weren't packed correctly (the ASTRecordLayout was correct however, which meant our debug info didn't coincide with ivar offsets, for example). - This is still very suboptimal, but I believe the ivar layout itself is now at least close to correct. - <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding backwards llvm-svn: 69771
* Make sure to mark the interface as completed when we see anDaniel Dunbar2009-04-212-0/+4
| | | | | | | | | @implementation that closes a @class delcaration. - I don't know how to make a test case for this, but this strengthens the invariants that hold internally. The functionality change here is the edit to SemaDeclObjC.cpp. llvm-svn: 69728
* Explictly track tentative definitions within Sema, then hand thoseDouglas Gregor2009-04-211-1/+2
| | | | | | | | | | | | | | | tentative definitions off to the ASTConsumer at the end of the translation unit. Eliminate CodeGen's internal tracking of tentative definitions, and instead hook into ASTConsumer::CompleteTentativeDefinition. Also, tweak the definition-deferal logic for C++, where there are no tentative definitions. Fixes <rdar://problem/6808352>, and will make it much easier for precompiled headers to cope with tentative definitions in the future. llvm-svn: 69681
* Use an ASTRecordLayout to compute the sizeof an interface, notDaniel Dunbar2009-04-211-7/+7
| | | | | | | | | addRecordToClass. - Among other things, this fixes a crash when applying sizeof to an interface with synthesized ivars, although things still aren't "correct" here. llvm-svn: 69675
* Fix PR4027 + rdar://6808859, we were rejecting implicit casts ofChris Lattner2009-04-211-0/+1
| | | | | | aggregates even though we already accept explicit ones. Easy fix. llvm-svn: 69661
* Add a CXXDestroyExpr. Add classof member functions to CXXTempVarDecl.Anders Carlsson2009-04-212-0/+18
| | | | llvm-svn: 69654
* Add the beginnings of a CXXTempVarDecl class.Anders Carlsson2009-04-211-0/+7
| | | | llvm-svn: 69652
* Kill ASTContext::[gs]etFieldForDecl, instead we just lookup thingsDaniel Dunbar2009-04-211-10/+0
| | | | | | | | when we need them -- which is exactly what some code was already doing! - No intended functionality change. llvm-svn: 69648
* Assert on a few conditions that (I believe) should holdDaniel Dunbar2009-04-211-0/+2
| | | | | | | w.r.t. ASTContext::[gs]etFieldDecl, and the Field argument to EmitObjCValueForIvar). llvm-svn: 69639
* Add pch reader/writer support for ObjCMethodDecl.Steve Naroff2009-04-201-5/+5
| | | | | | Test will be enabled with ObjCInterfaceDecl is added. llvm-svn: 69594
* Make FieldDecl parameter to getObjCEncodingForType... const.Daniel Dunbar2009-04-201-4/+4
| | | | llvm-svn: 69578
* Remove non-const form of lookupFieldDeclForIvar.Daniel Dunbar2009-04-201-3/+4
| | | | llvm-svn: 69563
* Add location info for indirect goto.Chris Lattner2009-04-191-1/+1
| | | | llvm-svn: 69497
* Lazy deserialization of function bodies for PCH files. For the CarbonDouglas Gregor2009-04-181-5/+6
| | | | | | | | | | "Hello, World!", this takes us from deserializing 6469 statements/expressions down to deserializing 1 statement/expression. It only translated into a 1% improvement on the Carbon-prefixed 403.gcc, but (a) it's the right thing to do, and (b) we expect this to matter more once we lazily deserialize identifiers. llvm-svn: 69407
* FunctionDecl::getBody() is getting an ASTContext argument for use inDouglas Gregor2009-04-183-6/+20
| | | | | | | | lazy PCH deserialization. Propagate that argument wherever it needs to be. No functionality change, except that I've tightened up a few PCH tests in preparation. llvm-svn: 69406
* Fix two embarrassing PCH bugs:Douglas Gregor2009-04-171-1/+1
| | | | | | | | | 1) Accidentally used delete [] on an array of statements that was allocated with ASTContext's allocator 2) Deserialization of names with multiple declarations (e.g., a struct and a function) used the wrong mangling constant, causing it to view declaration IDs as Decl*s. 403.gcc builds and links properly. llvm-svn: 69390
* PCH support for inline assembly statements.Douglas Gregor2009-04-171-0/+20
| | | | | | | This completes support for all of C (+ extensions). We can (again) build a PCH file for Carbon.h. llvm-svn: 69385
* Implement lvalue test for conditional expressions.Sebastian Redl2009-04-171-0/+26
| | | | | | Add a few commented lines to the test case that point out things that don't work yet. llvm-svn: 69354
* Add support for the __has_trivial_destructor type trait.Anders Carlsson2009-04-172-2/+6
| | | | llvm-svn: 69345
* PCH support for the first batch of statements, including null,Douglas Gregor2009-04-171-0/+8
| | | | | | compound, case, default, if, switch, and break statements. llvm-svn: 69329
OpenPOWER on IntegriCloud