summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add bigger method type encodings to protocol objects. <rdar://problem/10492418>Bob Wilson2011-11-301-13/+63
| | | | | | | | | | | | | | | | | | The new metadata are method @encode strings with additional data. 1. Each Objective-C object is marked with its class name and protocol names. The same is done for property @encode already. 2. Each block object is marked with its function prototype's @encoding. For example, a method parameter that is a block object that itself returns void and takes an int would look like: @?<v@?i> These new method @encode strings are stored in a single array pointed to by structs protocol_t and objc_protocol_ext. Patch provided by Greg Parker! llvm-svn: 145469
* Fix the signature of the getcontext builtin. Patch by Dimitry Andric.Rafael Espindola2011-11-131-2/+12
| | | | llvm-svn: 144505
* Correcting grammar.David Blaikie2011-11-061-1/+1
| | | | llvm-svn: 143894
* [libclang] For a class extension, give it a unique USR but for any property ↵Argyrios Kyrtzidis2011-11-011-0/+11
| | | | | | | | | | or ivar it contains give it a USR based on its semantic context, which is the interface. This follows what we already did for objc methods. rdar://10371669 llvm-svn: 143464
* Teach format string analysis that "%zu" means size_t.Hans Wennborg2011-10-271-1/+11
| | | | | | | | The code had it backwards, thinking size_t was signed, and using that for "%zd". Also let the analysis get the types for (u)intmax_t while we are at it. llvm-svn: 143099
* Correctly perform integral promotions on wchar_t/char16_t/char32_t in C++. ↵Eli Friedman2011-10-261-12/+28
| | | | | | <rdar://problem/10309088>. llvm-svn: 143019
* Restore r142914 and r142915, now with missing file and apparentJohn McCall2011-10-251-0/+3
| | | | | | GCC compiler workaround. llvm-svn: 142931
* Revert r142914 and r142915, due to possibly missing file.NAKAMURA Takumi2011-10-251-3/+0
| | | | | | r142914: "Introduce a placeholder type for "pseudo object"" r142915: "Pull the pseudo-object stuff into its own file." llvm-svn: 142921
* Introduce a placeholder type for "pseudo object"John McCall2011-10-251-0/+3
| | | | | | | | | | | | | | | expressions: expressions which refer to a logical rather than a physical l-value, where the logical object is actually accessed via custom getter/setter code. A subsequent patch will generalize the AST for these so that arbitrary "implementing" sub-expressions can be provided. Right now the only client is ObjC properties, but this should be generalizable to similar language features, e.g. Managed C++'s __property methods. llvm-svn: 142914
* Add a new placeholder type to represent "unbridged"John McCall2011-10-171-0/+3
| | | | | | | | casts in ARC. No semantic analysis yet. llvm-svn: 142208
* Provide half floating point support as a storage only type.Anton Korobeynikov2011-10-141-1/+10
| | | | | | Lack of half FP was a regression compared to llvm-gcc. llvm-svn: 142016
* Misc fixes for atomics. Biggest fix is doing alignment correctly for ↵Eli Friedman2011-10-141-3/+15
| | | | | | _Atomic types. llvm-svn: 142002
* Constant expression evaluation refactoring:Richard Smith2011-10-101-14/+11
| | | | | | | | | | | - Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions, and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert behaviour. - Factor out evaluation of bitfield bit widths. - Fix a few places which would evaluate an expression twice: once to determine whether it is a constant expression, then again to get the value. llvm-svn: 141561
* Support for C1x _Atomic specifier (see testcase). This is primarily being ↵Eli Friedman2011-10-061-0/+57
| | | | | | | | committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic. Thanks to Jeffrey Yasskin for the thorough review! llvm-svn: 141330
* Use a sidetable in ASTContext for ParmVarDecls whose index exceeds the 8 ↵Ted Kremenek2011-10-061-0/+11
| | | | | | bits reserved for that value in VarDecl. Fixes PR 10538. llvm-svn: 141273
* c: assignment/init of a function pointer whose function(s)Fariborz Jahanian2011-10-051-5/+5
| | | | | | | | return to one which does not return (has noreturn attribute) should warn as it is an unsafe assignment. // rdar://10095762 c++ already handles this. This is the c version. llvm-svn: 141141
* Allow getting all source locations of selector identifiers in a ObjCMethodDecl.Argyrios Kyrtzidis2011-10-031-3/+3
| | | | | | | | | | | | | Instead of always storing all source locations for the selector identifiers we check whether all the identifiers are in a "standard" position; "standard" position is -Immediately before the arguments: -(id)first:(int)x second:(int)y; -With a space between the arguments: -(id)first: (int)x second: (int)y; -For nullary selectors, immediately before ';': -(void)release; In such cases we infer the locations instead of storing them. llvm-svn: 140989
* Add support for alignment-specifiers in C1X and C++11, removePeter Collingbourne2011-09-291-1/+1
| | | | | | | support for the C++0x draft [[align]] attribute and add the C1X standard header file stdalign.h llvm-svn: 140796
* objc arc: Diagnose block pointer type mismatch whenFariborz Jahanian2011-09-281-0/+25
| | | | | | | | some arguments types are ns_consumed and some otherwise matching types are not. This is objc side of // rdar://10187884 llvm-svn: 140729
* Only print _Bool as 'bool' when 'bool' is defined as an object-likeDouglas Gregor2011-09-271-6/+0
| | | | | | macro whose only replacement token is '_Bool'. llvm-svn: 140656
* When 'bool' is not a built-in type but is defined as a macro, printDouglas Gregor2011-09-271-3/+9
| | | | | | | 'bool' rather than '_Bool' within types, to make things a bit more readable. Fixes <rdar://problem/10063263>. llvm-svn: 140650
* Fix assertion hit when @encoding C++ classes. rdar://10172840 & ↵Argyrios Kyrtzidis2011-09-261-2/+3
| | | | | | http://llvm.org/PR10990 llvm-svn: 140542
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-1/+1
| | | | llvm-svn: 140478
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-7/+0
| | | | llvm-svn: 140407
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-16/+16
| | | | llvm-svn: 140367
* [PCH] Fix a regression that r139441 introduced (decls were getting passedArgyrios Kyrtzidis2011-09-131-4/+1
| | | | | | | | | | | | | | | | | to the consumer without being fully deserialized). The regression was on compiling boost.python and it was too difficult to get a reduced test case unfortunately. Also modify the logic of how objc methods are getting passed to the consumer; codegen depended on receiving objc methods before the implementation decl. Since the interesting objc methods are ones with a body and such methods only exist inside an ObjCImplDecl, deserialize and pass to consumer all the methods of ObCImplDecl when we see one. Fixes http://llvm.org/PR10922 & rdar://10117105. llvm-svn: 139644
* Switch LangOptions over to a .def file that describes header of theDouglas Gregor2011-09-131-1/+1
| | | | | | | | | | language options. Use that .def file to declare the LangOptions class and initialize all of its members, eliminating a source of annoying initialization bugs. AST serialization changes are next up. llvm-svn: 139605
* Clean up our handling of Objective-C definitions in AST files. RatherDouglas Gregor2011-09-101-1/+4
| | | | | | | | | than having CodeGen check whether a declaration comes from an AST file (which it shouldn't know or care about), make sure that the AST writer and reader pass along "interesting" declarations that CodeGen needs to know about. llvm-svn: 139441
* 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
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-77/+90
| | | | | | | | 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
* objc - fix up the builtin type for objc_assign_ivar.Fariborz Jahanian2011-08-231-1/+5
| | | | | | // rdar://9362887. llvm-svn: 138412
* 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-171-8/+4
| | | | llvm-svn: 137896
* Fix typo.Francois Pichet2011-08-141-4/+4
| | | | llvm-svn: 137585
* Implement function template specialization at class scope extension in ↵Francois Pichet2011-08-141-1/+20
| | | | | | | | | | | | | | | | | 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
* 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
* More whitespace and naming fixup. No functionality change.Chad Rosier2011-08-041-2/+2
| | | | llvm-svn: 136944
* Whitespace.Chad Rosier2011-08-041-9/+7
| | | | llvm-svn: 136929
* Fix style and remove obviously redundant code.Chad Rosier2011-08-041-1/+0
| | | | llvm-svn: 136907
* Change ASTContext::getSideTableAllocatedMemory() to use ↵Ted Kremenek2011-07-271-12/+14
| | | | | | llvm::capacity_in_bytes(). llvm-svn: 136235
OpenPOWER on IntegriCloud