summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/TreeTransform.h
Commit message (Collapse)AuthorAgeFilesLines
* Refactor the tree transform's many loops over sets of expressionsDouglas Gregor2011-01-031-122/+98
| | | | | | | | | | | (transforming each in turn) into calls into one central routine (TransformExprs) that transforms a list of expressions. This refactoring is preparatory work for pack expansions whose in an expression-list. No functionality change. llvm-svn: 122761
* Implement support for pack expansions whose pattern is a non-typeDouglas Gregor2011-01-031-0/+7
| | | | | | | | | | | | | | | | | template argument (described by an expression, of course). For example: template<int...> struct int_tuple { }; template<int ...Values> struct square { typedef int_tuple<(Values*Values)...> type; }; It also lays the foundation for pack expansions in an initializer-list. llvm-svn: 122751
* Add some const qualifiersDouglas Gregor2010-12-211-2/+2
| | | | llvm-svn: 122365
* Implement instantiation of pack expansions whose pattern is a type-idDouglas Gregor2010-12-211-3/+2
| | | | | | in an exception specification. llvm-svn: 122297
* Further refactoring of the tree transformation for template argumentDouglas Gregor2010-12-201-42/+164
| | | | | | | | | | | | | lists, so that all such transformations go through a single, iterator-based transformation function. This is the only place where we need to implement the logic for transforming pack expansions whose pattern is a template argument. Unfortunately, the new cases this refactoring brings into the fold can't be meaningfully tested yet. We need template argument deduction to work well enough for variadic function templates first. llvm-svn: 122289
* Implement basic support for template instantiation of pack expansionsDouglas Gregor2010-12-201-12/+161
| | | | | | | | | | | | | | | | | whose patterns are template arguments. We can now instantiate, e.g., typedef tuple<pair<OuterTypes, InnerTypes>...> type; where OuterTypes and InnerTypes are template type parameter packs. There is a horrible inefficiency in TemplateArgumentLoc::getPackExpansionPattern(), where we need to create copies of TypeLoc data because our interfaces traffic in TypeSourceInfo pointers where they should traffic in TypeLocs instead. I've isolated in efficiency in this one routine; once we refactor our interfaces to traffic in TypeLocs, we can eliminate it. llvm-svn: 122278
* Remove unused variableMatt Beaumont-Gay2010-12-201-2/+0
| | | | llvm-svn: 122257
* Finish refactoring the transformation of template argument lists,Douglas Gregor2010-12-201-15/+40
| | | | | | centralizing the transformation into two routines. No functionality change. llvm-svn: 122253
* Refactor the transformation of template argument lists to centralizeDouglas Gregor2010-12-201-37/+58
| | | | | | the list traversal. Part 1, no functionality change. llvm-svn: 122252
* Introduce a new type, PackExpansionType, to capture types that areDouglas Gregor2010-12-201-0/+9
| | | | | | | | | | | | | | | | | | | | pack expansions, e.g. given template<typename... Types> struct tuple; template<typename... Types> struct tuple_of_refs { typedef tuple<Types&...> types; }; the type of the "types" typedef is a PackExpansionType whose pattern is Types&. This commit introduces support for creating pack expansions for template type arguments, as above, but not for any other kind of pack expansion, nor for any form of instantiation. llvm-svn: 122223
* Keep the source location of the selector in ObjCMessageExpr.Argyrios Kyrtzidis2010-12-101-4/+8
| | | | llvm-svn: 121516
* Added ParenType type node.Abramo Bagnara2010-12-101-0/+30
| | | | llvm-svn: 121488
* Remove the TypesCompatibleExprClass AST node. Merge its functionality into ↵Francois Pichet2010-12-081-37/+0
| | | | | | BinaryTypeTraitExpr. llvm-svn: 121298
* Type traits intrinsic implementation: __is_base_of(T, U)Francois Pichet2010-12-071-0/+33
| | | | | | New AST node introduced: BinaryTypeTraitExpr; to be reused for more intrinsics. llvm-svn: 121074
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-061-5/+4
| | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
* Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall2010-12-021-74/+25
| | | | | | | | ObjCPropertyRefExpr into the latter. llvm-svn: 120643
* Make TypeLocBuilder an implementation detail of Sema. Nobody else should be ↵Douglas Gregor2010-12-021-1/+1
| | | | | | using it llvm-svn: 120628
* Revert r119838 "Don't warn for empty 'if' body if there is a macro that ↵Argyrios Kyrtzidis2010-11-201-5/+3
| | | | | | | | | | expands to nothing" and use a better and more general approach, where NullStmt has a flag to indicate whether it was preceded by an empty macro. Thanks to Abramo Bagnara for the hint! llvm-svn: 119887
* Don't warn for empty 'if' body if there is a macro that expands to nothing, e.g:Argyrios Kyrtzidis2010-11-191-3/+5
| | | | | | | | | if (condition) CALL(0); // empty macro but don't warn for empty body. Fixes rdar://8436021. llvm-svn: 119838
* Calculate the value kind of an expression when it's created andJohn McCall2010-11-181-22/+32
| | | | | | | | | | | | | store it on the expression node. Also store an "object kind", which distinguishes ordinary "addressed" l-values (like variable references and pointer dereferences) and bitfield, @property, and vector-component l-values. Currently we're not using these for much, but I aim to switch pretty much everything calculating l-valueness over to them. For now they shouldn't necessarily be trusted. llvm-svn: 119685
* Add a new expression kind, OpaqueValueExpr, which is useful forJohn McCall2010-11-151-0/+8
| | | | | | | certain internal type-checking procedures as well as for representing certain implicitly-generated operations. Uses to follow. llvm-svn: 119289
* Replace one hack with a different hack: strip out the ObjectTypeJohn McCall2010-11-121-200/+238
| | | | | | | | | parameters to the Transform*Type functions and instead call out the specific cases where an object type and the unqualified lookup results are important. Fixes an assert and failed compile on a testcase from PR7248. llvm-svn: 118887
* Add a variant of GCC-style vector types for ARM NEON.Bob Wilson2010-11-101-5/+5
| | | | | | | | | NEON vector types need to be mangled in a special way to comply with ARM's ABI, similar to some of the AltiVec-specific vector types. This patch is mostly just renaming a bunch of "AltiVecSpecific" things, since they will no longer be specific to AltiVec. Besides that, it just adds the new "NeonVector" enum. llvm-svn: 118724
* Remove broken support for variadic templates, along with the variousDouglas Gregor2010-11-071-4/+8
| | | | | | | | | | | | | abstractions (e.g., TemplateArgumentListBuilder) that were designed to support variadic templates. Only a few remnants of variadic templates remain, in the parser (parsing template type parameter packs), AST (template type parameter pack bits and TemplateArgument::Pack), and Sema; these are expected to be used in a future implementation of variadic templates. But don't get too excited about that happening now. llvm-svn: 118385
* Use the real keyword location when rebuilding an elaborated type instead ofJohn McCall2010-11-041-2/+4
| | | | | | making something up. Fixes PR8129. llvm-svn: 118258
* No really, we don't have a retain/release system for statements/expressionsJohn McCall2010-10-261-89/+89
| | | | | | anymore. llvm-svn: 117357
* Improve the tracking of source locations for parentheses in constructor calls.Chandler Carruth2010-10-251-3/+6
| | | | | | | | | | | | This adds them where missing, and traces them through PCH. We fix at least one bug in the extents found by the Index library, and make a lot of refactoring tools which care about the exact formulation of a constructor call easier to write. Also some minor cleanups to more consistently follow the friend pattern instead of the setter pattern when rebuilding a serialized AST. Patch originally by Samuel Benzaquen. llvm-svn: 117254
* Eliminate usage of ObjCSuperExpr used forFariborz Jahanian2010-10-141-14/+32
| | | | | | | 'super' as receiver of property or a setter/getter methods. //rdar: //8525788 llvm-svn: 116483
* Add some infrastructure for dealing with expressions of 'placeholder' type,John McCall2010-10-121-8/+10
| | | | | | | i.e. expressions with an internally-convenient type which should not be appearing in generally valid, complete ASTs. llvm-svn: 116281
* When instantiating a new-expression, force a rebuild if there were defaultJohn McCall2010-10-051-1/+8
| | | | | | | | arguments in either the placement or constructor arguments. This is important if the default arguments refer to a declaration or create a temporary. llvm-svn: 115700
* Implement the C++0x "trailing return type" feature, e.g.,Douglas Gregor2010-10-011-10/+25
| | | | | | | | | | auto f(int) -> int from Daniel Wallin! (With a few minor bug fixes from me). llvm-svn: 115322
* Don't warn for an unused label if it has 'unused' attribute. Fixes ↵Argyrios Kyrtzidis2010-09-281-3/+4
| | | | | | rdar://8483139. llvm-svn: 114954
* When marking the declarations in a default argument expression asDouglas Gregor2010-09-141-0/+11
| | | | | | | | | "used", at the time that the default argument itself is used, also mark destructors that will be called by this expression. This fixes a regression that I introduced in r113700, which broke WebKit, and fixes <rdar://problem/8427926>. llvm-svn: 113883
* Define and implement CXXNoexceptExpr. Create it in Sema.Sebastian Redl2010-09-101-0/+21
| | | | llvm-svn: 113623
* Simplify template instantiation for C++ exception declarations,Douglas Gregor2010-09-091-16/+8
| | | | | | eliminating an unnecessary use of TemporaryBase in the process. llvm-svn: 113500
* Eliminate some unnecessary uses of TreeTransform::TemporaryBase. ThereDouglas Gregor2010-09-091-53/+23
| | | | | | | are still a few (legitimate, unfortunate) uses of this hack around, but at least now there are fewer. llvm-svn: 113498
* Eliminate the comma locations from all of the Sema routines that dealDouglas Gregor2010-09-091-15/+1
| | | | | | | | with comma-separated lists. We never actually used the comma locations, nor did we store them in the AST, but we did manage to waste time during template instantiation to produce fake locations. llvm-svn: 113495
* Add proper type-source information to UnaryTypeTraitExpr, includingDouglas Gregor2010-09-091-16/+7
| | | | | | libclang visitation. llvm-svn: 113492
* Push the range associated with a nested-name-specifier further throughDouglas Gregor2010-09-081-12/+21
| | | | | | | | TreeTransform, since we were getting an empty source range where we shouldn't. Sadly, the test case is Boost.Proto, and isn't worth reducing. llvm-svn: 113446
* Microsoft's __uuidof operator implementation part 1.Francois Pichet2010-09-081-0/+63
| | | | llvm-svn: 113356
* Provide proper type-source location information forDouglas Gregor2010-09-081-77/+41
| | | | | | | | CXXTemporaryObjectExpr, CXXScalarValueInitExpr, and CXXUnresolvedConstructExpr, getting rid of a bunch of FIXMEs in the process. llvm-svn: 113319
* Improve source-location information for CXXNewExpr, by hanging on toDouglas Gregor2010-09-071-21/+20
| | | | | | the TypeSourceInfo for the allocated type. Fixes PR7501. llvm-svn: 113291
* Eliminate CXXBindReferenceExpr, which was used in a ton ofDouglas Gregor2010-09-021-10/+0
| | | | | | well-intentioned but completely unused code. llvm-svn: 112868
* When instantiating a function type, instantiate the return type beforeDouglas Gregor2010-08-311-6/+13
| | | | | | | | | | | | | | | | | | | instantiating the parameters. In a perfect world, this wouldn't matter, and compilers are free to instantiate in any order they want. However, every other compiler seems to instantiate the return type first, and some code (in this case, Boost.Polygon) depends on this and SFINAE to avoid instantiating something that shouldn't be instantiated. We could fight this battle, and insist that Clang is allowed to do what it does, but it's not beneficial: it's more predictable to instantiate this way, in source order. When we implement late-specified return types, we'll need to instantiate the return type last when it was late-specified, hence the FIXME. We now compile Boost.Polygon properly. llvm-svn: 112561
* Revert my user-defined literal commits - r1124{58,60,67} pendingAlexis Hunt2010-08-301-6/+0
| | | | | | some issues being sorted out. llvm-svn: 112493
* Implement C++0x user-defined string literals.Alexis Hunt2010-08-291-0/+6
| | | | | | | | | | The extra data stored on user-defined literal Tokens is stored in extra allocated memory, which is managed by the PreprocessorLexer because there isn't a better place to put it that makes sure it gets deallocated, but only after it's used up. My testing has shown no significant slowdown as a result, but independent testing would be appreciated. llvm-svn: 112458
* Fix the memory leak of FloatingLiteral/IntegerLiteral.Argyrios Kyrtzidis2010-08-281-7/+8
| | | | | | | | | | | For large floats/integers, APFloat/APInt will allocate memory from the heap to represent these numbers. Unfortunately, when we use a BumpPtrAllocator to allocate IntegerLiteral/FloatingLiteral nodes the memory associated with the APFloat/APInt values will never get freed. I introduce the class 'APNumericStorage' which uses ASTContext's allocator for memory allocation and is used internally by FloatingLiteral/IntegerLiteral. Fixes rdar://7637185 llvm-svn: 112361
* Continue to instantiate sub-statements in a CompoundStmt as long asJohn McCall2010-08-271-2/+14
| | | | | | | we don't see a DeclStmt (failure to instantiate which generally causes panic). llvm-svn: 112282
* One who seeks knowledge learns something new every day.John McCall2010-08-261-214/+211
| | | | | | | | | One who seeks the Tao unlearns something new every day. Less and less remains until you arrive at non-action. When you arrive at non-action, nothing will be left undone. llvm-svn: 112244
* Split out a header to hold APIs meant for the Sema implementation from Sema.h.John McCall2010-08-251-1/+1
| | | | | | | Clients of Sema don't need to know (for example) the list of diagnostics we support. llvm-svn: 112093
OpenPOWER on IntegriCloud