summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* Fix a tranche of comment, test and doc typosAlp Toker2013-12-052-4/+4
| | | | llvm-svn: 196510
* [objc] If an interface has no initializer marked as designated and ↵Argyrios Kyrtzidis2013-12-051-14/+48
| | | | | | | | | | | introduces at least one new initializer, don't assume that it inherits the designated initializers from the super class. If the assumption was wrong because a new initializer was a designated one that was not marked as such, we will emit misleading warnings for subclasses of the interface. llvm-svn: 196476
* Correct hyphenations in comments and assert messagesAlp Toker2013-12-052-4/+4
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities in nearby lines. llvm-svn: 196466
* Add an AdjustedType sugar node for adjusting calling conventionsReid Kleckner2013-12-059-25/+68
| | | | | | | | | | | | | | | | Summary: In general, this type node can be used to represent any type adjustment that occurs implicitly without losing type sugar. The immediate use of this is to adjust the calling conventions of member function pointer types without breaking template instantiation. Fixes PR17996. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2332 llvm-svn: 196451
* [objc] Emit warning when the implementation of a secondary initializer calls onArgyrios Kyrtzidis2013-12-031-0/+8
| | | | | | | | | | | super another initializer and when the implementation does not delegate to another initializer via a call on 'self'. A secondary initializer is an initializer method not marked as a designated initializer within a class that has at least one initializer marked as a designated initializer. llvm-svn: 196318
* [objc] Emit warnings when the implementation of a designated initializer ↵Argyrios Kyrtzidis2013-12-031-2/+5
| | | | | | | | calls on super an initializer that is not a designated one or any initializer on self. llvm-svn: 196317
* [objc] Emit a warning when the implementation of a designated initializer ↵Argyrios Kyrtzidis2013-12-031-2/+43
| | | | | | | | does not chain to an init method that is a designated initializer for the superclass. llvm-svn: 196316
* [objc] Introduce ObjCInterfaceDecl::getDesignatedInitializers() to get theArgyrios Kyrtzidis2013-12-031-0/+29
| | | | | | | | | | designated initializers of an interface. If the interface declaration does not have methods marked as designated initializers then the interface inherits the designated initializers of its super class. llvm-svn: 196315
* CommentLexer: When proceeding with a typo corrected name don't clobber the ↵Benjamin Kramer2013-12-011-5/+6
| | | | | | | | token. This would crash if the token is used in another diagnostic. PR18051. llvm-svn: 196048
* Don't call getMostRecentDecl when we know we have it.Rafael Espindola2013-11-261-11/+22
| | | | | | On a Release build this takes the testcase in pr18055 from 0m3.892s to 0m1.452s. llvm-svn: 195768
* Move these virtual methods out of line.Rafael Espindola2013-11-261-2/+10
| | | | llvm-svn: 195767
* Remove some unused localsAlp Toker2013-11-261-2/+1
| | | | llvm-svn: 195714
* [-cxx-abi microsoft] Create backrefs for <unnamed-type-`id'>David Majnemer2013-11-251-14/+16
| | | | | | | | | | | | | | | It wasn't possible for an anonymous type to show up inside of function arguments. However, decltype (which MSVC added support for in 2010) makes this possible. Further, backrefs to these anonymous types can now be formed. This fixes PR18022. N.B. We do not, and very likely _will not_, support MSVC's bug where subsequent typedefs of anonymous types leak into the linkage name; this is a gross violation of the ABI. A warning should be introduced to inform our users of this particular shortcoming. llvm-svn: 195669
* Take cv-qualifiers on fields of class type into account when determiningRichard Smith2013-11-251-0/+7
| | | | | | whether a defaulted special member function should be deleted. llvm-svn: 195620
* Use specific_attr_iterator to tighten loop over ObjCSuppressProtocolAttrs.Ted Kremenek2013-11-231-8/+4
| | | | llvm-svn: 195561
* Move logic to check if a class is tagged with objc_suppress_protocol_methods ↵Ted Kremenek2013-11-231-12/+18
| | | | | | into a helper. llvm-svn: 195559
* Add Distance parameter to ASTNodeKind::isBaseOf.Peter Collingbourne2013-11-231-4/+10
| | | | | | | | This will allow the completer to order results by relevance. Differential Revision: http://llvm-reviews.chandlerc.com/D2209 llvm-svn: 195540
* Add back experimental attribute objc_suppress_protocol_methods (slightly ↵Ted Kremenek2013-11-231-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | renamed). This is still an experimental attribute, but I wanted it in tree for review. It may still get yanked. This attribute can only be applied to a class @interface, not a class extension or category. It does not change the type system rules for Objective-C, but rather the implementation checking for Objective-C classes that explicitly conform to a protocol. During protocol conformance checking, clang recursively searches up the class hierarchy for the set of methods that compose a protocol. This attribute will cause the compiler to not consider the methods contributed by a super class, its categories, and those from its ancestor classes. Thus this attribute is used to force subclasses to redeclare (and hopefully re-implement) methods if they decide to explicitly conform to a protocol where some of those methods may be provided by a super class. This attribute intentionally leaves out properties, which are associated with state. This attribute only considers methods (at least right now) that are non-property accessors. These represent methods that "do something" as dictated by the protocol. This may be further refined, and this should be considered a WIP until documentation gets written or this gets removed. llvm-svn: 195533
* Change ObjCIntefaceDecl::lookupMethod() to have optional 'followsSuper' ↵Ted Kremenek2013-11-231-5/+11
| | | | | | | | | | | | | | argument. This enables a micro-optimization in protocol conformance checking to not examine the class hierarchy twice per method. As part of this change, remove the default arguments from lookupInstanceMethod() and lookupClassMethod(). It was becoming very redundant. For clients needing the default arguments, have them use the full API instead of these convenience methods. llvm-svn: 195532
* Add class-specific operator new to Decl hierarchy. This guarantees that DeclsRichard Smith2013-11-227-375/+284
| | | | | | | | | | | | | can't accidentally be allocated the wrong way (missing prefix data for decls from AST files, for instance) and simplifies the CreateDeserialized functions a little. An extra DeclContext* parameter to the not-from-AST-file operator new allows us to ensure that we don't accidentally call the wrong one when deserializing (when we don't have a DeclContext), allows some extra checks, and prepares for some planned modules-related changes to Decl allocation. No functionality change intended. llvm-svn: 195426
* Test commit for the user "kromanova" to verify commit access. I removed ↵Ekaterina Romanova2013-11-211-1/+1
| | | | | | "UNSUPPORTED" comment because unsigned __int128 type is in fact supported. llvm-svn: 195378
* Revert "Add new attribute 'objc_suppress_protocol' to suppress protocol ↵Ted Kremenek2013-11-211-22/+4
| | | | | | | | | | | conformance for a class." After implementing this patch, a few concerns about the language feature itself emerged in my head that I had previously not considered. I want to resolve those design concerns first before having a half-designed language feature in the tree. llvm-svn: 195328
* Add new attribute 'objc_suppress_protocol' to suppress protocol conformance ↵Ted Kremenek2013-11-211-4/+22
| | | | | | | | | | | | | | | | | | | | | | | for a class. The idea is to allow a class to stipulate that its methods (and those of its parents) cannot be used for protocol conformance in a subclass. A subclass is then explicitly required to re-implement those methods of they are present in the class marked with this attribute. Currently the attribute can only be applied to an @interface, and not a category or class extension. This is by design. Unlike protocol conformance, where a category can add explicit conformance of a protocol to class, this anti-conformance really needs to be observed uniformly by all clients of the class. That's because the absence of the attribute implies more permissive checking of protocol conformance. This unfortunately required changing method lookup in ObjCInterfaceDecl to take an optional protocol parameter. This should not slow down method lookup in most cases, and is just used for protocol conformance. llvm-svn: 195323
* ObjectiveC ARC. Better checking of toll free briding Fariborz Jahanian2013-11-201-11/+9
| | | | | | | from qualified-id objects to CF types with objc_bridge annotation. // rdar://15454846 llvm-svn: 195264
* ObjectiveC ARC. validate toll free bridge castingFariborz Jahanian2013-11-201-0/+58
| | | | | | | to or from 'id' and qualified-id types. // rdar://15454846 llvm-svn: 195178
* Add a mangler entry point for TBAA rather than using RTTI directlyReid Kleckner2013-11-192-0/+14
| | | | | | | | | | | | | | | | | | | | Summary: RTTI is not yet implemented for the Microsoft C++ ABI and isn't expected soon. We could easily add the mangling, but the error is what prevents us from silently miscompiling code that expects RTTI. Instead, add a new mangleTypeName entry point that simply forwards to mangleName or mangleType to produce a string that isn't part of the ABI. Itanium can continue to use RTTI names to avoid unecessary test breakage. This also seems like the right design. The fact that TBAA names happen to be RTTI names is now an implementation detail of the mangler, rather than part of TBAA. Differential Revision: http://llvm-reviews.chandlerc.com/D2153 llvm-svn: 195168
* Microsoft Record Layout: zero sized base after base with vbtbl fixWarren Hunt2013-11-191-0/+11
| | | | | | | | | | Microsoft adds an extra byte of padding before laying out zero sized non-virtual bases if the non-virtual base before it contains a vbptr. This patch adds the same behavior to clang. Differential Revision: http://llvm-reviews.chandlerc.com/D2106 llvm-svn: 195158
* Fix the problem that the arm_neon.h can't be used in a cpp file. Also fix a ↵Hao Liu2013-11-171-3/+3
| | | | | | minor bug with poly64 name mangling. llvm-svn: 194952
* [-cxx-abi microsoft] Emit thunks for pointers to virtual member functionsHans Wennborg2013-11-151-0/+15
| | | | | | | | | | | | | | | | Instead of storing the vtable offset directly in the function pointer and doing a branch to check for virtualness at each call site, the MS ABI generates a thunk for calling the function at a specific vtable offset, and puts that in the function pointer. This patch adds support for emitting such thunks. However, it doesn't support pointers to virtual member functions that are variadic, have an incomplete aggregate return type or parameter, or are overriding a function in a virtual base class. Differential Revision: http://llvm-reviews.chandlerc.com/D2104 llvm-svn: 194827
* Modern gcc is happy to constant evaluate __builtin_strlen in various casesRichard Smith2013-11-151-17/+42
| | | | | | | where we didn't. Extend our constant evaluation for __builtin_strlen to handle any constant array of chars, not just string literals, to match. llvm-svn: 194762
* DR408: If a static data member of incomplete array type is declared in a classRichard Smith2013-11-141-0/+3
| | | | | | | | | | template, that member has a dependent type (even if we can see the definition of the member of the primary template), because the array size could change in a member specialization. Patch by Karthik Bhat! llvm-svn: 194740
* [OpenCL] Make sure we put string literals in the constant address space.Joey Gouly2013-11-141-0/+2
| | | | llvm-svn: 194717
* Added warning on structures/unions that are empty or contain onlySerge Pavlov2013-11-142-19/+22
| | | | | | | | | | bit fields of zero size. Warnings are generated in C++ mode and if only such type is defined inside extern "C" block. The patch fixed PR5065. Differential Revision: http://llvm-reviews.chandlerc.com/D2151 llvm-svn: 194653
* No functional change. Renaming a variable in RecordLayoutBuilder and Warren Hunt2013-11-132-12/+15
| | | | | | | | improving comments to make documentation more accurate. Differential Revision:http://llvm-reviews.chandlerc.com/D2172 llvm-svn: 194609
* XCore target requires preferred alignment.Robert Lytton2013-11-121-0/+4
| | | | | | | | The xcore llvm backend does not handle 8 byte alignment viz: "%BadAlignment = alloca i64, align 8" So getPreferredTypeAlign() must never overalign. llvm-svn: 194462
* -fms-compatibility: Use C++98 null pointer constant rulesReid Kleckner2013-11-121-2/+8
| | | | | | Patch by Will Wilson! llvm-svn: 194441
* Avoid double StringMap lookups. No functionality change.Benjamin Kramer2013-11-101-5/+3
| | | | llvm-svn: 194355
* CommentSema: Factor code better. No functionality change.Benjamin Kramer2013-11-101-44/+28
| | | | llvm-svn: 194354
* Make -fdump-vtable-layouts print to stdout, not stderrReid Kleckner2013-11-081-3/+3
| | | | | | | | | | | | | This makes it consistent with -fdump-record-layouts, which was moved to outs() in r186219. My reasoning for going with stdout is that when one of these options is present, the layouts are really a program output, and shouldn't be interleaved with diagnostics, which are on stderr. Reviewers: timurrrr Differential Revision: http://llvm-reviews.chandlerc.com/D2127 llvm-svn: 194279
* Thread the info about vbptr sharing through ASTRecordLayoutTimur Iskhodzhanov2013-11-083-28/+14
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D2120 llvm-svn: 194256
* PR17615: A delegating constructor initializer is a full-expression. Don'tRichard Smith2013-11-071-2/+5
| | | | | | forget to clean up temporaries at the end of it. llvm-svn: 194213
* Minor refinement of VTableBuilder.h: fix wrong indentation, rename a struct ↵Timur Iskhodzhanov2013-11-071-2/+2
| | | | | | field with a more appropriate name llvm-svn: 194202
* [-fms-extensions] Add support for __FUNCDNAME__David Majnemer2013-11-063-0/+29
| | | | | | | | | | | | | | | | Summary: Similar to __FUNCTION__, MSVC exposes the name of the enclosing mangled function name via __FUNCDNAME__. This implementation is very naive and unoptimized, it is expected that __FUNCDNAME__ would be used rarely in practice. Reviewers: rnk, rsmith, thakis CC: cfe-commits, silvas Differential Revision: http://llvm-reviews.chandlerc.com/D2109 llvm-svn: 194181
* Silencing some MSVC warnings about not all control paths returning a value ↵Aaron Ballman2013-11-061-0/+2
| | | | | | when they actually do. llvm-svn: 194156
* Fix PR17738 - add support for vtordisp thunks when using -cxx-abi microsoftTimur Iskhodzhanov2013-11-063-41/+146
| | | | llvm-svn: 194132
* More constant evaluation cleanup, and fix an issue where we'd override anRichard Smith2013-11-061-22/+25
| | | | | | | earlier 'non-constant' diagnostic with a later one if the earlier one was from a side-effect we thought we could evaluate past. llvm-svn: 194117
* Microsoft adds weird padding before virtual bases if the last field was a ↵Warren Hunt2013-11-061-0/+9
| | | | | | | | | | bitfield This patch adds the same behavior to clang. Differential Revision: http://llvm-reviews.chandlerc.com/D2103 llvm-svn: 194115
* Introduce DynTypedNode::print, dump and getSourceRange.Peter Collingbourne2013-11-061-0/+47
| | | | | | | | | These functions can generally be applied to multiple kinds of AST node, so it makes sense to add them to DynTypedNode. Differential Revision: http://llvm-reviews.chandlerc.com/D2096 llvm-svn: 194113
* Simplify: we don't care why constant evaluation might have failed when we'reRichard Smith2013-11-051-6/+3
| | | | | | checking an expression for constant overflow. llvm-svn: 194099
* Refactor constant expression handling and make a couple of tweaks to make it aRichard Smith2013-11-051-64/+156
| | | | | | | | | bit more robust against future changes. This includes a slight diagnostic improvement: if we know we're only trying to form a constant expression, take the first diagnostic which shows the expression is not a constant expression, rather than preferring the first one which makes the expression unfoldable. llvm-svn: 194098
OpenPOWER on IntegriCloud