summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Add support for C++0x's range-based for loops, as specified by the C++11 ↵Richard Smith2011-04-141-0/+16
| | | | | | draft standard (N3291). llvm-svn: 129541
* Fix a regression where the initializer implementsFariborz Jahanian2011-04-121-4/+4
| | | | | | | the initialized's protocol and yet clang warns. objective-c issue, // rdar://9267196 llvm-svn: 129363
* PR8369: make __attribute((regparm(0))) work correctly. Original patch byEli Friedman2011-04-091-0/+3
| | | | | | pageexec@freemail.hu, tweaks by me. llvm-svn: 129206
* Warn for any kind of initialization if initializer does notFariborz Jahanian2011-04-081-4/+41
| | | | | | | implement lhs's protocols. // rdar://9091389. llvm-svn: 129142
* Basic, untested implementation for an "unknown any" type requested by LLDB.John McCall2011-04-071-0/+3
| | | | | | | | | | | | The idea is that you can create a VarDecl with an unknown type, or a FunctionDecl with an unknown return type, and it will still be valid to access that object as long as you explicitly cast it at every use. I'm still going back and forth about how I want to test this effectively, but I wanted to go ahead and provide a skeletal implementation for the LLDB folks' benefit and because it also improves some diagnostic goodness for placeholder expressions. llvm-svn: 129065
* Implement a new 'availability' attribute, that allows one to specifyDouglas Gregor2011-03-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which versions of an OS provide a certain facility. For example, void foo() __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6))); says that the function "foo" was introduced in 10.2, deprecated in 10.4, and completely obsoleted in 10.6. This attribute ties in with the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that we want to deploy back to Mac OS X 10.1). There are several concrete behaviors that this attribute enables, as illustrated with the function foo() above: - If we choose a deployment target >= Mac OS X 10.4, uses of "foo" will result in a deprecation warning, as if we had placed attribute((deprecated)) on it (but with a better diagnostic) - If we choose a deployment target >= Mac OS X 10.6, uses of "foo" will result in an "unavailable" warning (in C)/error (in C++), as if we had placed attribute((unavailable)) on it - If we choose a deployment target prior to 10.2, foo() is weak-imported (if it is a kind of entity that can be weak imported), as if we had placed the weak_import attribute on it. Naturally, there can be multiple availability attributes on a declaration, for different platforms; only the current platform matters when checking availability attributes. The only platforms this attribute currently works for are "ios" and "macosx", since we already have -mxxxx-version-min flags for them and we have experience there with macro tricks translating down to the deprecated/unavailable/weak_import attributes. The end goal is to open this up to other platforms, and even extension to other "platforms" that are really libraries (say, through a #pragma clang define_system), but that hasn't yet been designed and we may want to shake out more issues with this narrower problem first. Addresses <rdar://problem/6690412>. As a drive-by bug-fix, if an entity is both deprecated and unavailable, we only emit the "unavailable" diagnostic. llvm-svn: 128127
* Add support for language-specific address spaces. On top of that,Peter Collingbourne2011-03-181-5/+24
| | | | | | | | | add support for the OpenCL __private, __local, __constant and __global address spaces, as well as the __read_only, _read_write and __write_only image access specifiers. Patch originally by ARM; language-specific address space support by myself. llvm-svn: 127915
* Block return type of the initialized must beFariborz Jahanian2011-03-141-6/+8
| | | | | | | | be more speciaclized than that of the initializer, when matching protocol qualifier list. // rdar:// 9118343. llvm-svn: 127585
* Instead of storing an ASTContext* in FunctionProtoTypes with computed ↵Sebastian Redl2011-03-131-4/+4
| | | | | | noexcept specifiers, unique FunctionProtoTypes with a ContextualFoldingSet, as suggested by John McCall. llvm-svn: 127568
* Propagate the new exception information to FunctionProtoType.Sebastian Redl2011-03-121-5/+11
| | | | | | | | Change the interface to expose the new information and deal with the enormous fallout. Introduce the new ExceptionSpecificationType value EST_DynamicNone to more easily deal with empty throw specifications. Update the tests for noexcept and fix the various bugs uncovered, such as lack of tentative parsing support. llvm-svn: 127537
* Fixed InnerLocStart.Abramo Bagnara2011-03-091-12/+12
| | | | llvm-svn: 127330
* Fixed source range for all DeclaratorDecl's.Abramo Bagnara2011-03-081-6/+10
| | | | llvm-svn: 127225
* Fixed TypedefDecl and TemplateTypeParameter source range.Abramo Bagnara2011-03-061-1/+3
| | | | llvm-svn: 127119
* Reinstate r127112, "Propagate new-style exception spec information to ↵Sebastian Redl2011-03-061-6/+3
| | | | | | ExtProtoInfo.", this time with the missing header. llvm-svn: 127118
* Revert r127112, "Propagate new-style exception spec information to ↵NAKAMURA Takumi2011-03-061-3/+6
| | | | | | | | ExtProtoInfo." It seems missing "clang/Basic/ExceptionSpecificationType.h". llvm-svn: 127115
* Propagate new-style exception spec information to ExtProtoInfo.Sebastian Redl2011-03-051-6/+3
| | | | llvm-svn: 127112
* Eliminate redundant nested-name-specifiers onDouglas Gregor2011-03-031-0/+8
| | | | | | TemplateSpecializationTypes, which also fixes PR9388. llvm-svn: 126946
* Implement -mrtd which sets the StdCall calling convention to be the defaultRoman Divacky2011-03-011-4/+11
| | | | | | one. llvm-svn: 126756
* Push nested-name-specifier source location information intoDouglas Gregor2011-02-281-0/+11
| | | | | | | | CXXDependentScopeMemberExpr, and clean up instantiation of nested-name-specifiers with dependent template specialization types in the process. llvm-svn: 126663
* From Vassil Vassilev:Axel Naumann2011-02-281-4/+0
| | | | | | | | * Add default implementations (no-op) for ExternalASTSource's pure virtual functions. There are valid use cases that can live with these defaults. * Move ExternalASTSource's out of line implementations into separate source file. * Whitespace, forward decl, #include cleanup. llvm-svn: 126648
* When we encounter a dependent template name within aDouglas Gregor2011-02-281-5/+7
| | | | | | | | | | | | nested-name-specifier, e.g., T::template apply<U>:: represent the dependent template name specialization as a DependentTemplateSpecializationType, rather than a TemplateSpecializationType with a dependent TemplateName. llvm-svn: 126593
* Teach NestedNameSpecifier to keep track of namespace aliases the sameDouglas Gregor2011-02-241-1/+9
| | | | | | | | way it keeps track of namespaces. Previously, we would map from the namespace alias to its underlying namespace when building a nested-name-specifier, losing source information in the process. llvm-svn: 126358
* Emit the structure layout of the block literal parameter to a blockJohn McCall2011-02-221-73/+1
| | | | | | | | | | invocation function into the debug info. Rather than faking up a class, which is tricky because of the custom layout we do, we just emit a struct directly from the layout information we've already got. Also, don't emit an unnecessarily parameter alloca for this "variable". llvm-svn: 126255
* Use an unused-except-in-Debug variable.Matt Beaumont-Gay2011-02-221-1/+1
| | | | llvm-svn: 126240
* Tweaks to C++0x deduced auto type support:Richard Smith2011-02-211-5/+15
| | | | | | | | * Flag indicating 'we're parsing this auto typed variable's initializer' moved from VarDecl to Sema * Temporary template parameter list for auto deduction is now allocated on the stack. * Deduced 'auto' types are now uniqued. llvm-svn: 126139
* Implement the C++0x deduced 'auto' feature.Richard Smith2011-02-201-4/+15
| | | | | | This fixes PR 8738, 9060 and 9132. llvm-svn: 126069
* Add const qualifier to getTypeInfoInChars().Ken Dyck2011-02-201-2/+2
| | | | llvm-svn: 126064
* Fix PR9253, allowing attribute(aligned) to reduce the alignment ofChris Lattner2011-02-191-1/+7
| | | | | | a typedef. llvm-svn: 126059
* Convert RecordLayout::Alignment to CharUnits from bit units. No change inKen Dyck2011-02-151-3/+3
| | | | | | functionality intended. llvm-svn: 125549
* Fix a block sema bug where result type of initializerFariborz Jahanian2011-02-111-3/+8
| | | | | | | | | is unqualified but its initialized is qualified. This is for c only and fixes the imm. problem. c++ is more involved and is wip. // rdar://8979379 llvm-svn: 125386
* Add a helper function, ASTContext::toBits(), that converts sizes inKen Dyck2011-02-111-2/+7
| | | | | | | CharUnits to sizes in bits, and use it to tidy up the places where the conversion was done explicitly. llvm-svn: 125332
* Move the check that gives functions with unique-external types unique-externalJohn McCall2011-02-101-4/+0
| | | | | | | linkage into Decl.cpp. Disable this logic for extern "C" functions, because the operative rule there is weaker. Fixes rdar://problem/8898466 llvm-svn: 125268
* AST, Sema, Serialization: keep track of cudaConfigureCallPeter Collingbourne2011-02-091-0/+1
| | | | llvm-svn: 125216
* Convert RecordLayout::Size to CharUnits from bits. No changes toKen Dyck2011-02-091-2/+2
| | | | | | functionality intended. llvm-svn: 125156
* A few more tweaks to the blocks AST representation: John McCall2011-02-071-3/+6
| | | | | | | | | | | | | | | | | - BlockDeclRefExprs always store VarDecls - BDREs no longer store copy expressions - BlockDecls now store a list of captured variables, information about how they're captured, and a copy expression if necessary With that in hand, change IR generation to use the captures data in blocks instead of walking the block independently. Additionally, optimize block layout by emitting fields in descending alignment order, with a heuristic for filling in words when alignment of the end of the block header is insufficient for the most aligned field. llvm-svn: 125005
* Fixed parameter names.Abramo Bagnara2011-01-271-7/+7
| | | | llvm-svn: 124408
* Teach TemplateSpecializationTypeLoc::initializeArgLocs() to actuallyDouglas Gregor2011-01-251-1/+1
| | | | | | | | | generate meaningful [*] template argument location information. [*] Well, as meaningful as possible, given that this entire code path is a hack for when we've lost type-source information. llvm-svn: 124211
* Fix the computation of alignment for fields of packed+aligned structs.John McCall2011-01-201-6/+28
| | | | | | Part of the fix for PR8413. llvm-svn: 123904
* Implement support for non-type template parameter packs whose type isDouglas Gregor2011-01-191-10/+42
| | | | | | | | | | | | | | | | | | | | | a pack expansion, e.g., the parameter pack Values in: template<typename ...Types> struct Outer { template<Types ...Values> struct Inner; }; This new implementation approach introduces the notion of an "expanded" non-type template parameter pack, for which we have already expanded the types of the parameter pack (to, say, "int*, float*", for Outer<int*, float*>) but have not yet expanded the values. Aside from creating these expanded non-type template parameter packs, this patch updates template argument checking and non-type template parameter pack instantiation to make use of the appropriate types in the parameter pack. llvm-svn: 123845
* Change the canonical representation of array types to store qualifiers on theJohn McCall2011-01-191-191/+157
| | | | | | | | | | | | outermost array types and not on the element type. Move the CanonicalType member from Type to ExtQualsTypeCommonBase; the canonical type on an ExtQuals node includes the qualifiers on the ExtQuals. Assorted optimizations enabled by this change. getQualifiers(), hasQualifiers(), etc. should all now implicitly look through array types. llvm-svn: 123817
* Change QualType::getTypePtr() to return a const pointer, then change aJohn McCall2011-01-191-27/+32
| | | | | | thousand other things which were (generally inadvertantly) relying on that. llvm-svn: 123814
* Fix some unnecessarily complicated code for canonicalizing variably-modifiedJohn McCall2011-01-181-43/+119
| | | | | | parameter types. llvm-svn: 123753
* Generalize some operations on qualifiers. QualType::getQualifiers() andJohn McCall2011-01-181-13/+33
| | | | | | | ::getCVRQualifiers() now look through array types, like all the other standard queries. Also, make a 'split' variant of getUnqualifiedType(). llvm-svn: 123751
* Add toCharUnitsInBits() to simplify the many calls to ↵Ken Dyck2011-01-151-7/+12
| | | | | | CharUnits::fromQuantity() of the form CharUnits::fromQuantity(bitSize, Context.getCharWidth()). llvm-svn: 123542
* Introduce a new kind of TemplateName that captures a substitutedDouglas Gregor2011-01-151-0/+30
| | | | | | | | | | | | | | | template template parameter pack that cannot be fully expanded because its enclosing pack expansion could not be expanded. This form of TemplateName plays the same role as SubstTemplateTypeParmPackType and SubstNonTypeTemplateParmPackExpr do for template type parameter packs and non-type template parameter packs, respectively. We should now handle these multi-level pack expansion substitutions anywhere. The largest remaining gap in our variadic-templates support is that we cannot cope with non-type template parameter packs whose type is a pack expansion. llvm-svn: 123521
* Teach template template argument pack expansions to keep track of theDouglas Gregor2011-01-141-1/+1
| | | | | | | number of expansions, when we know it, and propagate that information through Sema. llvm-svn: 123493
OpenPOWER on IntegriCloud