summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* After further discussion it has been determined that alignof should report Chad Rosier2011-07-261-4/+1
| | | | | | the preferred alignment. Thus, revert r135934, r135935, and r135940. llvm-svn: 136062
* Allow target to specify about using minimum alignment vs preferred. Takes ↵Chad Rosier2011-07-251-1/+4
| | | | | | | | | care of FIXME: Override "preferred align" for double and long long for ARM apcs-gnu ABI. Also part of rdar://9802874 llvm-svn: 135940
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-16/+16
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Add a const overload for ObjCInterfaceDecl::all_declared_ivar_begin.Jordy Rose2011-07-221-17/+4
| | | | | | | | | This was previously not-const only because it has to lazily construct a chain of ivars the first time it is called (and after the chain is invalidated). In practice, all the clients were just const_casting their const Decls; all those now-unnecessary const_casts have been removed. llvm-svn: 135741
* In C99, emit an inline function when encountering an extern redeclaration.Nick Lewycky2011-07-181-1/+1
| | | | | | Fixes PR10233! llvm-svn: 135377
* revert fix for // rdar://9740328Fariborz Jahanian2011-07-121-1/+1
| | | | llvm-svn: 135010
* objc++: Some level of covariance is allowed in ObjC properties.Fariborz Jahanian2011-07-121-0/+4
| | | | | | Make it also available in ObjC++ propeties. // rdar://9740328 llvm-svn: 135001
* Centralize the getCanonicalType() calls in the Itanium C++ manglingDouglas Gregor2011-07-121-0/+25
| | | | | | code so that they only occur in a single place. No functionality change. llvm-svn: 134961
* r134634 causes a failure on MultiSource/Benchmarks/Olden/bh with TEST=nightly,Cameron Zwarich2011-07-071-1/+1
| | | | | | so roll it out. llvm-svn: 134638
* A redeclaration of an inline method in C99 mode should trigger emission of thatNick Lewycky2011-07-071-1/+1
| | | | | | function. Fixes PR10233! llvm-svn: 134634
* Zap a couple unnecessary loops.Eli Friedman2011-07-071-11/+1
| | | | llvm-svn: 134578
* Start switching the AST stats printing to use llvm::errs() instead ofChandler Carruth2011-07-041-26/+27
| | | | | | fprintf. There is more cleanup to be done to the AST stats printing... llvm-svn: 134373
* -Fix mistake in ASTContext::getInnerObjCOwnership noticed by DougArgyrios Kyrtzidis2011-07-011-1/+1
| | | | | | | | -Remove unnecessary 'return'. -Remove unnecessary 'if' check (llvm_unreachable make sure attrStr will be non-null) -Add a test of transferring ownership to a reference cast type. llvm-svn: 134285
* [ARC] When casting from a pointer to an objective-c object with known ↵Argyrios Kyrtzidis2011-07-011-0/+19
| | | | | | | | | | | | | | ownership, if the cast type has no ownership specified, implicitly "transfer" the ownership of the cast'ed type to the cast type: id x; static_cast<NSString**>(&x); // Casting as (__strong NSString**). This currently only works for C++ named casts, C casts to follow. llvm-svn: 134273
* Introduce the notion of instantiation dependence into Clang's AST. ADouglas Gregor2011-07-011-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | type/expression/template argument/etc. is instantiation-dependent if it somehow involves a template parameter, even if it doesn't meet the requirements for the more common kinds of dependence (dependent type, type-dependent expression, value-dependent expression). When we see an instantiation-dependent type, we know we always need to perform substitution into that instantiation-dependent type. This keeps us from short-circuiting evaluation in places where we shouldn't, and lets us properly implement C++0x [temp.type]p2. In theory, this would also allow us to properly mangle instantiation-dependent-but-not-dependent decltype types per the Itanium C++ ABI, but we aren't quite there because we still mangle based on the canonical type in cases like, e.g., template<unsigned> struct A { }; template<typename T> void f(A<sizeof(sizeof(decltype(T() + T())))>) { } template void f<int>(A<sizeof(sizeof(int))>); and therefore get the wrong answer. llvm-svn: 134225
* Preserve that a TemplateName was arrived at by substitutingJohn McCall2011-06-301-22/+79
| | | | | | | | | | | for a template template parameter. Uses to follow. I've also made the uniquing of SubstTemplateTemplateParmPacks use a ContextualFoldingSet as a minor space efficiency. llvm-svn: 134137
* Eliminate most uses of ShallowCollectObjCIvars which requiresFariborz Jahanian2011-06-281-2/+6
| | | | | | | a vector for collection. Use iterators where needed instead. // rdar://6817577 llvm-svn: 134015
* Be more thorough about mangling unresolved types.John McCall2011-06-281-1/+1
| | | | llvm-svn: 134011
* Fix regression with @encode string. rdar://9624314.Argyrios Kyrtzidis2011-06-171-2/+6
| | | | llvm-svn: 133312
* Automatic Reference Counting.John McCall2011-06-151-32/+20
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Eliminate a 'default' case in template argument deduction, where weDouglas Gregor2011-06-151-1/+1
| | | | | | | | | | | | | | | | | | were just punting on template argument deduction for a number of type nodes. Most of them, obviously, didn't matter. As a consequence of this, make extended vector types (via the ext_vector_type attribute) actually work properly for several important cases: - If the attribute appears in a type-id (i.e, not attached to a typedef), actually build a proper vector type - Build ExtVectorType whenever the size is constant; previously, we were building DependentSizedExtVectorType when the size was constant but the type was dependent, which makes no sense at all. - Teach template argument deduction to handle ExtVectorType/DependentSizedExtVectorType. llvm-svn: 133060
* Implement support for C++11 in-class initialization of non-static data members.Richard Smith2011-06-111-6/+12
| | | | llvm-svn: 132878
* Objective-C doesn't consider the use of incomplete types as methodDouglas Gregor2011-05-271-3/+16
| | | | | | | | | | | | | | parameter types to be ill-formed. However, it relies on the completeness of method parameter types when producing metadata, e.g., for a protocol, leading IR generating to crash in such cases. Since there's no real way to tighten down the semantics of Objective-C here without breaking existing code, do something safe but lame: suppress the generation of metadata when this happens. Fixes <rdar://problem/9123036>. llvm-svn: 132171
* Implement a little bit of cleanup and a lot more of the base workAlexis Hunt2011-05-251-1/+13
| | | | | | | | behind implicit moves. We now correctly identify move constructors and assignment operators and update bits on the record correctly. Generation of implicit moves (declarations or definitions) is not yet supported. llvm-svn: 132080
* Properly align UnaryTransformType when allocating itDouglas Gregor2011-05-251-3/+4
| | | | llvm-svn: 132064
* Implement a new type node, UnaryTransformType, designed to represent aAlexis Hunt2011-05-241-0/+18
| | | | | | | | type that turns one type into another. This is used as the basis to implement __underlying_type properly - with TypeSourceInfo and proper behavior in the face of templates. llvm-svn: 132017
* It's considered poor form to create references to the overloadedDouglas Gregor2011-05-211-0/+3
| | | | | | | function type. Educate template argument deduction thusly, fixing PR9974 / <rdar://problem/9479155>. llvm-svn: 131811
* Reapply the commits that r131401 reverted and add a fix for PR9927.Argyrios Kyrtzidis2011-05-171-23/+164
| | | | llvm-svn: 131446
* Revert 131377, 131369 and 131365.Rafael Espindola2011-05-161-163/+23
| | | | | | 131365 caused PR9927. llvm-svn: 131401
* Fix MSVC build.Argyrios Kyrtzidis2011-05-151-1/+1
| | | | llvm-svn: 131377
* Fix generation of obj-c @encoding for members with zero size.Argyrios Kyrtzidis2011-05-151-25/+33
| | | | | | Also follow gcc in that arrays of elements with zero size are encoded as arrays with zero elements. llvm-svn: 131369
* Create proper Objective-C @encoding for C++ classes; fixes rdar://9357400.Argyrios Kyrtzidis2011-05-141-20/+152
| | | | | | | | | | | | | | | | | | Go through and expand the members of bases into the encoding string (and encode the VTable as well). Unlike gcc which expands virtual bases as many times as they appear in the hierarchy, clang will only expand them once at the end, to reflect the actual layout. Note that there doesn't seem to be a way to indicate in the encoding that packing/alignment of members is different that normal, in which case the encoding will be out-of-sync with the real layout. If the runtime switches to just consider the size of types without taking into account alignment, we could easily make padding explicit in the encoding (e.g. using arrays of chars). The encoding strings would be longer then though. Also encode a flexible array member as array of 0 size, like gcc, not as a pointer. llvm-svn: 131365
* Rename "hasTrivialConstructor" to "hasTrivialDefaultConstructor" andAlexis Hunt2011-05-091-2/+5
| | | | | | | modify the semantics slightly to accomodate default constructors (I hope). llvm-svn: 131087
* Establish a new alignment for an ms_struct bitfield followingFariborz Jahanian2011-05-061-0/+12
| | | | | | a non-bitfield if size of their types differ. llvm-svn: 131023
* Modify some deleted function methods to better reflect reality:Alexis Hunt2011-05-061-1/+1
| | | | | | | | | | | | | | | | | | | | - New isDefined() function checks for deletedness - isThisDeclarationADefinition checks for deletedness - New doesThisDeclarationHaveABody() does what isThisDeclarationADefinition() used to do - The IsDeleted bit is not propagated across redeclarations - isDeleted() now checks the canoncial declaration - New isDeletedAsWritten() does what it says on the tin. - isUserProvided() now correct (thanks Richard!) This fixes the bug that we weren't catching void foo() = delete; void foo() {} as being a redefinition. llvm-svn: 131013
* Implement support for C++0x alias templates.Richard Smith2011-05-051-18/+38
| | | | llvm-svn: 130953
* __alignof attribute on the field must considerFariborz Jahanian2011-05-051-0/+4
| | | | | | packed attribute on the field. //rdar://9217290 llvm-svn: 130948
* More ms_struct bitfield stuff:Fariborz Jahanian2011-05-041-0/+7
| | | | | | | | Adjacent bit fields are packed into the same 1-, 2-, or 4-byte allocation unit if the integral types are the same size. // rdar://8823265. llvm-svn: 130851
* Only the first zero-length bitfield decides alignment ofFariborz Jahanian2011-05-031-1/+2
| | | | | | | the followup data member in an ms_struct struct. // rdar:// 8823265 llvm-svn: 130795
* More rule enforcement of zero bitfields for ms_struct.Fariborz Jahanian2011-05-021-0/+7
| | | | llvm-svn: 130696
* Re-applies the patch first applied way back in r106099, withChandler Carruth2011-05-011-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | accompanying fixes to make it work today. The core of this patch is to provide a link from a TemplateTypeParmType back to the TemplateTypeParmDecl node which declared it. This in turn provides much more precise information about the type, where it came from, and how it functions for AST consumers. To make the patch work almost a year after its first attempt, it needed serialization support, and it now retains the old getName() interface. Finally, it requires us to not attempt to instantiate the type in an unsupported friend decl -- specifically those coming from template friend decls but which refer to a specific type through a dependent name. A cleaner representation of the last item would be to build FriendTemplateDecl nodes for these, storing their template parameters etc, and to perform proper instantation of them like any other template declaration. They can still be flagged as unsupported for the purpose of access checking, etc. This passed an asserts-enabled bootstrap for me, and the reduced test case mentioned in the original review thread no longer causes issues, likely fixed at somewhere amidst the 24k revisions that have elapsed. llvm-svn: 130628
* PR9792: Make sure to use the right definition of wchar_t when the defaultEli Friedman2011-04-301-1/+1
| | | | | | wchar_t is an unsigned type. llvm-svn: 130620
* Enhance clang_getCXTUResourceUsage() to report the amount of memory used by ↵Ted Kremenek2011-04-281-0/+16
| | | | | | ASTContext's side tables. llvm-svn: 130383
* Some refactoring of my ms_struct patch.Fariborz Jahanian2011-04-271-0/+7
| | | | | | // rdar://8823265 related. llvm-svn: 130311
* Gcc pads the size of an array using the alignment of its elements.Argyrios Kyrtzidis2011-04-261-0/+1
| | | | | | | The size of the array may not be aligned according to alignment of its elements if an alignment attribute is specified in a typedef. Fixes rdar://8665729 & http://llvm.org/PR5637. llvm-svn: 130242
* Make yet another placeholder type, this one marking that an expression is a ↵John McCall2011-04-261-0/+3
| | | | | | | | | | | bound member function, i.e. something of the form 'x.f' where 'f' is a non-static member function. Diagnose this in the general case. Some of the new diagnostics are probably worse than the old ones, but we now get this right much more universally, and there's certainly room for improvement in the diagnostics. llvm-svn: 130239
* Give invalid tag types 8-bit size and alignment, rather than 1-bitDouglas Gregor2011-04-201-2/+2
| | | | | | | | alignment, which causes traps further down the line. Fixes <rdar://problem/9109755>, which contains a test case far too large to commit :( llvm-svn: 129861
* Fix a bug in calculation of composite typeFariborz Jahanian2011-04-181-3/+3
| | | | | | | | of conditional expressions of objc pointer types where one type is the immediate base type of the other. // rdar://9296866 llvm-svn: 129718
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-151-5/+6
| | | | llvm-svn: 129567
* fix a bunch of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129559
OpenPOWER on IntegriCloud