summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement most of N3638 (return type deduction for normal functions).Richard Smith2013-05-041-12/+26
| | | | | | | Missing (somewhat ironically) is support for the new deduction rules in lambda functions, plus PCH support for return type patching. llvm-svn: 181108
* Support __wchar_t in -fms-extensions and -fms-compatibility modes.Hans Wennborg2013-05-031-2/+3
| | | | | | | | | | | | | | MSVC provides __wchar_t, either as an alias for the built-in wchar_t type, or as a separate type depending on language (C vs C++) and flags (-fno-wchar). In -fms-extensions, Clang will simply accept __wchar_t as an alias for whatever type is used for wide character literals. In -fms-compatibility, we try to mimic MSVC's behavior by always making __wchar_t a builtin type. This fixes PR15815. llvm-svn: 181004
* [document parsing]: support c++11 type aliasesFariborz Jahanian2013-05-021-1/+1
| | | | | | | with no comment of their own to inherit the comment of their aliased type. // rdar://13752382 llvm-svn: 180924
* Don't treat a non-deduced 'auto' type as being type-dependent. Instead, thereRichard Smith2013-04-301-4/+13
| | | | | | | | are now two distinct canonical 'AutoType's: one is the undeduced 'auto' placeholder type, and the other is a deduced-but-dependent type. All deduced-to-a-non-dependent-type cases are still non-canonical. llvm-svn: 180789
* documenttion parsing. Provide a c-index testFariborz Jahanian2013-04-261-1/+3
| | | | | | | and limit comment extraction to public c++ bases. // rdar://13647476 llvm-svn: 180646
* document parsing. When a sub-class (c++ Objective-C) missing Fariborz Jahanian2013-04-261-0/+45
| | | | | | | | a comment, grab the first comment found in its class heirarchy. Also, when a category is mossing a comment, grab comment of its primary class. // rdar://13647476 llvm-svn: 180629
* Implement C++1y decltype(auto).Richard Smith2013-04-261-4/+6
| | | | llvm-svn: 180610
* [document parsing]: When tag declaration (but not definition!) Fariborz Jahanian2013-04-171-1/+6
| | | | | | | is part of the decl-specifier-seq of some other declaration, it doesn't get comment. // rdar://12390371 llvm-svn: 179722
* In ASTContext::getOverriddenMethods, call ↵Argyrios Kyrtzidis2013-04-171-2/+2
| | | | | | | | overridden_methods_begin/overridden_methods_end directly. This avoids unnecessary Decl::getASTContext() invocations. llvm-svn: 179653
* Revert "Speed-up ObjCMethodDecl::getOverriddenMethods()."Argyrios Kyrtzidis2013-04-151-35/+2
| | | | | | | | | | | This reverts commit r179436. Due to caching, it was possible that we could miss overridden methods that were introduced by categories later on. Along with reverting the commit I also included a test case that would have caught this. llvm-svn: 179547
* Speed-up ObjCMethodDecl::getOverriddenMethods().Argyrios Kyrtzidis2013-04-131-2/+35
| | | | | | | Use an newly introduce ASTContext::getBaseObjCCategoriesAfterInterface() which caches its results instead of re-calculating the categories multiple times. llvm-svn: 179436
* Add an option to parse all comments as documentation commentsDmitri Gribenko2013-04-101-1/+3
| | | | | | Patch by Amin Shali. llvm-svn: 179180
* Don't eagerly deserialize every templated function (and every static dataRichard Smith2013-04-011-1/+9
| | | | | | member inside a class template) when loading a PCH file or module. llvm-svn: 178496
* [ms-cxxabi] Correctly compute the size of member pointersReid Kleckner2013-03-281-4/+1
| | | | | | | | | | | | | | | | | Summary: This also relaxes the requirement on Windows that the member pointer class type be a complete type (http://llvm.org/PR12070). We still ask for a complete type to instantiate any templates (MSVC does this), but if that fails we continue as normal, relying on any inheritance attributes on the declaration. Reviewers: rjmccall CC: triton, timurrrr, cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D568 llvm-svn: 178283
* Further weaken block conversion rules to permit blocks withJohn McCall2013-03-211-10/+25
| | | | | | | | | enum return type to be converted to blocks with any integer type of the same size. rdar://13463504 llvm-svn: 177613
* Revert "Remove a pointless assertion."Bob Wilson2013-03-151-1/+5
| | | | | | | | | This reverts commit r177158. I'm blindly reverting this because it appears to be breaking numerous buildbots. I'll reapply if it doesn't turn out to be the culprit. llvm-svn: 177165
* Remove a pointless assertion.Nico Weber2013-03-151-5/+1
| | | | | | | | | FindNodeOrInsertPos() is called 10 lines earlier already, and the function early-returns there if the result is != 0. InsertPos isn't recomputed after that check, so this assert is always trivially true. (And it has nothing to do with if T is canonical or not.) llvm-svn: 177158
* Remove a bogus assert so we don't crash inRafael Espindola2013-03-121-2/+0
| | | | | | | | | | | namespace { struct X {}; } extern "C" { X b = X(); } llvm-svn: 176866
* ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.Jordan Rose2013-03-081-15/+21
| | | | | | No (intended) functionality change. llvm-svn: 176726
* Promote atomic type sizes up to a power of two, capped byJohn McCall2013-03-071-8/+11
| | | | | | | | MaxAtomicPromoteWidth. Fix a ton of terrible bugs with _Atomic types and (non-intrinsic-mediated) loads and stores thereto. llvm-svn: 176658
* Streamify getNameForDiagnostic and remove the string versions of ↵Benjamin Kramer2013-02-221-4/+2
| | | | | | PrintTemplateArgumentList. llvm-svn: 175894
* Comment parsing: add CommentOptions to allow specifying custom comment block ↵Dmitri Gribenko2013-02-221-1/+1
| | | | | | | | | | | | | | | | commands Add an ability to specify custom documentation block comment commands via a new class CommentOptions. The intention is that this class will hold future customizations for comment parsing, including defining documentation comments with specific numbers of parameters, etc. CommentOptions instance is a member of LangOptions. CommentOptions is controlled by a new command-line parameter -fcomment-block-commands=Foo,Bar,Baz. llvm-svn: 175892
* Include llvm::Optional in clang/Basic/LLVM.hDavid Blaikie2013-02-201-1/+1
| | | | | | Post-commit CR feedback from Jordan Rose regarding r175594. llvm-svn: 175679
* Replace TypeLoc llvm::cast support to be well-defined.David Blaikie2013-02-181-2/+2
| | | | | | | | | | | | | | The TypeLoc hierarchy used the llvm::cast machinery to perform undefined behavior by casting pointers/references to TypeLoc objects to derived types and then using the derived copy constructors (or even returning pointers to derived types that actually point to the original TypeLoc object). Some context is in this thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056804.html Though it's spread over a few months which can be hard to read in the mail archive. llvm-svn: 175462
* objective-C: Fixes a compiler crash when encodingFariborz Jahanian2013-02-151-4/+10
| | | | | | | an ivar of type pointer to a typedef'ed object. // rdar://13190095 llvm-svn: 175298
* Add OpenCL samplers as Clang builtin types and check sampler related ↵Guy Benyei2013-02-071-0/+7
| | | | | | restrictions. llvm-svn: 174601
* Constify ASTContext::getObjContainingInterfaceDmitri Gribenko2013-02-031-4/+8
| | | | llvm-svn: 174282
* Add support for AArch64 target.Tim Northover2013-01-311-0/+83
| | | | | | | | | | | | | In cooperation with the LLVM patch, this should implement all scalar front-end parts of the C and C++ ABIs for AArch64. This patch excludes the NEON support also reviewed due to an outbreak of batshit insanity in our legal department. That will be committed soon bringing the changes to precisely what has been approved. Further reviews would be gratefully received. llvm-svn: 174055
* Comment parsing: attach any tag type's documentation to its typedef if latterDmitri Gribenko2013-01-271-4/+12
| | | | | | | | does not have one of its own. // rdar://13067629 Original patch (r173586 and r173587) by Fariborz Jahanian, modified by me. llvm-svn: 173626
* Revert r173586 (and r173587) , "Attach any tag type's documentation to its ↵NAKAMURA Takumi2013-01-271-4/+4
| | | | | | | | typedef if" It caused unexpected warnings with @tparam. llvm-svn: 173614
* Fix comment.Fariborz Jahanian2013-01-261-1/+1
| | | | llvm-svn: 173587
* Attach any tag type's documentation to its typedef ifFariborz Jahanian2013-01-261-3/+3
| | | | | | latter does not have one of its own. // rdar://13067629 llvm-svn: 173586
* Added ASTContext methods getIntPtrType and getUIntPtrType.Enea Zaffanella2013-01-261-0/+8
| | | | llvm-svn: 173581
* simplify code by removing excessive bracing.Fariborz Jahanian2013-01-251-20/+12
| | | | llvm-svn: 173521
* Attach enum's documentation to its typedef ifFariborz Jahanian2013-01-251-0/+10
| | | | | | latter does not have one of its own. // rdar://13067629 llvm-svn: 173516
* The standard ARM C++ ABI dictates that inline functions areJohn McCall2013-01-251-7/+10
| | | | | | | | never key functions. We did not implement that rule for the iOS ABI, which was driven by what was implemented in gcc-4.2. However, implement it now for other ARM-based platforms. llvm-svn: 173515
* First pass at abstracting out a class for the target C++ ABI.John McCall2013-01-251-9/+12
| | | | llvm-svn: 173514
* Add a new LangOpt NativeHalfType. This option allows for native half/fp16Joey Gouly2013-01-231-1/+1
| | | | | | | | operations (as opposed to storage only half/fp16). Also add some semantic checks for OpenCL half types. llvm-svn: 173254
* Implement OpenCL event_t as Clang builtin type, including event_t related ↵Guy Benyei2013-01-201-0/+4
| | | | | | OpenCL restrictions (OpenCL 1.2 spec 6.9) llvm-svn: 172973
* In Objective-C ARC, completely ignore ownership qualifiers on theDouglas Gregor2013-01-171-2/+17
| | | | | | | | return type of a function by canonicalizing them away. They are useless anyway, and conflict with our rules for template argument deduction and __strong. Fixes <rdar://problem/12367446>. llvm-svn: 172768
* Rework the traversal of Objective-C categories and extensions toDouglas Gregor2013-01-161-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | consider (sub)module visibility. The bulk of this change replaces myriad hand-rolled loops over the linked list of Objective-C categories/extensions attached to an interface declaration with loops using one of the four new category iterator kinds: visible_categories_iterator: Iterates over all visible categories and extensions, hiding any that have their "hidden" bit set. This is by far the most commonly used iterator. known_categories_iterator: Iterates over all categories and extensions, ignoring the "hidden" bit. This tends to be used for redeclaration-like traversals. visible_extensions_iterator: Iterates over all visible extensions, hiding any that have their "hidden" bit set. known_extensions_iterator: Iterates over all extensions, whether they are visible to normal name lookup or not. The effect of this change is that any uses of the visible_ iterators will respect module-import visibility. See the new tests for examples. Note that the old accessors for categories and extensions are gone; there are *Raw() forms for some of them, for those (few) areas of the compiler that have to manipulate the linked list of categories directly. This is generally discouraged. Part two of <rdar://problem/10634711>. llvm-svn: 172665
* Disable caching of visibility.Rafael Espindola2013-01-121-1/+0
| | | | | | | | | | | | | | The testcase in pr14929 shows that this is extremely hard to do. If we choose to apply the attribute, that causes the visibility of some decls to change and that can happen really late (during codegen). Current gcc warns and ignores the attribute in this testcase with a warning. This suggest that the correct solution is to find a point in the compilation where we can compute the visibility and * assert it was never computed before * reject any attempts to compute it again in the future (with warnings). llvm-svn: 172305
* comment parsing: when property accessors don't have commentFariborz Jahanian2013-01-121-1/+10
| | | | | | | of their own (or are syntheszed), use prperty's comment. for them. // rdar://12791315 llvm-svn: 172278
* Suppress GCC -Wreturn warning.David Blaikie2013-01-091-0/+1
| | | | | | Modified from a patch by David Greene. llvm-svn: 171982
* Clear the LV cache when setting the instantiated from link.Rafael Espindola2013-01-081-0/+1
| | | | | | Fixes pr14835. llvm-svn: 171857
* Fix up various builtin declaration of objc_msgSend familiesFariborz Jahanian2013-01-041-1/+16
| | | | | | | to match those foung in objc.h an avoid spurious warnings. // rdar://12489098 llvm-svn: 171492
* Convert an if that never happens to an assert.Rafael Espindola2013-01-021-3/+2
| | | | llvm-svn: 171354
* Robustify the @encode code and add support for _Atomic.John McCall2012-12-201-52/+109
| | | | | | Fixes PR14628. llvm-svn: 170639
* Re-commit r170428 changes with Linux style file endings.Guy Benyei2012-12-181-0/+19
| | | | | | Add OpenCL images as clang builtin types. llvm-svn: 170432
* Revert changes from r170428, as I accidentally changed the line endings of ↵Guy Benyei2012-12-181-19/+0
| | | | | | these files to Windows style. llvm-svn: 170431
OpenPOWER on IntegriCloud