summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Fix the AST representation for non-type template arguments to encodeEli Friedman2012-09-261-3/+6
| | | | | | | | | | | | enough information so we can mangle them correctly in cases involving dependent parameter types. (This specifically impacts cases involving null pointers and cases involving parameters of reference type.) Fix the mangler to use this information instead of trying to scavenge it out of the parameter declaration. <rdar://problem/12296776>. llvm-svn: 164656
* Comment AST: TableGen'ize all command lists in CommentCommandTraits.cpp.Dmitri Gribenko2012-09-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now we have a list of all commands. This is a good thing in itself, but it also enables us to easily implement typo correction for command names. With this change we have objects that contain information about each command, so it makes sense to resolve command name just once during lexing (currently we store command names as strings and do a linear search every time some property value is needed). Thus comment token and AST nodes were changed to contain a command ID -- index into a tables of builtin and registered commands. Unknown commands are registered during parsing and thus are also uniformly assigned an ID. Using an ID instead of a StringRef is also a nice memory optimization since ID is a small integer that fits into a common bitfield in Comment class. This change implies that to get any information about a command (even a command name) we need a CommandTraits object to resolve the command ID to CommandInfo*. Currently a fresh temporary CommandTraits object is created whenever it is needed since it does not have any state. But with this change it has state -- new commands can be registered, so a CommandTraits object was added to ASTContext. Also, in libclang CXComment has to be expanded to include a CXTranslationUnit so that all functions working on comment AST nodes can get a CommandTraits object. This breaks binary compatibility of CXComment APIs. Now clang_FullComment_getAsXML(CXTranslationUnit TU, CXComment CXC) doesn't need TU parameter anymore, so it was removed. This is a source-incompatible change for this C API. llvm-svn: 163540
* Added missing const.Abramo Bagnara2012-09-091-1/+1
| | | | llvm-svn: 163477
* Fixed support for disabled wchar_t and added an appropriate test.Abramo Bagnara2012-09-091-2/+2
| | | | llvm-svn: 163476
* Change the representation of builtin functions in the ASTEli Friedman2012-08-311-0/+3
| | | | | | | | | (__builtin_* etc.) so that it isn't possible to take their address. Specifically, introduce a new type to represent a reference to a builtin function, and a new cast kind to convert it to a function pointer in the operand of a call. Fixes PR13195. llvm-svn: 162962
* objective-C: clang must implicitly convert Fariborz Jahanian2012-08-301-0/+1
| | | | | | | | | | | __objc_yes/__objc_no to (BOOL)1/(BOOL)0 when BOOL is declared; otherwise it resorts to default of 'signed char'. This is important to selecting the correct Numeric API numberWithBool: Can't have a clang test for this. Will checkin and executable llvm test. // rdar://12156616 llvm-svn: 162922
* Fix a crash in type merging with enum types.Eli Friedman2012-08-301-3/+6
| | | | llvm-svn: 162886
* Fix a -Wdocumentation warning.Dmitri Gribenko2012-08-281-3/+3
| | | | llvm-svn: 162730
* Attaching comments to decls: since it was decided that Decl::isImplicit shouldDmitri Gribenko2012-08-231-2/+0
| | | | | | | | | | | | not be set for implicit instantiations, remove the FIXME. This should be the last bit for PR13634. The actual fix happened in r162238. Motivation: it might be misleading to mark implicit instantiations as Decl::isImplicit = true. Because then, in order to be consistent, we should mark all instantiated members as implicit. But the user did actually type the declaration for the member, but the compiler played with it a little bit. llvm-svn: 162488
* ASTContext::getCommentForDecl: add comment.Dmitri Gribenko2012-08-221-0/+4
| | | | llvm-svn: 162374
* Attaching comments to declarations: when documentation is requested for anDmitri Gribenko2012-08-221-5/+62
| | | | | | implicit instantiation, look for documentation attached to the template. llvm-svn: 162371
* When performing a trivial copy of a C++ type, we must be careful notJohn McCall2012-08-211-0/+21
| | | | | | | | | | | to overwrite objects that might have been allocated into the type's tail padding. This patch is missing some potential optimizations where the destination is provably a complete object, but it's necessary for correctness. Patch by Jonathan Sauer. llvm-svn: 162254
* Attaching comments to declarations: ignore implicit decls. Decl::isImplicit()Dmitri Gribenko2012-08-201-0/+18
| | | | | | | | does not return true for all implicit decls currently. This should fix PR13634 for now, but Decl::isImplicit() should be fixed, too. llvm-svn: 162238
* Attaching comments to declarations: parse the comment in context of theDmitri Gribenko2012-08-161-3/+20
| | | | | | declaration it was attached to. llvm-svn: 162033
* Fix misaligned allocation of QualifiedTempateName and DependentTemplateName.Richard Smith2012-08-161-5/+10
| | | | llvm-svn: 162005
* Attaching comments to redeclarations: fix wrong assumptionsDmitri Gribenko2012-08-141-6/+26
| | | | | | | | | | | | | | | | | | The reason for the recent fallout for "attaching comments to any redeclaration" change are two false assumptions: (1) a RawComment is attached to a single decl (not true for 'typedef struct X *Y' where we want the comment to be attached to both X and Y); (2) the whole redeclaration chain has only a single comment (obviously false, the user can put a separate comment for each redeclaration). To fix (1) I revert the part of the recent change where a 'Decl*' member was introduced to RawComment. Now ASTContext has a separate DenseMap for mapping 'Decl*' to 'FullComment*'. To fix (2) I just removed the test with this assumption. We might not parse every comment in redecl chain if we already parsed at least one. llvm-svn: 161878
* Factor out computation of whether a typeid's expression is potentiallyRichard Smith2012-08-131-1/+1
| | | | | | evaluated into a CXXTypeid member function. No functionality change. llvm-svn: 161779
* When looking for the comment associated with a declaration, adjust theDouglas Gregor2012-08-131-0/+11
| | | | | | | | 'templated' declaration for a function or class template to refer to the function or class template itself, to which the documentation will be attached. Fixes PR13593. llvm-svn: 161762
* Attaching comments to declarations: find comment attached to any redeclarationDmitri Gribenko2012-08-111-43/+55
| | | | | | | | Not only look for the comment near the declaration itself, but also walk the redeclaration chain: the previous declaration might have had a documentation comment. llvm-svn: 161722
* Comment parsing: extract TableGen'able pieces into new CommandTraits class.Dmitri Gribenko2012-08-091-3/+6
| | | | llvm-svn: 161548
* Attaching comments to declarations: handle using-declaration.Dmitri Gribenko2012-08-021-2/+2
| | | | llvm-svn: 161211
OpenPOWER on IntegriCloud