summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Add OpenCL images as clang builtin types.Guy Benyei2012-12-181-0/+19
| | | | llvm-svn: 170428
* objective-C blocks: Check for record type when deciding if Fariborz Jahanian2012-12-111-1/+1
| | | | | | | byref variable requires extended layout info. to prevent a crash involving arrays declared __block. // rdar://12787751 llvm-svn: 169908
* Don't use dyn_cast on a Type* which might not be canonical. Fixes an ↵Richard Smith2012-12-061-1/+2
| | | | | | extremely obscure record layout bug. llvm-svn: 169467
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-1/+1
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Pull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't ↵Benjamin Kramer2012-12-011-5/+6
| | | | | | | | | pull in all the generated Attr code. Required to pull some functions out of line, but this shouldn't have a perf impact. No functionality change. llvm-svn: 169092
* Merge function types in C.Rafael Espindola2012-11-291-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Among other differences, GCC accepts typedef int IA[]; typedef int A10[10]; static A10 *f(void); static IA *f(void); void g(void) { (void)sizeof(*f()); } but clang used to reject it with: invalid application of 'sizeof' to an incomplete type 'IA' (aka 'int []') The intention of c99's 6.2.7 seems to be that we should use the composite type and accept as gcc does. Doing the type merging required some extra fixes: * Use the type from the function type in initializations, even if an parameter is available. * Fix the merging of the noreturn attribute in function types. * Make CodeGen handle the fact that an parameter type can be different from the corresponding type in the function type. llvm-svn: 168895
* objective-C blocks: Make sure that identical logic is usedFariborz Jahanian2012-11-281-76/+36
| | | | | | | | | | in deciding a copy/dispose field is needed in a byref structure and when generating the copy/dispose helpers. In certain cases, these fields were being added but no copy/dispose was being generated. This was uncovered in ARC, but not in MRR. // rdar://12759433 llvm-svn: 168825
* Fix the definition of the vfork() builtin on Haiku. PR14378.Eli Friedman2012-11-271-0/+9
| | | | llvm-svn: 168674
* block extended signatur option. Change previous optionFariborz Jahanian2012-11-151-2/+2
| | | | | | | | to a cc1 -fencode-extended-block-signature and pass it to cc1 and recognize this option to produce extended block type signature. // rdar://12109031 llvm-svn: 168063
* Fix a trivial bool-related bug I spotted while skimming David Fang'sEli Friedman2012-11-151-2/+2
| | | | | | current list of powerpc-darwin8 failures. llvm-svn: 168016
* objective-C blocks: under cc1 flag -encode-extended-block-signature,Fariborz Jahanian2012-11-141-2/+12
| | | | | | | | generate expanded signature encoding to include types as we already do this for protocol method lists. // rdar://12109031 llvm-svn: 167997
* objective-C blocks: Provide layout map for byrefFariborz Jahanian2012-11-141-2/+32
| | | | | | variables captured in a block. // rdar://12184410 llvm-svn: 167931
* Provide the correct mangling and linkage for certain unnamed nested classes.David Blaikie2012-11-141-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | This corrects the mangling and linkage of classes (& their member functions) in cases like this: struct foo { struct { void func() { ... } } x; }; we were accidentally giving this nested unnamed struct 'no' linkage where it should've had the linkage of the outer class. The mangling was incorrecty too, mangling as TU-wide unnamed type mangling of $_X rather than class-scoped mangling of UtX_. This also fixes -Wunused-member-function which would incorrectly diagnose 'func' as unused due to it having no linkage & thus appearing to be TU-local when in fact it might be correctly used in another TU. Similar mangling should be applied to function local classes in similar cases but I've deferred that for a subsequent patch. Review/discussion by Richard Smith, John McCall, & especially Eli Friedman. llvm-svn: 167906
* Remove abuse of hasTrivial*, and fix miscompile wherein global arrays withRichard Smith2012-11-121-19/+12
| | | | | | | internal linkage, no uses, trivial construction, and nontrivial destruction were not emitted. llvm-svn: 167756
* Remove a const_cast by propagating constness to the member function.Dmitri Gribenko2012-11-031-8/+8
| | | | llvm-svn: 167357
* search for overridden methods with comment when overriding methodFariborz Jahanian2012-10-111-13/+17
| | | | | | | has none of its own. Factor in Doug's comments. // rdar://12378793 llvm-svn: 165771
* [Doc parsing] This patch searches overridden objc/c++Fariborz Jahanian2012-10-101-4/+56
| | | | | | | | | | methods looking for documentation on a particular base class inherited by any method that overrides the base class. In case of redeclaration, as when objc method is defined in the implementation, it also looks up for documentation in class/class extension being redeclared. llvm-svn: 165643
* Fix PR 11709: Change the definition of va_list to meet AAPCS requirementLogan Chien2012-10-101-0/+61
| | | | | | | | | | | | | AAPCS ABI Section 7.1.4 [1] specifies that va_list should be defined as struct __va_list { void *__ap;}; And in C++, it is defined in namespace std. [1] http://infocenter.arm.com/help/topic /com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf Patch by Weiming Zhao. llvm-svn: 165609
* Simplify the code using SmallVector::append(), as suggested by Benjamin Kramer.Argyrios Kyrtzidis2012-10-091-10/+3
| | | | llvm-svn: 165538
* Move the functionality that looks for ObjC overridden methods fromArgyrios Kyrtzidis2012-10-091-167/+7
| | | | | | | | ASTContext to the ObjCMethodDecl, and have the more generic ASTContext::getOverriddenMethods() use the ObjCMethodDecl::getOverriddenMethods() function. llvm-svn: 165518
* Move the logic that searches for overridden methods from libclang toArgyrios Kyrtzidis2012-10-091-0/+186
| | | | | | ASTContext so that it can be widely available. llvm-svn: 165473
* When storing the C++ overridden methods, store them once for theArgyrios Kyrtzidis2012-10-091-3/+4
| | | | | | canonical method; avoid storing them again for an out-of-line definition. llvm-svn: 165472
* Move the 'find macro by spelling' infrastructure to the Preprocessor class andDmitri Gribenko2012-09-291-3/+5
| | | | | | | use it to suggest appropriate macro for __attribute__((deprecated)) in -Wdocumentation-deprecated-sync. llvm-svn: 164892
OpenPOWER on IntegriCloud