summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* Give conversions of block pointers to ObjC pointers a different cast kindJohn McCall2011-09-093-11/+104
| | | | | | | | than conversions of C pointers to ObjC pointers. In order to ensure that we've caught every case, add asserts to CastExpr that strictly determine which cast kind is used for which kind of bit cast. llvm-svn: 139352
* Modules: introduce the __module_private__ declaration specifier, whichDouglas Gregor2011-09-091-2/+17
| | | | | | | indicates that a declaration is only visible within the module it is declared in. llvm-svn: 139348
* Look through SubstNonTypeTemplateParmExpr nodes in the variousDouglas Gregor2011-09-081-1/+20
| | | | | | Expr::Ignore* methods that also look through implicit casts. llvm-svn: 139303
* Thread safety: added support for function scopes in attribute arguments.Caitlin Sadowski2011-09-081-0/+4
| | | | | | This patch was written by DeLesley Hutchins. llvm-svn: 139302
* Allow C++0x enumerations with a fixed underlying type inDouglas Gregor2011-09-081-4/+15
| | | | | | | Objective-C. The @encode'ing of such an enumeration type is the same as its underlying type. <rdar://problem/5276348>. llvm-svn: 139297
* Implement the Objective-C 'instancetype' type, which is an alias ofDouglas Gregor2011-09-081-1/+12
| | | | | | | | | | 'id' that can be used (only!) via a contextual keyword as the result type of an Objective-C message send. 'instancetype' then gives the method a related result type, which we have already been inferring for a variety of methods (new, alloc, init, self, retain). Addresses <rdar://problem/9267640>. llvm-svn: 139275
* When extracting the callee declaration from a call expression, be sureDouglas Gregor2011-09-061-0/+6
| | | | | | | | | | to look through SubstNonTypeTemplateParmExprs. Then, update the IR generation of CallExprs to actually use CallExpr::getCalleeDecl() rather than attempting to mimick its behavior (badly). Fixes <rdar://problem/10063539>. llvm-svn: 139185
* Don't emit -Wpadded warnings without a valid SourceLocation. This can ↵Ted Kremenek2011-09-061-0/+5
| | | | | | happen when RecordLayoutBuilder is used by Codegen, not Sema. llvm-svn: 139162
* Implement the suggested resolution of WG21 N3307 issue 19: When determining ↵Richard Smith2011-09-051-11/+7
| | | | | | whether a class is an aggregate in C++0x, treat all functions which are neither deleted nor defaulted as user-provided, not just special member functions. The wording of the standard only defines the term "user-provided" for special member functions, but the intent seems to be that any function can be user-provided. llvm-svn: 139111
* Make StmtDumper::VisitCXXFunctionalCastExpr dump the attached cast kind. ↵Eli Friedman2011-09-021-1/+2
| | | | | | Fix the cast kind for a cast from floating-point to enum type. (The difference isn't actually visible, but that's just because IRGen is overly forgiving.) Per report by Enea Zaffanella on cfe-dev. llvm-svn: 139011
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-029-108/+121
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* Teach ASTContext and Preprocessor to hold on to references to the sameDouglas Gregor2011-09-011-1/+1
| | | | | | | | | LangOptions, rather than making distinct copies of LangOptions. Granted, LangOptions doesn't actually get modified, but this will eventually make it easier to construct ASTContext and Preprocessor before we know all of the LangOptions. llvm-svn: 138959
* Support importing of ObjC categories from modules.Argyrios Kyrtzidis2011-09-011-1/+3
| | | | | | | | | | | | The initial incentive was to fix a crash when PCH chaining categories to an interface, but the fix was done in the "modules way" that I hear is popular with the kids these days. Each module stores the local chain of categories and we combine them when the interface is loaded. We also warn if non-dependent modules introduce duplicate named categories. llvm-svn: 138926
* Improve the diagnostic text for -Wmissing-noreturn to include the nameChandler Carruth2011-08-311-2/+2
| | | | | | | | | | | | | | of the function in question when applicable (that is, not for blocks). Patch by Joerg Sonnenberger with some stylistic tweaks by me. When discussing this weth Joerg, streaming the decl directly into the diagnostic didn't work because we have a pointer-to-const, and the overload doesn't accept such. In order to make my style tweaks to the patch, I first changed the overload to accept a pointer-to-const, and then changed the diagnostic printing layer to also use a pointer-to-const, cleaning up a gross line of code along the way. llvm-svn: 138854
* Declare and define implicit move constructor and assignment operator.Sebastian Redl2011-08-303-5/+7
| | | | | | | | | This makes the code duplication of implicit special member handling even worse, but the cleanup will have to come later. For now, this works. Follow-up with tests for explicit defaulting and enabling the __has_feature flag to come. llvm-svn: 138821
* Remove a few mutating ObjCCategoryDecl methods.Argyrios Kyrtzidis2011-08-302-7/+20
| | | | | | | | | | | Remove -setClassInterface -setNextClassCategory -insertNextClassCategory and combine them in the Create function. llvm-svn: 138817
* Warn on missing [super finalize] calls.Nico Weber2011-08-281-0/+1
| | | | | | This matches gcc's logic. Second half of PR10661. llvm-svn: 138730
* objective-c: Treat top-level objective-c declarationsFariborz Jahanian2011-08-275-49/+26
| | | | | | | | | | , such as list of forward @class decls, in a DeclGroup node. Deal with its consequence throught clang. This is in preparation for more Sema work ahead. // rdar://8843851. Feel free to reverse if it breaks something important and I am unavailable. llvm-svn: 138709
* When we're deserializing declarations lexically stored in a RecordDeclDouglas Gregor2011-08-261-8/+16
| | | | | | | | | | | after having already deserialized the fields, clear out the fields first. This makes sure that we keep all of the declarations in the lexical context (including those implicitly added by later type-checking) within the same list. A test case for this behavior is coming as part of another commit; testing for this problem in isolation is a nightmare. llvm-svn: 138661
* From Vassil Vassilev: unnamed decls cannot be removed from the lookup map.Axel Naumann2011-08-261-0/+3
| | | | llvm-svn: 138631
* Remove long-dead FIXMEDouglas Gregor2011-08-241-2/+0
| | | | llvm-svn: 138498
* Don't force the complete deserialization of the visible-declarationsDouglas Gregor2011-08-242-30/+0
| | | | | | | | | | table when serializing an AST file. This was a holdover from the days before chained PCH, and is a complete waste of time and storage now. It's a good thing it's useless, because I have no idea how I would have implemented MaterializeVisibleDecls efficiently in the presence of modules. llvm-svn: 138496
* objc - fix up the builtin type for objc_assign_ivar.Fariborz Jahanian2011-08-231-1/+5
| | | | | | // rdar://9362887. llvm-svn: 138412
* Fix a crash-on-valid that has been here for a very long time:Chandler Carruth2011-08-221-2/+9
| | | | | | | | | | | | | | | const int &x = x; This crashed by inifinetly recursing within the lvalue evaluation routine. I've added a (somewhat) braindead way of preventing this recursion. If folks have better suggestions for how to avoid it I'm all ears. That said, we have some work to do. This doesn't trigger a single warning for uninitialized, self-initialized or otherwise completely wrong code. In some senses, the crash was almost better. llvm-svn: 138239
* Fix a bug in objc @encoding of C++ classes.Argyrios Kyrtzidis2011-08-221-1/+3
| | | | llvm-svn: 138235
* Fix else style. No functionality change intended.Chad Rosier2011-08-173-14/+7
| | | | llvm-svn: 137896
* Fix incorrect code indentation and silence dead store warning due to ↵Ted Kremenek2011-08-171-43/+45
| | | | | | idiomatic code. llvm-svn: 137870
* Mark objc methods that are implicitly declared for properties (not ↵Argyrios Kyrtzidis2011-08-172-1/+4
| | | | | | | | user-declared) as implicit. This results in libclang ignoring such methods. llvm-svn: 137852
* Whitelist operator== and operator!= as valid for unused value warnings,Chandler Carruth2011-08-171-1/+14
| | | | | | | | even when overloaded and user-defined. These operators are both more valuable to warn on (due to likely typos) and extremely unlikely to be reasonable for use to trigger side-effects. llvm-svn: 137823
* Add serialization support for ClassScopeFunctionSpecializationDecl.Francois Pichet2011-08-171-1/+2
| | | | llvm-svn: 137799
* Track in the AST whether a function is constexpr.Richard Smith2011-08-154-24/+39
| | | | llvm-svn: 137653
* Fix typo.Francois Pichet2011-08-141-4/+4
| | | | llvm-svn: 137585
* Implement function template specialization at class scope extension in ↵Francois Pichet2011-08-143-2/+34
| | | | | | | | | | | | | | | | | Microsoft mode. A new AST node is introduced: ClassScopeFunctionSpecialization. This node holds a FunctionDecl that is not yet specialized; then during the class template instantiation the ClassScopeFunctionSpecialization will spawn the actual function specialization. Example: template <class T> class A { public: template <class U> void f(U p) { } template <> void f(int p) { } // <== class scope specialization }; This extension is necessary to parse MSVC standard C++ headers, MFC and ATL code. BTW, with this feature in, clang can parse (-fsyntax-only) all the MSVC 2010 standard header files without any error. llvm-svn: 137573
* metadata generated by the compiler does not include the weak Fariborz Jahanian2011-08-121-0/+1
| | | | | | attribute of a property. patch by Remy Demarest fixes it. llvm-svn: 137509
* Switch the __int128_t and __uint128_t types over to predefined typesDouglas Gregor2011-08-121-1/+29
| | | | | | | in the AST format, which are built lazily by the ASTContext when requested. llvm-svn: 137437
* Switch the Objective-C 'SEL' type over to a predefined type in theDouglas Gregor2011-08-121-6/+11
| | | | | | | AST file format, lazily generating the actual declaration in ASTContext as needed. llvm-svn: 137434
* Switch the Objective-C 'Class' type over to a predefined type in theDouglas Gregor2011-08-121-4/+14
| | | | | | | AST file format, lazily generating the actual declaration in ASTContext as needed. llvm-svn: 137431
* Move the creation of the predefined typedef for Objective-C's 'id'Douglas Gregor2011-08-121-4/+13
| | | | | | | | | type over into the AST context, then make that declaration a predefined declaration in the AST format. This ensures that different AST files will at least agree on the (global) declaration ID for 'id', and eliminates one of the "special" types in the AST file format. llvm-svn: 137429
* Encapsulate the Objective-C id/Class/SEL "redefinition" types inDouglas Gregor2011-08-111-3/+0
| | | | | | | | | ASTContext with accessors/mutators. The only functional change is that the AST writer won't bother writing the id/Class/SEL redefinition type if it hasn't been explicitly set; previously, it ended up being written as a synonym for the built-in id/Class/SEL. llvm-svn: 137349
* Extended the AST importer to support ParenTypes.Sean Callanan2011-08-111-0/+9
| | | | | | | This is necessary to support importing certain function pointer types. llvm-svn: 137311
* Renamings to consistently use 'Constexpr' not 'ConstExpr' when referring to ↵Richard Smith2011-08-102-6/+5
| | | | | | the C++0x 'constexpr' keyword. llvm-svn: 137230
* Move the creation of the record type for the state of Objective-C fastDouglas Gregor2011-08-091-41/+1
| | | | | | | | enumerations from the ASTContext into CodeGen, so that we don't need to serialize it to AST files. This appears to be the last of the low-hanging fruit for SpecialTypes. llvm-svn: 137124
* Don't serialize the block descriptor or block extended descriptorDouglas Gregor2011-08-091-12/+0
| | | | | | | types to AST files; they're only used by debug info generation anyway, and shouldn't ever exist in the AST anyway. llvm-svn: 137122
* Move the construction of the RecordDecl representing the runtimeDouglas Gregor2011-08-091-43/+1
| | | | | | | | layout of a constant NSString from the ASTContext over to CodeGen, since this is solely CodeGen's responsibility. Eliminates one of the unnecessary "special" types that we serialize. llvm-svn: 137121
* Add support for using anonymous bitfields (e.g., int : 0) to enforce alignment.Chad Rosier2011-08-051-23/+39
| | | | | | | | | | | | | | | This fixes cases where the anonymous bitfield is followed by a bitfield member. E.g., struct t4 { char foo; long : 0; char bar : 1; }; rdar://9859156 llvm-svn: 136991
* Fixed FieldDecl source range.Abramo Bagnara2011-08-051-2/+2
| | | | llvm-svn: 136963
* More whitespace and naming fixup. No functionality change.Chad Rosier2011-08-042-4/+4
| | | | llvm-svn: 136944
* Whitespace.Chad Rosier2011-08-041-9/+7
| | | | llvm-svn: 136929
* Fix style and remove obviously redundant code.Chad Rosier2011-08-042-3/+1
| | | | llvm-svn: 136907
* Additional comments and whitespace.Chad Rosier2011-08-041-3/+3
| | | | llvm-svn: 136892
OpenPOWER on IntegriCloud