clang API Documentation

Classes | Public Member Functions | Static Public Member Functions | Protected Attributes
clang::TreeTransform< Derived > Class Template Reference

A semantic tree transformation that allows one to transform one abstract syntax tree into another. More...

#include <TreeTransform.h>

Collaboration diagram for clang::TreeTransform< Derived >:
Collaboration graph
[legend]

List of all members.

Classes

class  ForgetPartiallySubstitutedPackRAII
 Private RAII object that helps us forget and then re-remember the template argument corresponding to a partially-substituted parameter pack.
class  TemporaryBase
 RAII object that temporarily sets the base location and entity used for reporting diagnostics in types. More...

Public Member Functions

 TreeTransform (Sema &SemaRef)
 Initializes a new tree transformer.
Derived & getDerived ()
 Retrieves a reference to the derived class.
const Derived & getDerived () const
 Retrieves a reference to the derived class.
SemagetSema () const
 Retrieves a reference to the semantic analysis object used for this tree transform.
bool AlwaysRebuild ()
 Whether the transformation should always rebuild AST nodes, even if none of the children have changed.
SourceLocation getBaseLocation ()
 Returns the location of the entity being transformed, if that information was not available elsewhere in the AST.
DeclarationName getBaseEntity ()
 Returns the name of the entity being transformed, if that information was not available elsewhere in the AST.
void setBase (SourceLocation Loc, DeclarationName Entity)
 Sets the "base" location and entity when that information is known based on another transformation.
bool AlreadyTransformed (QualType T)
 Determine whether the given type T has already been transformed.
bool DropCallArgument (Expr *E)
 Determine whether the given call argument should be dropped, e.g., because it is a default argument.
bool TryExpandParameterPacks (SourceLocation EllipsisLoc, SourceRange PatternRange, llvm::ArrayRef< UnexpandedParameterPack > Unexpanded, bool &ShouldExpand, bool &RetainExpansion, llvm::Optional< unsigned > &NumExpansions)
 Determine whether we should expand a pack expansion with the given set of parameter packs into separate arguments by repeatedly transforming the pattern.
TemplateArgument ForgetPartiallySubstitutedPack ()
 "Forget" about the partially-substituted pack template argument, when performing an instantiation that must preserve the parameter pack use.
void RememberPartiallySubstitutedPack (TemplateArgument Arg)
 "Remember" the partially-substituted pack template argument after performing an instantiation that must preserve the parameter pack use.
void ExpandingFunctionParameterPack (ParmVarDecl *Pack)
 Note to the derived class when a function parameter pack is being expanded.
QualType TransformType (QualType T)
 Transforms the given type into another type.
TypeSourceInfoTransformType (TypeSourceInfo *DI)
 Transforms the given type-with-location into a new type-with-location.
QualType TransformType (TypeLocBuilder &TLB, TypeLoc TL)
 Transform the given type-with-location into a new type, collecting location information in the given builder as necessary.
StmtResult TransformStmt (Stmt *S)
 Transform the given statement.
ExprResult TransformExpr (Expr *E)
 Transform the given expression.
bool TransformExprs (Expr **Inputs, unsigned NumInputs, bool IsCall, SmallVectorImpl< Expr * > &Outputs, bool *ArgChanged=0)
 Transform the given list of expressions.
DeclTransformDecl (SourceLocation Loc, Decl *D)
 Transform the given declaration, which is referenced from a type or expression.
void transformAttrs (Decl *Old, Decl *New)
 Transform the attributes associated with the given declaration and place them on the new declaration.
void transformedLocalDecl (Decl *Old, Decl *New)
 Note that a local declaration has been transformed by this transformer.
DeclTransformDefinition (SourceLocation Loc, Decl *D)
 Transform the definition of the given declaration.
NamedDeclTransformFirstQualifierInScope (NamedDecl *D, SourceLocation Loc)
 Transform the given declaration, which was the first part of a nested-name-specifier in a member access expression.
NestedNameSpecifierLoc TransformNestedNameSpecifierLoc (NestedNameSpecifierLoc NNS, QualType ObjectType=QualType(), NamedDecl *FirstQualifierInScope=0)
 Transform the given nested-name-specifier with source-location information.
DeclarationNameInfo TransformDeclarationNameInfo (const DeclarationNameInfo &NameInfo)
 Transform the given declaration name.
TemplateName TransformTemplateName (CXXScopeSpec &SS, TemplateName Name, SourceLocation NameLoc, QualType ObjectType=QualType(), NamedDecl *FirstQualifierInScope=0)
 Transform the given template name.
bool TransformTemplateArgument (const TemplateArgumentLoc &Input, TemplateArgumentLoc &Output)
 Transform the given template argument.
bool TransformTemplateArguments (const TemplateArgumentLoc *Inputs, unsigned NumInputs, TemplateArgumentListInfo &Outputs)
 Transform the given set of template arguments.
template<typename InputIterator >
bool TransformTemplateArguments (InputIterator First, InputIterator Last, TemplateArgumentListInfo &Outputs)
 Transform the given set of template arguments.
void InventTemplateArgumentLoc (const TemplateArgument &Arg, TemplateArgumentLoc &ArgLoc)
 Fakes up a TemplateArgumentLoc for a given TemplateArgument.
TypeSourceInfoInventTypeSourceInfo (QualType T)
 Fakes up a TypeSourceInfo for a type.
QualType TransformFunctionProtoType (TypeLocBuilder &TLB, FunctionProtoTypeLoc TL, CXXRecordDecl *ThisContext, unsigned ThisTypeQuals)
StmtResult TransformSEHHandler (Stmt *Handler)
QualType TransformTemplateSpecializationType (TypeLocBuilder &TLB, TemplateSpecializationTypeLoc TL, TemplateName Template)
QualType TransformDependentTemplateSpecializationType (TypeLocBuilder &TLB, DependentTemplateSpecializationTypeLoc TL, TemplateName Template, CXXScopeSpec &SS)
QualType TransformDependentTemplateSpecializationType (TypeLocBuilder &TLB, DependentTemplateSpecializationTypeLoc TL, NestedNameSpecifierLoc QualifierLoc)
bool TransformFunctionTypeParams (SourceLocation Loc, ParmVarDecl **Params, unsigned NumParams, const QualType *ParamTypes, SmallVectorImpl< QualType > &PTypes, SmallVectorImpl< ParmVarDecl * > *PVars)
 Transforms the parameters of a function type into the given vectors.
ParmVarDeclTransformFunctionTypeParam (ParmVarDecl *OldParm, int indexAdjustment, llvm::Optional< unsigned > NumExpansions, bool ExpectParameterPack)
 Transforms a single function-type parameter. Return null on error.
QualType TransformReferenceType (TypeLocBuilder &TLB, ReferenceTypeLoc TL)
StmtResult TransformCompoundStmt (CompoundStmt *S, bool IsStmtExpr)
ExprResult TransformCXXNamedCastExpr (CXXNamedCastExpr *E)
QualType RebuildPointerType (QualType PointeeType, SourceLocation Sigil)
 Build a new pointer type given its pointee type.
QualType RebuildBlockPointerType (QualType PointeeType, SourceLocation Sigil)
 Build a new block pointer type given its pointee type.
QualType RebuildReferenceType (QualType ReferentType, bool LValue, SourceLocation Sigil)
 Build a new reference type given the type it references.
QualType RebuildMemberPointerType (QualType PointeeType, QualType ClassType, SourceLocation Sigil)
 Build a new member pointer type given the pointee type and the class type it refers into.
QualType RebuildArrayType (QualType ElementType, ArrayType::ArraySizeModifier SizeMod, const llvm::APInt *Size, Expr *SizeExpr, unsigned IndexTypeQuals, SourceRange BracketsRange)
 Build a new array type given the element type, size modifier, size of the array (if known), size expression, and index type qualifiers.
QualType RebuildConstantArrayType (QualType ElementType, ArrayType::ArraySizeModifier SizeMod, const llvm::APInt &Size, unsigned IndexTypeQuals, SourceRange BracketsRange)
 Build a new constant array type given the element type, size modifier, (known) size of the array, and index type qualifiers.
QualType RebuildIncompleteArrayType (QualType ElementType, ArrayType::ArraySizeModifier SizeMod, unsigned IndexTypeQuals, SourceRange BracketsRange)
 Build a new incomplete array type given the element type, size modifier, and index type qualifiers.
QualType RebuildVariableArrayType (QualType ElementType, ArrayType::ArraySizeModifier SizeMod, Expr *SizeExpr, unsigned IndexTypeQuals, SourceRange BracketsRange)
 Build a new variable-length array type given the element type, size modifier, size expression, and index type qualifiers.
QualType RebuildDependentSizedArrayType (QualType ElementType, ArrayType::ArraySizeModifier SizeMod, Expr *SizeExpr, unsigned IndexTypeQuals, SourceRange BracketsRange)
 Build a new dependent-sized array type given the element type, size modifier, size expression, and index type qualifiers.
QualType RebuildVectorType (QualType ElementType, unsigned NumElements, VectorType::VectorKind VecKind)
 Build a new vector type given the element type and number of elements.
QualType RebuildExtVectorType (QualType ElementType, unsigned NumElements, SourceLocation AttributeLoc)
 Build a new extended vector type given the element type and number of elements.
QualType RebuildDependentSizedExtVectorType (QualType ElementType, Expr *SizeExpr, SourceLocation AttributeLoc)
 Build a new potentially dependently-sized extended vector type given the element type and number of elements.
QualType RebuildFunctionProtoType (QualType T, QualType *ParamTypes, unsigned NumParamTypes, bool Variadic, bool HasTrailingReturn, unsigned Quals, RefQualifierKind RefQualifier, const FunctionType::ExtInfo &Info)
 Build a new function type.
QualType RebuildFunctionNoProtoType (QualType ResultType)
 Build a new unprototyped function type.
QualType RebuildUnresolvedUsingType (Decl *D)
 Rebuild an unresolved typename type, given the decl that the UnresolvedUsingTypenameDecl was transformed to.
QualType RebuildTypedefType (TypedefNameDecl *Typedef)
 Build a new typedef type.
QualType RebuildRecordType (RecordDecl *Record)
 Build a new class/struct/union type.
QualType RebuildEnumType (EnumDecl *Enum)
 Build a new Enum type.
QualType RebuildTypeOfExprType (Expr *Underlying, SourceLocation Loc)
 Build a new typeof(expr) type.
QualType RebuildTypeOfType (QualType Underlying)
 Build a new typeof(type) type.
QualType RebuildUnaryTransformType (QualType BaseType, UnaryTransformType::UTTKind UKind, SourceLocation Loc)
 Build a new unary transform type.
QualType RebuildDecltypeType (Expr *Underlying, SourceLocation Loc)
 Build a new C++0x decltype type.
QualType RebuildAutoType (QualType Deduced)
 Build a new C++0x auto type.
QualType RebuildTemplateSpecializationType (TemplateName Template, SourceLocation TemplateLoc, TemplateArgumentListInfo &Args)
 Build a new template specialization type.
QualType RebuildParenType (QualType InnerType)
 Build a new parenthesized type.
QualType RebuildElaboratedType (SourceLocation KeywordLoc, ElaboratedTypeKeyword Keyword, NestedNameSpecifierLoc QualifierLoc, QualType Named)
 Build a new qualified name type.
QualType RebuildDependentTemplateSpecializationType (ElaboratedTypeKeyword Keyword, NestedNameSpecifierLoc QualifierLoc, const IdentifierInfo *Name, SourceLocation NameLoc, TemplateArgumentListInfo &Args)
 Build a new typename type that refers to a template-id.
QualType RebuildDependentNameType (ElaboratedTypeKeyword Keyword, SourceLocation KeywordLoc, NestedNameSpecifierLoc QualifierLoc, const IdentifierInfo *Id, SourceLocation IdLoc)
 Build a new typename type that refers to an identifier.
QualType RebuildPackExpansionType (QualType Pattern, SourceRange PatternRange, SourceLocation EllipsisLoc, llvm::Optional< unsigned > NumExpansions)
 Build a new pack expansion type.
QualType RebuildAtomicType (QualType ValueType, SourceLocation KWLoc)
 Build a new atomic type given its value type.
TemplateName RebuildTemplateName (CXXScopeSpec &SS, bool TemplateKW, TemplateDecl *Template)
 Build a new template name given a nested name specifier, a flag indicating whether the "template" keyword was provided, and the template that the template name refers to.
TemplateName RebuildTemplateName (CXXScopeSpec &SS, const IdentifierInfo &Name, SourceLocation NameLoc, QualType ObjectType, NamedDecl *FirstQualifierInScope)
 Build a new template name given a nested name specifier and the name that is referred to as a template.
TemplateName RebuildTemplateName (CXXScopeSpec &SS, OverloadedOperatorKind Operator, SourceLocation NameLoc, QualType ObjectType)
 Build a new template name given a nested name specifier and the overloaded operator name that is referred to as a template.
TemplateName RebuildTemplateName (TemplateTemplateParmDecl *Param, const TemplateArgument &ArgPack)
 Build a new template name given a template template parameter pack and the.
StmtResult RebuildCompoundStmt (SourceLocation LBraceLoc, MultiStmtArg Statements, SourceLocation RBraceLoc, bool IsStmtExpr)
 Build a new compound statement.
StmtResult RebuildCaseStmt (SourceLocation CaseLoc, Expr *LHS, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation ColonLoc)
 Build a new case statement.
StmtResult RebuildCaseStmtBody (Stmt *S, Stmt *Body)
 Attach the body to a new case statement.
StmtResult RebuildDefaultStmt (SourceLocation DefaultLoc, SourceLocation ColonLoc, Stmt *SubStmt)
 Build a new default statement.
StmtResult RebuildLabelStmt (SourceLocation IdentLoc, LabelDecl *L, SourceLocation ColonLoc, Stmt *SubStmt)
 Build a new label statement.
StmtResult RebuildAttributedStmt (SourceLocation AttrLoc, const AttrVec &Attrs, Stmt *SubStmt)
 Build a new label statement.
StmtResult RebuildIfStmt (SourceLocation IfLoc, Sema::FullExprArg Cond, VarDecl *CondVar, Stmt *Then, SourceLocation ElseLoc, Stmt *Else)
 Build a new "if" statement.
StmtResult RebuildSwitchStmtStart (SourceLocation SwitchLoc, Expr *Cond, VarDecl *CondVar)
 Start building a new switch statement.
StmtResult RebuildSwitchStmtBody (SourceLocation SwitchLoc, Stmt *Switch, Stmt *Body)
 Attach the body to the switch statement.
StmtResult RebuildWhileStmt (SourceLocation WhileLoc, Sema::FullExprArg Cond, VarDecl *CondVar, Stmt *Body)
 Build a new while statement.
StmtResult RebuildDoStmt (SourceLocation DoLoc, Stmt *Body, SourceLocation WhileLoc, SourceLocation LParenLoc, Expr *Cond, SourceLocation RParenLoc)
 Build a new do-while statement.
StmtResult RebuildForStmt (SourceLocation ForLoc, SourceLocation LParenLoc, Stmt *Init, Sema::FullExprArg Cond, VarDecl *CondVar, Sema::FullExprArg Inc, SourceLocation RParenLoc, Stmt *Body)
 Build a new for statement.
StmtResult RebuildGotoStmt (SourceLocation GotoLoc, SourceLocation LabelLoc, LabelDecl *Label)
 Build a new goto statement.
StmtResult RebuildIndirectGotoStmt (SourceLocation GotoLoc, SourceLocation StarLoc, Expr *Target)
 Build a new indirect goto statement.
StmtResult RebuildReturnStmt (SourceLocation ReturnLoc, Expr *Result)
 Build a new return statement.
StmtResult RebuildDeclStmt (Decl **Decls, unsigned NumDecls, SourceLocation StartLoc, SourceLocation EndLoc)
 Build a new declaration statement.
StmtResult RebuildAsmStmt (SourceLocation AsmLoc, bool IsSimple, bool IsVolatile, unsigned NumOutputs, unsigned NumInputs, IdentifierInfo **Names, MultiExprArg Constraints, MultiExprArg Exprs, Expr *AsmString, MultiExprArg Clobbers, SourceLocation RParenLoc, bool MSAsm)
 Build a new inline asm statement.
StmtResult RebuildObjCAtTryStmt (SourceLocation AtLoc, Stmt *TryBody, MultiStmtArg CatchStmts, Stmt *Finally)
 Build a new Objective-C statement.
VarDeclRebuildObjCExceptionDecl (VarDecl *ExceptionDecl, TypeSourceInfo *TInfo, QualType T)
 Rebuild an Objective-C exception declaration.
StmtResult RebuildObjCAtCatchStmt (SourceLocation AtLoc, SourceLocation RParenLoc, VarDecl *Var, Stmt *Body)
 Build a new Objective-C statement.
StmtResult RebuildObjCAtFinallyStmt (SourceLocation AtLoc, Stmt *Body)
 Build a new Objective-C statement.
StmtResult RebuildObjCAtThrowStmt (SourceLocation AtLoc, Expr *Operand)
 Build a new Objective-C.
ExprResult RebuildObjCAtSynchronizedOperand (SourceLocation atLoc, Expr *object)
 Rebuild the operand to an Objective-C statement.
StmtResult RebuildObjCAtSynchronizedStmt (SourceLocation AtLoc, Expr *Object, Stmt *Body)
 Build a new Objective-C statement.
StmtResult RebuildObjCAutoreleasePoolStmt (SourceLocation AtLoc, Stmt *Body)
 Build a new Objective-C statement.
ExprResult RebuildObjCForCollectionOperand (SourceLocation forLoc, Expr *collection)
 Build the collection operand to a new Objective-C fast enumeration statement.
StmtResult RebuildObjCForCollectionStmt (SourceLocation ForLoc, SourceLocation LParenLoc, Stmt *Element, Expr *Collection, SourceLocation RParenLoc, Stmt *Body)
 Build a new Objective-C fast enumeration statement.
VarDeclRebuildExceptionDecl (VarDecl *ExceptionDecl, TypeSourceInfo *Declarator, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id)
 Build a new C++ exception declaration.
StmtResult RebuildCXXCatchStmt (SourceLocation CatchLoc, VarDecl *ExceptionDecl, Stmt *Handler)
 Build a new C++ catch statement.
StmtResult RebuildCXXTryStmt (SourceLocation TryLoc, Stmt *TryBlock, MultiStmtArg Handlers)
 Build a new C++ try statement.
StmtResult RebuildCXXForRangeStmt (SourceLocation ForLoc, SourceLocation ColonLoc, Stmt *Range, Stmt *BeginEnd, Expr *Cond, Expr *Inc, Stmt *LoopVar, SourceLocation RParenLoc)
 Build a new C++0x range-based for statement.
StmtResult RebuildMSDependentExistsStmt (SourceLocation KeywordLoc, bool IsIfExists, NestedNameSpecifierLoc QualifierLoc, DeclarationNameInfo NameInfo, Stmt *Nested)
 Build a new C++0x range-based for statement.
StmtResult FinishCXXForRangeStmt (Stmt *ForRange, Stmt *Body)
 Attach body to a C++0x range-based for statement.
StmtResult RebuildSEHTryStmt (bool IsCXXTry, SourceLocation TryLoc, Stmt *TryBlock, Stmt *Handler)
StmtResult RebuildSEHExceptStmt (SourceLocation Loc, Expr *FilterExpr, Stmt *Block)
StmtResult RebuildSEHFinallyStmt (SourceLocation Loc, Stmt *Block)
ExprResult RebuildDeclarationNameExpr (const CXXScopeSpec &SS, LookupResult &R, bool RequiresADL)
 Build a new expression that references a declaration.
ExprResult RebuildDeclRefExpr (NestedNameSpecifierLoc QualifierLoc, ValueDecl *VD, const DeclarationNameInfo &NameInfo, TemplateArgumentListInfo *TemplateArgs)
 Build a new expression that references a declaration.
ExprResult RebuildParenExpr (Expr *SubExpr, SourceLocation LParen, SourceLocation RParen)
 Build a new expression in parentheses.
ExprResult RebuildCXXPseudoDestructorExpr (Expr *Base, SourceLocation OperatorLoc, bool isArrow, CXXScopeSpec &SS, TypeSourceInfo *ScopeType, SourceLocation CCLoc, SourceLocation TildeLoc, PseudoDestructorTypeStorage Destroyed)
 Build a new pseudo-destructor expression.
ExprResult RebuildUnaryOperator (SourceLocation OpLoc, UnaryOperatorKind Opc, Expr *SubExpr)
 Build a new unary operator expression.
ExprResult RebuildOffsetOfExpr (SourceLocation OperatorLoc, TypeSourceInfo *Type, Sema::OffsetOfComponent *Components, unsigned NumComponents, SourceLocation RParenLoc)
 Build a new builtin offsetof expression.
ExprResult RebuildUnaryExprOrTypeTrait (TypeSourceInfo *TInfo, SourceLocation OpLoc, UnaryExprOrTypeTrait ExprKind, SourceRange R)
 Build a new sizeof, alignof or vec_step expression with a type argument.
ExprResult RebuildUnaryExprOrTypeTrait (Expr *SubExpr, SourceLocation OpLoc, UnaryExprOrTypeTrait ExprKind, SourceRange R)
 Build a new sizeof, alignof or vec step expression with an expression argument.
ExprResult RebuildArraySubscriptExpr (Expr *LHS, SourceLocation LBracketLoc, Expr *RHS, SourceLocation RBracketLoc)
 Build a new array subscript expression.
ExprResult RebuildCallExpr (Expr *Callee, SourceLocation LParenLoc, MultiExprArg Args, SourceLocation RParenLoc, Expr *ExecConfig=0)
 Build a new call expression.
ExprResult RebuildMemberExpr (Expr *Base, SourceLocation OpLoc, bool isArrow, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &MemberNameInfo, ValueDecl *Member, NamedDecl *FoundDecl, const TemplateArgumentListInfo *ExplicitTemplateArgs, NamedDecl *FirstQualifierInScope)
 Build a new member access expression.
ExprResult RebuildBinaryOperator (SourceLocation OpLoc, BinaryOperatorKind Opc, Expr *LHS, Expr *RHS)
 Build a new binary operator expression.
ExprResult RebuildConditionalOperator (Expr *Cond, SourceLocation QuestionLoc, Expr *LHS, SourceLocation ColonLoc, Expr *RHS)
 Build a new conditional operator expression.
ExprResult RebuildCStyleCastExpr (SourceLocation LParenLoc, TypeSourceInfo *TInfo, SourceLocation RParenLoc, Expr *SubExpr)
 Build a new C-style cast expression.
ExprResult RebuildCompoundLiteralExpr (SourceLocation LParenLoc, TypeSourceInfo *TInfo, SourceLocation RParenLoc, Expr *Init)
 Build a new compound literal expression.
ExprResult RebuildExtVectorElementExpr (Expr *Base, SourceLocation OpLoc, SourceLocation AccessorLoc, IdentifierInfo &Accessor)
 Build a new extended vector element access expression.
ExprResult RebuildInitList (SourceLocation LBraceLoc, MultiExprArg Inits, SourceLocation RBraceLoc, QualType ResultTy)
 Build a new initializer list expression.
ExprResult RebuildDesignatedInitExpr (Designation &Desig, MultiExprArg ArrayExprs, SourceLocation EqualOrColonLoc, bool GNUSyntax, Expr *Init)
 Build a new designated initializer expression.
ExprResult RebuildImplicitValueInitExpr (QualType T)
 Build a new value-initialized expression.
ExprResult RebuildVAArgExpr (SourceLocation BuiltinLoc, Expr *SubExpr, TypeSourceInfo *TInfo, SourceLocation RParenLoc)
 Build a new va_arg expression.
ExprResult RebuildParenListExpr (SourceLocation LParenLoc, MultiExprArg SubExprs, SourceLocation RParenLoc)
 Build a new expression list in parentheses.
ExprResult RebuildAddrLabelExpr (SourceLocation AmpAmpLoc, SourceLocation LabelLoc, LabelDecl *Label)
 Build a new address-of-label expression.
ExprResult RebuildStmtExpr (SourceLocation LParenLoc, Stmt *SubStmt, SourceLocation RParenLoc)
 Build a new GNU statement expression.
ExprResult RebuildChooseExpr (SourceLocation BuiltinLoc, Expr *Cond, Expr *LHS, Expr *RHS, SourceLocation RParenLoc)
 Build a new __builtin_choose_expr expression.
ExprResult RebuildGenericSelectionExpr (SourceLocation KeyLoc, SourceLocation DefaultLoc, SourceLocation RParenLoc, Expr *ControllingExpr, TypeSourceInfo **Types, Expr **Exprs, unsigned NumAssocs)
 Build a new generic selection expression.
ExprResult RebuildCXXOperatorCallExpr (OverloadedOperatorKind Op, SourceLocation OpLoc, Expr *Callee, Expr *First, Expr *Second)
 Build a new overloaded operator call expression.
ExprResult RebuildCXXNamedCastExpr (SourceLocation OpLoc, Stmt::StmtClass Class, SourceLocation LAngleLoc, TypeSourceInfo *TInfo, SourceLocation RAngleLoc, SourceLocation LParenLoc, Expr *SubExpr, SourceLocation RParenLoc)
 Build a new C++ "named" cast expression, such as static_cast or reinterpret_cast.
ExprResult RebuildCXXStaticCastExpr (SourceLocation OpLoc, SourceLocation LAngleLoc, TypeSourceInfo *TInfo, SourceLocation RAngleLoc, SourceLocation LParenLoc, Expr *SubExpr, SourceLocation RParenLoc)
 Build a new C++ static_cast expression.
ExprResult RebuildCXXDynamicCastExpr (SourceLocation OpLoc, SourceLocation LAngleLoc, TypeSourceInfo *TInfo, SourceLocation RAngleLoc, SourceLocation LParenLoc, Expr *SubExpr, SourceLocation RParenLoc)
 Build a new C++ dynamic_cast expression.
ExprResult RebuildCXXReinterpretCastExpr (SourceLocation OpLoc, SourceLocation LAngleLoc, TypeSourceInfo *TInfo, SourceLocation RAngleLoc, SourceLocation LParenLoc, Expr *SubExpr, SourceLocation RParenLoc)
 Build a new C++ reinterpret_cast expression.
ExprResult RebuildCXXConstCastExpr (SourceLocation OpLoc, SourceLocation LAngleLoc, TypeSourceInfo *TInfo, SourceLocation RAngleLoc, SourceLocation LParenLoc, Expr *SubExpr, SourceLocation RParenLoc)
 Build a new C++ const_cast expression.
ExprResult RebuildCXXFunctionalCastExpr (TypeSourceInfo *TInfo, SourceLocation LParenLoc, Expr *Sub, SourceLocation RParenLoc)
 Build a new C++ functional-style cast expression.
ExprResult RebuildCXXTypeidExpr (QualType TypeInfoType, SourceLocation TypeidLoc, TypeSourceInfo *Operand, SourceLocation RParenLoc)
 Build a new C++ typeid(type) expression.
ExprResult RebuildCXXTypeidExpr (QualType TypeInfoType, SourceLocation TypeidLoc, Expr *Operand, SourceLocation RParenLoc)
 Build a new C++ typeid(expr) expression.
ExprResult RebuildCXXUuidofExpr (QualType TypeInfoType, SourceLocation TypeidLoc, TypeSourceInfo *Operand, SourceLocation RParenLoc)
 Build a new C++ __uuidof(type) expression.
ExprResult RebuildCXXUuidofExpr (QualType TypeInfoType, SourceLocation TypeidLoc, Expr *Operand, SourceLocation RParenLoc)
 Build a new C++ __uuidof(expr) expression.
ExprResult RebuildCXXThisExpr (SourceLocation ThisLoc, QualType ThisType, bool isImplicit)
 Build a new C++ "this" expression.
ExprResult RebuildCXXThrowExpr (SourceLocation ThrowLoc, Expr *Sub, bool IsThrownVariableInScope)
 Build a new C++ throw expression.
ExprResult RebuildCXXDefaultArgExpr (SourceLocation Loc, ParmVarDecl *Param)
 Build a new C++ default-argument expression.
ExprResult RebuildCXXScalarValueInitExpr (TypeSourceInfo *TSInfo, SourceLocation LParenLoc, SourceLocation RParenLoc)
 Build a new C++ zero-initialization expression.
ExprResult RebuildCXXNewExpr (SourceLocation StartLoc, bool UseGlobal, SourceLocation PlacementLParen, MultiExprArg PlacementArgs, SourceLocation PlacementRParen, SourceRange TypeIdParens, QualType AllocatedType, TypeSourceInfo *AllocatedTypeInfo, Expr *ArraySize, SourceRange DirectInitRange, Expr *Initializer)
 Build a new C++ "new" expression.
ExprResult RebuildCXXDeleteExpr (SourceLocation StartLoc, bool IsGlobalDelete, bool IsArrayForm, Expr *Operand)
 Build a new C++ "delete" expression.
ExprResult RebuildUnaryTypeTrait (UnaryTypeTrait Trait, SourceLocation StartLoc, TypeSourceInfo *T, SourceLocation RParenLoc)
 Build a new unary type trait expression.
ExprResult RebuildBinaryTypeTrait (BinaryTypeTrait Trait, SourceLocation StartLoc, TypeSourceInfo *LhsT, TypeSourceInfo *RhsT, SourceLocation RParenLoc)
 Build a new binary type trait expression.
ExprResult RebuildTypeTrait (TypeTrait Trait, SourceLocation StartLoc, ArrayRef< TypeSourceInfo * > Args, SourceLocation RParenLoc)
 Build a new type trait expression.
ExprResult RebuildArrayTypeTrait (ArrayTypeTrait Trait, SourceLocation StartLoc, TypeSourceInfo *TSInfo, Expr *DimExpr, SourceLocation RParenLoc)
 Build a new array type trait expression.
ExprResult RebuildExpressionTrait (ExpressionTrait Trait, SourceLocation StartLoc, Expr *Queried, SourceLocation RParenLoc)
 Build a new expression trait expression.
ExprResult RebuildDependentScopeDeclRefExpr (NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs)
 Build a new (previously unresolved) declaration reference expression.
ExprResult RebuildTemplateIdExpr (const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, LookupResult &R, bool RequiresADL, const TemplateArgumentListInfo *TemplateArgs)
 Build a new template-id expression.
ExprResult RebuildCXXConstructExpr (QualType T, SourceLocation Loc, CXXConstructorDecl *Constructor, bool IsElidable, MultiExprArg Args, bool HadMultipleCandidates, bool RequiresZeroInit, CXXConstructExpr::ConstructionKind ConstructKind, SourceRange ParenRange)
 Build a new object-construction expression.
ExprResult RebuildCXXTemporaryObjectExpr (TypeSourceInfo *TSInfo, SourceLocation LParenLoc, MultiExprArg Args, SourceLocation RParenLoc)
 Build a new object-construction expression.
ExprResult RebuildCXXUnresolvedConstructExpr (TypeSourceInfo *TSInfo, SourceLocation LParenLoc, MultiExprArg Args, SourceLocation RParenLoc)
 Build a new object-construction expression.
ExprResult RebuildCXXDependentScopeMemberExpr (Expr *BaseE, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierInScope, const DeclarationNameInfo &MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs)
 Build a new member reference expression.
ExprResult RebuildUnresolvedMemberExpr (Expr *BaseE, QualType BaseType, SourceLocation OperatorLoc, bool IsArrow, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierInScope, LookupResult &R, const TemplateArgumentListInfo *TemplateArgs)
 Build a new member reference expression.
ExprResult RebuildCXXNoexceptExpr (SourceRange Range, Expr *Arg)
 Build a new noexcept expression.
ExprResult RebuildSizeOfPackExpr (SourceLocation OperatorLoc, NamedDecl *Pack, SourceLocation PackLoc, SourceLocation RParenLoc, llvm::Optional< unsigned > Length)
 Build a new expression to compute the length of a parameter pack.
ExprResult RebuildObjCBoxedExpr (SourceRange SR, Expr *ValueExpr)
 Build a new Objective-C boxed expression.
ExprResult RebuildObjCArrayLiteral (SourceRange Range, Expr **Elements, unsigned NumElements)
 Build a new Objective-C array literal.
ExprResult RebuildObjCSubscriptRefExpr (SourceLocation RB, Expr *Base, Expr *Key, ObjCMethodDecl *getterMethod, ObjCMethodDecl *setterMethod)
ExprResult RebuildObjCDictionaryLiteral (SourceRange Range, ObjCDictionaryElement *Elements, unsigned NumElements)
 Build a new Objective-C dictionary literal.
ExprResult RebuildObjCEncodeExpr (SourceLocation AtLoc, TypeSourceInfo *EncodeTypeInfo, SourceLocation RParenLoc)
 Build a new Objective-C expression.
ExprResult RebuildObjCMessageExpr (TypeSourceInfo *ReceiverTypeInfo, Selector Sel, ArrayRef< SourceLocation > SelectorLocs, ObjCMethodDecl *Method, SourceLocation LBracLoc, MultiExprArg Args, SourceLocation RBracLoc)
 Build a new Objective-C class message.
ExprResult RebuildObjCMessageExpr (Expr *Receiver, Selector Sel, ArrayRef< SourceLocation > SelectorLocs, ObjCMethodDecl *Method, SourceLocation LBracLoc, MultiExprArg Args, SourceLocation RBracLoc)
 Build a new Objective-C instance message.
ExprResult RebuildObjCIvarRefExpr (Expr *BaseArg, ObjCIvarDecl *Ivar, SourceLocation IvarLoc, bool IsArrow, bool IsFreeIvar)
 Build a new Objective-C ivar reference expression.
ExprResult RebuildObjCPropertyRefExpr (Expr *BaseArg, ObjCPropertyDecl *Property, SourceLocation PropertyLoc)
 Build a new Objective-C property reference expression.
ExprResult RebuildObjCPropertyRefExpr (Expr *Base, QualType T, ObjCMethodDecl *Getter, ObjCMethodDecl *Setter, SourceLocation PropertyLoc)
 Build a new Objective-C property reference expression.
ExprResult RebuildObjCIsaExpr (Expr *BaseArg, SourceLocation IsaLoc, bool IsArrow)
 Build a new Objective-C "isa" expression.
ExprResult RebuildShuffleVectorExpr (SourceLocation BuiltinLoc, MultiExprArg SubExprs, SourceLocation RParenLoc)
 Build a new shuffle vector expression.
TemplateArgumentLoc RebuildPackExpansion (TemplateArgumentLoc Pattern, SourceLocation EllipsisLoc, llvm::Optional< unsigned > NumExpansions)
 Build a new template argument pack expansion.
ExprResult RebuildPackExpansion (Expr *Pattern, SourceLocation EllipsisLoc, llvm::Optional< unsigned > NumExpansions)
 Build a new expression pack expansion.
ExprResult RebuildAtomicExpr (SourceLocation BuiltinLoc, MultiExprArg SubExprs, QualType RetTy, AtomicExpr::AtomicOp Op, SourceLocation RParenLoc)
 Build a new atomic operation expression.

Static Public Member Functions

static ExprResult Owned (Expr *E)
static StmtResult Owned (Stmt *S)

Protected Attributes

SemaSemaRef
llvm::DenseMap< Decl *, Decl * > TransformedLocalDecls
 The set of local declarations that have been transformed, for cases where we are forced to build new declarations within the transformer rather than in the subclass (e.g., lambda closure types).

Detailed Description

template<typename Derived>
class clang::TreeTransform< Derived >

A semantic tree transformation that allows one to transform one abstract syntax tree into another.

A new tree transformation is defined by creating a new subclass X of TreeTransform<X> and then overriding certain operations to provide behavior specific to that transformation. For example, template instantiation is implemented as a tree transformation where the transformation of TemplateTypeParmType nodes involves substituting the template arguments for their corresponding template parameters; a similar transformation is performed for non-type template parameters and template template parameters.

This tree-transformation template uses static polymorphism to allow subclasses to customize any of its operations. Thus, a subclass can override any of the transformation or rebuild operators by providing an operation with the same signature as the default implementation. The overridding function should not be virtual.

Semantic tree transformations are split into two stages, either of which can be replaced by a subclass. The "transform" step transforms an AST node or the parts of an AST node using the various transformation functions, then passes the pieces on to the "rebuild" step, which constructs a new AST node of the appropriate kind from the pieces. The default transformation routines recursively transform the operands to composite AST nodes (e.g., the pointee type of a PointerType node) and, if any of those operand nodes were changed by the transformation, invokes the rebuild operation to create a new AST node.

Subclasses can customize the transformation at various levels. The most coarse-grained transformations involve replacing TransformType(), TransformExpr(), TransformDecl(), TransformNestedNameSpecifierLoc(), TransformTemplateName(), or TransformTemplateArgument() with entirely new implementations.

For more fine-grained transformations, subclasses can replace any of the TransformXXX functions (where XXX is the name of an AST node, e.g., PointerType, StmtExpr) to alter the transformation. As mentioned previously, replacing TransformTemplateTypeParmType() allows template instantiation to substitute template arguments for their corresponding template parameters. Additionally, subclasses can override the RebuildXXX functions to control how AST nodes are rebuilt when their operands change. By default, TreeTransform will invoke semantic analysis to rebuild AST nodes. However, certain other tree transformations (e.g, cloning) may be able to use more efficient rebuild steps.

There are a handful of other functions that can be overridden, allowing one to avoid traversing nodes that don't need any transformation (AlreadyTransformed()), force rebuilding AST nodes even when their operands have not changed (AlwaysRebuild()), and customize the default locations and entity names used for type-checking (getBaseLocation(), getBaseEntity()).

Definition at line 94 of file TreeTransform.h.


Constructor & Destructor Documentation

template<typename Derived>
clang::TreeTransform< Derived >::TreeTransform ( Sema SemaRef) [inline]

Initializes a new tree transformer.

Definition at line 122 of file TreeTransform.h.


Member Function Documentation

template<typename Derived>
bool clang::TreeTransform< Derived >::AlreadyTransformed ( QualType  T) [inline]

Determine whether the given type T has already been transformed.

Subclasses can provide an alternative implementation of this routine to short-circuit evaluation when it is known that a given type will not change. For example, template instantiation need not traverse non-dependent types.

Definition at line 197 of file TreeTransform.h.

References clang::QualType::isNull().

template<typename Derived>
bool clang::TreeTransform< Derived >::AlwaysRebuild ( ) [inline]

Whether the transformation should always rebuild AST nodes, even if none of the children have changed.

Subclasses may override this function to specify when the transformation should rebuild all AST nodes.

Definition at line 144 of file TreeTransform.h.

template<typename Derived>
bool clang::TreeTransform< Derived >::DropCallArgument ( Expr E) [inline]

Determine whether the given call argument should be dropped, e.g., because it is a default argument.

Subclasses can provide an alternative implementation of this routine to determine which kinds of call arguments get dropped. By default, CXXDefaultArgument nodes are dropped (prior to transformation).

Definition at line 207 of file TreeTransform.h.

References clang::Expr::isDefaultArgument().

template<typename Derived>
void clang::TreeTransform< Derived >::ExpandingFunctionParameterPack ( ParmVarDecl Pack) [inline]

Note to the derived class when a function parameter pack is being expanded.

Definition at line 279 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::FinishCXXForRangeStmt ( Stmt ForRange,
Stmt Body 
) [inline]

Attach body to a C++0x range-based for statement.

By default, performs semantic analysis to finish the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1358 of file TreeTransform.h.

template<typename Derived>
TemplateArgument clang::TreeTransform< Derived >::ForgetPartiallySubstitutedPack ( ) [inline]

"Forget" about the partially-substituted pack template argument, when performing an instantiation that must preserve the parameter pack use.

This routine is meant to be overridden by the template instantiator.

Definition at line 266 of file TreeTransform.h.

template<typename Derived>
DeclarationName clang::TreeTransform< Derived >::getBaseEntity ( ) [inline]

Returns the name of the entity being transformed, if that information was not available elsewhere in the AST.

By default, returns an empty name. Subclasses can provide an alternative implementation with a more precise name.

Definition at line 159 of file TreeTransform.h.

template<typename Derived>
SourceLocation clang::TreeTransform< Derived >::getBaseLocation ( ) [inline]

Returns the location of the entity being transformed, if that information was not available elsewhere in the AST.

By default, returns no source-location information. Subclasses can provide an alternative implementation that provides better location information.

Definition at line 152 of file TreeTransform.h.

template<typename Derived>
Derived& clang::TreeTransform< Derived >::getDerived ( ) [inline]

Retrieves a reference to the derived class.

Definition at line 125 of file TreeTransform.h.

Referenced by clang::TreeTransform< Derived >::TemporaryBase::TemporaryBase().

template<typename Derived>
const Derived& clang::TreeTransform< Derived >::getDerived ( ) const [inline]

Retrieves a reference to the derived class.

Definition at line 128 of file TreeTransform.h.

template<typename Derived>
Sema& clang::TreeTransform< Derived >::getSema ( ) const [inline]

Retrieves a reference to the semantic analysis object used for this tree transform.

Definition at line 137 of file TreeTransform.h.

template<typename Derived >
void clang::TreeTransform< Derived >::InventTemplateArgumentLoc ( const TemplateArgument Arg,
TemplateArgumentLoc ArgLoc 
)
template<typename Derived>
TypeSourceInfo* clang::TreeTransform< Derived >::InventTypeSourceInfo ( QualType  T) [inline]

Fakes up a TypeSourceInfo for a type.

Definition at line 515 of file TreeTransform.h.

template<typename Derived>
static ExprResult clang::TreeTransform< Derived >::Owned ( Expr E) [inline, static]
template<typename Derived>
static StmtResult clang::TreeTransform< Derived >::Owned ( Stmt S) [inline, static]

Definition at line 133 of file TreeTransform.h.

References S.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildAddrLabelExpr ( SourceLocation  AmpAmpLoc,
SourceLocation  LabelLoc,
LabelDecl Label 
) [inline]

Build a new address-of-label expression.

By default, performs semantic analysis, using the name of the label rather than attempting to map the label statement itself. Subclasses may override this routine to provide different behavior.

Definition at line 1703 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildArraySubscriptExpr ( Expr LHS,
SourceLocation  LBracketLoc,
Expr RHS,
SourceLocation  RBracketLoc 
) [inline]

Build a new array subscript expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1484 of file TreeTransform.h.

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildArrayType ( QualType  ElementType,
ArrayType::ArraySizeModifier  SizeMod,
const llvm::APInt *  Size,
Expr SizeExpr,
unsigned  IndexTypeQuals,
SourceRange  BracketsRange 
)

Build a new array type given the element type, size modifier, size of the array (if known), size expression, and index type qualifiers.

By default, performs semantic analysis when building the array type. Subclasses may override this routine to provide different behavior. Also by default, all of the other Rebuild*Array

Definition at line 8904 of file TreeTransform.h.

References clang::IntegerLiteral::Create(), and clang::SourceRange::getBegin().

Referenced by clang::TreeTransform< Derived >::RebuildConstantArrayType(), clang::TreeTransform< Derived >::RebuildDependentSizedArrayType(), clang::TreeTransform< Derived >::RebuildIncompleteArrayType(), and clang::TreeTransform< Derived >::RebuildVariableArrayType().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildArrayTypeTrait ( ArrayTypeTrait  Trait,
SourceLocation  StartLoc,
TypeSourceInfo TSInfo,
Expr DimExpr,
SourceLocation  RParenLoc 
) [inline]

Build a new array type trait expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2054 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildAsmStmt ( SourceLocation  AsmLoc,
bool  IsSimple,
bool  IsVolatile,
unsigned  NumOutputs,
unsigned  NumInputs,
IdentifierInfo **  Names,
MultiExprArg  Constraints,
MultiExprArg  Exprs,
Expr AsmString,
MultiExprArg  Clobbers,
SourceLocation  RParenLoc,
bool  MSAsm 
) [inline]

Build a new inline asm statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1164 of file TreeTransform.h.

References clang::move().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildAtomicExpr ( SourceLocation  BuiltinLoc,
MultiExprArg  SubExprs,
QualType  RetTy,
AtomicExpr::AtomicOp  Op,
SourceLocation  RParenLoc 
) [inline]

Build a new atomic operation expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2506 of file TreeTransform.h.

References clang::ASTMultiPtr< PtrTy >::release(), and clang::ASTMultiPtr< PtrTy >::size().

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildAtomicType ( QualType  ValueType,
SourceLocation  KWLoc 
)

Build a new atomic type given its value type.

By default, performs semantic analysis when building the atomic type. Subclasses may override this routine to provide different behavior.

Definition at line 9090 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildAttributedStmt ( SourceLocation  AttrLoc,
const AttrVec Attrs,
Stmt SubStmt 
) [inline]

Build a new label statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1056 of file TreeTransform.h.

template<typename Derived>
QualType clang::TreeTransform< Derived >::RebuildAutoType ( QualType  Deduced) [inline]

Build a new C++0x auto type.

By default, builds a new AutoType with the given deduced type.

Definition at line 757 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildBinaryOperator ( SourceLocation  OpLoc,
BinaryOperatorKind  Opc,
Expr LHS,
Expr RHS 
) [inline]

Build a new binary operator expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1566 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildBinaryTypeTrait ( BinaryTypeTrait  Trait,
SourceLocation  StartLoc,
TypeSourceInfo LhsT,
TypeSourceInfo RhsT,
SourceLocation  RParenLoc 
) [inline]

Build a new binary type trait expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2031 of file TreeTransform.h.

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildBlockPointerType ( QualType  PointeeType,
SourceLocation  Sigil 
)

Build a new block pointer type given its pointee type.

By default, performs semantic analysis when building the block pointer type. Subclasses may override this routine to provide different behavior.

Definition at line 8878 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCallExpr ( Expr Callee,
SourceLocation  LParenLoc,
MultiExprArg  Args,
SourceLocation  RParenLoc,
Expr ExecConfig = 0 
) [inline]

Build a new call expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1497 of file TreeTransform.h.

References clang::move().

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildCaseStmt ( SourceLocation  CaseLoc,
Expr LHS,
SourceLocation  EllipsisLoc,
Expr RHS,
SourceLocation  ColonLoc 
) [inline]

Build a new case statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1014 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildCaseStmtBody ( Stmt S,
Stmt Body 
) [inline]

Attach the body to a new case statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1027 of file TreeTransform.h.

References S.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildChooseExpr ( SourceLocation  BuiltinLoc,
Expr Cond,
Expr LHS,
Expr RHS,
SourceLocation  RParenLoc 
) [inline]

Build a new __builtin_choose_expr expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1722 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCompoundLiteralExpr ( SourceLocation  LParenLoc,
TypeSourceInfo TInfo,
SourceLocation  RParenLoc,
Expr Init 
) [inline]

Build a new compound literal expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1601 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildCompoundStmt ( SourceLocation  LBraceLoc,
MultiStmtArg  Statements,
SourceLocation  RBraceLoc,
bool  IsStmtExpr 
) [inline]

Build a new compound statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1002 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildConditionalOperator ( Expr Cond,
SourceLocation  QuestionLoc,
Expr LHS,
SourceLocation  ColonLoc,
Expr RHS 
) [inline]

Build a new conditional operator expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1576 of file TreeTransform.h.

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildConstantArrayType ( QualType  ElementType,
ArrayType::ArraySizeModifier  SizeMod,
const llvm::APInt &  Size,
unsigned  IndexTypeQuals,
SourceRange  BracketsRange 
)

Build a new constant array type given the element type, size modifier, (known) size of the array, and index type qualifiers.

By default, performs semantic analysis when building the array type. Subclasses may override this routine to provide different behavior.

Definition at line 8940 of file TreeTransform.h.

References clang::TreeTransform< Derived >::RebuildArrayType().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCStyleCastExpr ( SourceLocation  LParenLoc,
TypeSourceInfo TInfo,
SourceLocation  RParenLoc,
Expr SubExpr 
) [inline]

Build a new C-style cast expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1589 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildCXXCatchStmt ( SourceLocation  CatchLoc,
VarDecl ExceptionDecl,
Stmt Handler 
) [inline]

Build a new C++ catch statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1310 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXConstCastExpr ( SourceLocation  OpLoc,
SourceLocation  LAngleLoc,
TypeSourceInfo TInfo,
SourceLocation  RAngleLoc,
SourceLocation  LParenLoc,
Expr SubExpr,
SourceLocation  RParenLoc 
) [inline]

Build a new C++ const_cast expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1856 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXConstructExpr ( QualType  T,
SourceLocation  Loc,
CXXConstructorDecl Constructor,
bool  IsElidable,
MultiExprArg  Args,
bool  HadMultipleCandidates,
bool  RequiresZeroInit,
CXXConstructExpr::ConstructionKind  ConstructKind,
SourceRange  ParenRange 
) [inline]

Build a new object-construction expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2110 of file TreeTransform.h.

References clang::ExprError(), clang::move(), and clang::move_arg().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXDefaultArgExpr ( SourceLocation  Loc,
ParmVarDecl Param 
) [inline]

Build a new C++ default-argument expression.

By default, builds a new default-argument expression, which does not require any semantic analysis. Subclasses may override this routine to provide different behavior.

Definition at line 1959 of file TreeTransform.h.

References clang::CXXDefaultArgExpr::Create().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXDeleteExpr ( SourceLocation  StartLoc,
bool  IsGlobalDelete,
bool  IsArrayForm,
Expr Operand 
) [inline]

Build a new C++ "delete" expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2008 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXDependentScopeMemberExpr ( Expr BaseE,
QualType  BaseType,
bool  IsArrow,
SourceLocation  OperatorLoc,
NestedNameSpecifierLoc  QualifierLoc,
SourceLocation  TemplateKWLoc,
NamedDecl FirstQualifierInScope,
const DeclarationNameInfo MemberNameInfo,
const TemplateArgumentListInfo TemplateArgs 
) [inline]

Build a new member reference expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2163 of file TreeTransform.h.

References clang::CXXScopeSpec::Adopt().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXDynamicCastExpr ( SourceLocation  OpLoc,
SourceLocation  LAngleLoc,
TypeSourceInfo TInfo,
SourceLocation  RAngleLoc,
SourceLocation  LParenLoc,
Expr SubExpr,
SourceLocation  RParenLoc 
) [inline]

Build a new C++ dynamic_cast expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1822 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildCXXForRangeStmt ( SourceLocation  ForLoc,
SourceLocation  ColonLoc,
Stmt Range,
Stmt BeginEnd,
Expr Cond,
Expr Inc,
Stmt LoopVar,
SourceLocation  RParenLoc 
) [inline]

Build a new C++0x range-based for statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1331 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXFunctionalCastExpr ( TypeSourceInfo TInfo,
SourceLocation  LParenLoc,
Expr Sub,
SourceLocation  RParenLoc 
) [inline]

Build a new C++ functional-style cast expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1873 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXNamedCastExpr ( SourceLocation  OpLoc,
Stmt::StmtClass  Class,
SourceLocation  LAngleLoc,
TypeSourceInfo TInfo,
SourceLocation  RAngleLoc,
SourceLocation  LParenLoc,
Expr SubExpr,
SourceLocation  RParenLoc 
) [inline]

Build a new C++ "named" cast expression, such as static_cast or reinterpret_cast.

By default, this routine dispatches to one of the more-specific routines for a particular named case, e.g., RebuildCXXStaticCastExpr(). Subclasses may override this routine to provide different behavior.

Definition at line 1766 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXNewExpr ( SourceLocation  StartLoc,
bool  UseGlobal,
SourceLocation  PlacementLParen,
MultiExprArg  PlacementArgs,
SourceLocation  PlacementRParen,
SourceRange  TypeIdParens,
QualType  AllocatedType,
TypeSourceInfo AllocatedTypeInfo,
Expr ArraySize,
SourceRange  DirectInitRange,
Expr Initializer 
) [inline]

Build a new C++ "new" expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1981 of file TreeTransform.h.

References clang::move().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXNoexceptExpr ( SourceRange  Range,
Expr Arg 
) [inline]

Build a new noexcept expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2209 of file TreeTransform.h.

References Arg, clang::SourceRange::getBegin(), and clang::SourceRange::getEnd().

template<typename Derived >
ExprResult clang::TreeTransform< Derived >::RebuildCXXOperatorCallExpr ( OverloadedOperatorKind  Op,
SourceLocation  OpLoc,
Expr Callee,
Expr First,
Expr Second 
)

Build a new overloaded operator call expression.

By default, performs semantic analysis to build the new expression. The semantic analysis provides the behavior of template instantiation, copying with transformations that turn what looks like an overloaded operator call into a use of a builtin operator, performing argument-dependent lookup, etc. Subclasses may override this routine to provide different behavior.

Definition at line 9145 of file TreeTransform.h.

References clang::UnresolvedSetImpl::addDecl(), clang::UnresolvedSetImpl::append(), clang::DeclarationNameLoc::CXXOperatorName, clang::ExprError(), clang::SourceLocation::getFromRawEncoding(), clang::Stmt::getLocStart(), clang::UnaryOperator::getOverloadedOpcode(), clang::BinaryOperator::getOverloadedOpcode(), clang::Expr::getType(), clang::Expr::IgnoreParenCasts(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::move(), and NumArgs.

template<typename Derived >
ExprResult clang::TreeTransform< Derived >::RebuildCXXPseudoDestructorExpr ( Expr Base,
SourceLocation  OperatorLoc,
bool  isArrow,
CXXScopeSpec SS,
TypeSourceInfo ScopeType,
SourceLocation  CCLoc,
SourceLocation  TildeLoc,
PseudoDestructorTypeStorage  Destroyed 
)
template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXReinterpretCastExpr ( SourceLocation  OpLoc,
SourceLocation  LAngleLoc,
TypeSourceInfo TInfo,
SourceLocation  RAngleLoc,
SourceLocation  LParenLoc,
Expr SubExpr,
SourceLocation  RParenLoc 
) [inline]

Build a new C++ reinterpret_cast expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1839 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXScalarValueInitExpr ( TypeSourceInfo TSInfo,
SourceLocation  LParenLoc,
SourceLocation  RParenLoc 
) [inline]

Build a new C++ zero-initialization expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1969 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXStaticCastExpr ( SourceLocation  OpLoc,
SourceLocation  LAngleLoc,
TypeSourceInfo TInfo,
SourceLocation  RAngleLoc,
SourceLocation  LParenLoc,
Expr SubExpr,
SourceLocation  RParenLoc 
) [inline]

Build a new C++ static_cast expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1805 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXTemporaryObjectExpr ( TypeSourceInfo TSInfo,
SourceLocation  LParenLoc,
MultiExprArg  Args,
SourceLocation  RParenLoc 
) [inline]

Build a new object-construction expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2135 of file TreeTransform.h.

References clang::move().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXThisExpr ( SourceLocation  ThisLoc,
QualType  ThisType,
bool  isImplicit 
) [inline]

Build a new C++ "this" expression.

By default, builds a new "this" expression without performing any semantic analysis. Subclasses may override this routine to provide different behavior.

Definition at line 1936 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXThrowExpr ( SourceLocation  ThrowLoc,
Expr Sub,
bool  IsThrownVariableInScope 
) [inline]

Build a new C++ throw expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1949 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildCXXTryStmt ( SourceLocation  TryLoc,
Stmt TryBlock,
MultiStmtArg  Handlers 
) [inline]

Build a new C++ try statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1321 of file TreeTransform.h.

References clang::move().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXTypeidExpr ( QualType  TypeInfoType,
SourceLocation  TypeidLoc,
TypeSourceInfo Operand,
SourceLocation  RParenLoc 
) [inline]

Build a new C++ typeid(type) expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1886 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXTypeidExpr ( QualType  TypeInfoType,
SourceLocation  TypeidLoc,
Expr Operand,
SourceLocation  RParenLoc 
) [inline]

Build a new C++ typeid(expr) expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1899 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXUnresolvedConstructExpr ( TypeSourceInfo TSInfo,
SourceLocation  LParenLoc,
MultiExprArg  Args,
SourceLocation  RParenLoc 
) [inline]

Build a new object-construction expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2149 of file TreeTransform.h.

References clang::move().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXUuidofExpr ( QualType  TypeInfoType,
SourceLocation  TypeidLoc,
TypeSourceInfo Operand,
SourceLocation  RParenLoc 
) [inline]

Build a new C++ __uuidof(type) expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1911 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildCXXUuidofExpr ( QualType  TypeInfoType,
SourceLocation  TypeidLoc,
Expr Operand,
SourceLocation  RParenLoc 
) [inline]

Build a new C++ __uuidof(expr) expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1923 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildDeclarationNameExpr ( const CXXScopeSpec SS,
LookupResult R,
bool  RequiresADL 
) [inline]

Build a new expression that references a declaration.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1384 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildDeclRefExpr ( NestedNameSpecifierLoc  QualifierLoc,
ValueDecl VD,
const DeclarationNameInfo NameInfo,
TemplateArgumentListInfo TemplateArgs 
) [inline]

Build a new expression that references a declaration.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1395 of file TreeTransform.h.

References clang::CXXScopeSpec::Adopt().

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildDeclStmt ( Decl **  Decls,
unsigned  NumDecls,
SourceLocation  StartLoc,
SourceLocation  EndLoc 
) [inline]

Build a new declaration statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1153 of file TreeTransform.h.

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildDecltypeType ( Expr Underlying,
SourceLocation  Loc 
)

Build a new C++0x decltype type.

By default, performs semantic analysis when building the decltype type. Subclasses may override this routine to provide different behavior.

Definition at line 9069 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildDefaultStmt ( SourceLocation  DefaultLoc,
SourceLocation  ColonLoc,
Stmt SubStmt 
) [inline]

Build a new default statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1036 of file TreeTransform.h.

template<typename Derived>
QualType clang::TreeTransform< Derived >::RebuildDependentNameType ( ElaboratedTypeKeyword  Keyword,
SourceLocation  KeywordLoc,
NestedNameSpecifierLoc  QualifierLoc,
const IdentifierInfo Id,
SourceLocation  IdLoc 
) [inline]
template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildDependentScopeDeclRefExpr ( NestedNameSpecifierLoc  QualifierLoc,
SourceLocation  TemplateKWLoc,
const DeclarationNameInfo NameInfo,
const TemplateArgumentListInfo TemplateArgs 
) [inline]

Build a new (previously unresolved) declaration reference expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2078 of file TreeTransform.h.

References clang::CXXScopeSpec::Adopt(), and clang::SourceLocation::isValid().

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildDependentSizedArrayType ( QualType  ElementType,
ArrayType::ArraySizeModifier  SizeMod,
Expr SizeExpr,
unsigned  IndexTypeQuals,
SourceRange  BracketsRange 
)

Build a new dependent-sized array type given the element type, size modifier, size expression, and index type qualifiers.

By default, performs semantic analysis when building the array type. Subclasses may override this routine to provide different behavior.

Definition at line 8973 of file TreeTransform.h.

References clang::TreeTransform< Derived >::RebuildArrayType().

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildDependentSizedExtVectorType ( QualType  ElementType,
Expr SizeExpr,
SourceLocation  AttributeLoc 
)

Build a new potentially dependently-sized extended vector type given the element type and number of elements.

By default, performs semantic analysis when building the vector type. Subclasses may override this routine to provide different behavior.

Definition at line 9005 of file TreeTransform.h.

template<typename Derived>
QualType clang::TreeTransform< Derived >::RebuildDependentTemplateSpecializationType ( ElaboratedTypeKeyword  Keyword,
NestedNameSpecifierLoc  QualifierLoc,
const IdentifierInfo Name,
SourceLocation  NameLoc,
TemplateArgumentListInfo Args 
) [inline]

Build a new typename type that refers to a template-id.

By default, builds a new DependentNameType type from the nested-name-specifier and the given type. Subclasses may override this routine to provide different behavior.

Definition at line 797 of file TreeTransform.h.

References clang::CXXScopeSpec::Adopt(), Args, clang::ETK_None, clang::TemplateName::getAsDependentTemplateName(), clang::NestedNameSpecifierLoc::getNestedNameSpecifier(), clang::TemplateName::isNull(), and clang::QualType::isNull().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildDesignatedInitExpr ( Designation Desig,
MultiExprArg  ArrayExprs,
SourceLocation  EqualOrColonLoc,
bool  GNUSyntax,
Expr Init 
) [inline]

Build a new designated initializer expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1652 of file TreeTransform.h.

References clang::ExprError(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::move(), and clang::ASTMultiPtr< PtrTy >::release().

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildDoStmt ( SourceLocation  DoLoc,
Stmt Body,
SourceLocation  WhileLoc,
SourceLocation  LParenLoc,
Expr Cond,
SourceLocation  RParenLoc 
) [inline]

Build a new do-while statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1103 of file TreeTransform.h.

template<typename Derived>
QualType clang::TreeTransform< Derived >::RebuildElaboratedType ( SourceLocation  KeywordLoc,
ElaboratedTypeKeyword  Keyword,
NestedNameSpecifierLoc  QualifierLoc,
QualType  Named 
) [inline]

Build a new qualified name type.

By default, builds a new ElaboratedType type from the keyword, the nested-name-specifier and the named type. Subclasses may override this routine to provide different behavior.

Definition at line 783 of file TreeTransform.h.

References clang::NestedNameSpecifierLoc::getNestedNameSpecifier().

template<typename Derived>
QualType clang::TreeTransform< Derived >::RebuildEnumType ( EnumDecl Enum) [inline]

Build a new Enum type.

Definition at line 728 of file TreeTransform.h.

template<typename Derived>
VarDecl* clang::TreeTransform< Derived >::RebuildExceptionDecl ( VarDecl ExceptionDecl,
TypeSourceInfo Declarator,
SourceLocation  StartLoc,
SourceLocation  IdLoc,
IdentifierInfo Id 
) [inline]

Build a new C++ exception declaration.

By default, performs semantic analysis to build the new decaration. Subclasses may override this routine to provide different behavior.

Definition at line 1294 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildExpressionTrait ( ExpressionTrait  Trait,
SourceLocation  StartLoc,
Expr Queried,
SourceLocation  RParenLoc 
) [inline]

Build a new expression trait expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2066 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildExtVectorElementExpr ( Expr Base,
SourceLocation  OpLoc,
SourceLocation  AccessorLoc,
IdentifierInfo Accessor 
) [inline]

Build a new extended vector element access expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1613 of file TreeTransform.h.

References clang::Expr::getType().

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildExtVectorType ( QualType  ElementType,
unsigned  NumElements,
SourceLocation  AttributeLoc 
)

Build a new extended vector type given the element type and number of elements.

By default, performs semantic analysis when building the vector type. Subclasses may override this routine to provide different behavior.

Definition at line 8992 of file TreeTransform.h.

References clang::IntegerLiteral::Create().

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildForStmt ( SourceLocation  ForLoc,
SourceLocation  LParenLoc,
Stmt Init,
Sema::FullExprArg  Cond,
VarDecl CondVar,
Sema::FullExprArg  Inc,
SourceLocation  RParenLoc,
Stmt Body 
) [inline]

Build a new for statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1114 of file TreeTransform.h.

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildFunctionNoProtoType ( QualType  ResultType)

Build a new unprototyped function type.

Definition at line 9028 of file TreeTransform.h.

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildFunctionProtoType ( QualType  T,
QualType ParamTypes,
unsigned  NumParamTypes,
bool  Variadic,
bool  HasTrailingReturn,
unsigned  Quals,
RefQualifierKind  RefQualifier,
const FunctionType::ExtInfo Info 
)

Build a new function type.

By default, performs semantic analysis when building the function type. Subclasses may override this routine to provide different behavior.

Definition at line 9012 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildGenericSelectionExpr ( SourceLocation  KeyLoc,
SourceLocation  DefaultLoc,
SourceLocation  RParenLoc,
Expr ControllingExpr,
TypeSourceInfo **  Types,
Expr **  Exprs,
unsigned  NumAssocs 
) [inline]

Build a new generic selection expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1734 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildGotoStmt ( SourceLocation  GotoLoc,
SourceLocation  LabelLoc,
LabelDecl Label 
) [inline]

Build a new goto statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1126 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildIfStmt ( SourceLocation  IfLoc,
Sema::FullExprArg  Cond,
VarDecl CondVar,
Stmt Then,
SourceLocation  ElseLoc,
Stmt Else 
) [inline]

Build a new "if" statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1065 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildImplicitValueInitExpr ( QualType  T) [inline]

Build a new value-initialized expression.

By default, builds the implicit value initialization without performing any semantic analysis. Subclasses may override this routine to provide different behavior.

Definition at line 1672 of file TreeTransform.h.

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildIncompleteArrayType ( QualType  ElementType,
ArrayType::ArraySizeModifier  SizeMod,
unsigned  IndexTypeQuals,
SourceRange  BracketsRange 
)

Build a new incomplete array type given the element type, size modifier, and index type qualifiers.

By default, performs semantic analysis when building the array type. Subclasses may override this routine to provide different behavior.

Definition at line 8951 of file TreeTransform.h.

References clang::TreeTransform< Derived >::RebuildArrayType().

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildIndirectGotoStmt ( SourceLocation  GotoLoc,
SourceLocation  StarLoc,
Expr Target 
) [inline]

Build a new indirect goto statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1135 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildInitList ( SourceLocation  LBraceLoc,
MultiExprArg  Inits,
SourceLocation  RBraceLoc,
QualType  ResultTy 
) [inline]

Build a new initializer list expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1632 of file TreeTransform.h.

References clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::move(), and clang::Expr::setType().

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildLabelStmt ( SourceLocation  IdentLoc,
LabelDecl L,
SourceLocation  ColonLoc,
Stmt SubStmt 
) [inline]

Build a new label statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1047 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildMemberExpr ( Expr Base,
SourceLocation  OpLoc,
bool  isArrow,
NestedNameSpecifierLoc  QualifierLoc,
SourceLocation  TemplateKWLoc,
const DeclarationNameInfo MemberNameInfo,
ValueDecl Member,
NamedDecl FoundDecl,
const TemplateArgumentListInfo ExplicitTemplateArgs,
NamedDecl FirstQualifierInScope 
) [inline]
template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildMemberPointerType ( QualType  PointeeType,
QualType  ClassType,
SourceLocation  Sigil 
)

Build a new member pointer type given the pointee type and the class type it refers into.

By default, performs semantic analysis when building the member pointer type. Subclasses may override this routine to provide different behavior.

Definition at line 8895 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildMSDependentExistsStmt ( SourceLocation  KeywordLoc,
bool  IsIfExists,
NestedNameSpecifierLoc  QualifierLoc,
DeclarationNameInfo  NameInfo,
Stmt Nested 
) [inline]

Build a new C++0x range-based for statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1345 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildObjCArrayLiteral ( SourceRange  Range,
Expr **  Elements,
unsigned  NumElements 
) [inline]

Build a new Objective-C array literal.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2240 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildObjCAtCatchStmt ( SourceLocation  AtLoc,
SourceLocation  RParenLoc,
VarDecl Var,
Stmt Body 
) [inline]

Build a new Objective-C statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1210 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildObjCAtFinallyStmt ( SourceLocation  AtLoc,
Stmt Body 
) [inline]

Build a new Objective-C statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1222 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildObjCAtSynchronizedOperand ( SourceLocation  atLoc,
Expr object 
) [inline]

Rebuild the operand to an Objective-C statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1240 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildObjCAtSynchronizedStmt ( SourceLocation  AtLoc,
Expr Object,
Stmt Body 
) [inline]

Build a new Objective-C statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1249 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildObjCAtThrowStmt ( SourceLocation  AtLoc,
Expr Operand 
) [inline]

Build a new Objective-C.

Exceptions:
statement.By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1231 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildObjCAtTryStmt ( SourceLocation  AtLoc,
Stmt TryBody,
MultiStmtArg  CatchStmts,
Stmt Finally 
) [inline]

Build a new Objective-C statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1186 of file TreeTransform.h.

References clang::move().

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildObjCAutoreleasePoolStmt ( SourceLocation  AtLoc,
Stmt Body 
) [inline]

Build a new Objective-C statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1258 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildObjCBoxedExpr ( SourceRange  SR,
Expr ValueExpr 
) [inline]

Build a new Objective-C boxed expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2232 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildObjCDictionaryLiteral ( SourceRange  Range,
ObjCDictionaryElement Elements,
unsigned  NumElements 
) [inline]

Build a new Objective-C dictionary literal.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2258 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildObjCEncodeExpr ( SourceLocation  AtLoc,
TypeSourceInfo EncodeTypeInfo,
SourceLocation  RParenLoc 
) [inline]

Build a new Objective-C expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2268 of file TreeTransform.h.

template<typename Derived>
VarDecl* clang::TreeTransform< Derived >::RebuildObjCExceptionDecl ( VarDecl ExceptionDecl,
TypeSourceInfo TInfo,
QualType  T 
) [inline]

Rebuild an Objective-C exception declaration.

By default, performs semantic analysis to build the new declaration. Subclasses may override this routine to provide different behavior.

Definition at line 1198 of file TreeTransform.h.

References clang::NamedDecl::getIdentifier(), clang::DeclaratorDecl::getInnerLocStart(), and clang::Decl::getLocation().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildObjCForCollectionOperand ( SourceLocation  forLoc,
Expr collection 
) [inline]

Build the collection operand to a new Objective-C fast enumeration statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1268 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildObjCForCollectionStmt ( SourceLocation  ForLoc,
SourceLocation  LParenLoc,
Stmt Element,
Expr Collection,
SourceLocation  RParenLoc,
Stmt Body 
) [inline]

Build a new Objective-C fast enumeration statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1277 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildObjCIsaExpr ( Expr BaseArg,
SourceLocation  IsaLoc,
bool  IsArrow 
) [inline]

Build a new Objective-C "isa" expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2384 of file TreeTransform.h.

References clang::ExprError(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Expr::getType(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Sema::LookupMemberName, and clang::move().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildObjCIvarRefExpr ( Expr BaseArg,
ObjCIvarDecl Ivar,
SourceLocation  IvarLoc,
bool  IsArrow,
bool  IsFreeIvar 
) [inline]

Build a new Objective-C ivar reference expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2309 of file TreeTransform.h.

References clang::ExprError(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::NamedDecl::getDeclName(), clang::Expr::getType(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Sema::LookupMemberName, and clang::move().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildObjCMessageExpr ( TypeSourceInfo ReceiverTypeInfo,
Selector  Sel,
ArrayRef< SourceLocation SelectorLocs,
ObjCMethodDecl Method,
SourceLocation  LBracLoc,
MultiExprArg  Args,
SourceLocation  RBracLoc 
) [inline]

Build a new Objective-C class message.

Definition at line 2276 of file TreeTransform.h.

References clang::TypeSourceInfo::getType(), and clang::move().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildObjCMessageExpr ( Expr Receiver,
Selector  Sel,
ArrayRef< SourceLocation SelectorLocs,
ObjCMethodDecl Method,
SourceLocation  LBracLoc,
MultiExprArg  Args,
SourceLocation  RBracLoc 
) [inline]

Build a new Objective-C instance message.

Definition at line 2291 of file TreeTransform.h.

References clang::Expr::getType(), and clang::move().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildObjCPropertyRefExpr ( Expr BaseArg,
ObjCPropertyDecl Property,
SourceLocation  PropertyLoc 
) [inline]

Build a new Objective-C property reference expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2339 of file TreeTransform.h.

References clang::ExprError(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::NamedDecl::getDeclName(), clang::Expr::getType(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Sema::LookupMemberName, and clang::move().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildObjCPropertyRefExpr ( Expr Base,
QualType  T,
ObjCMethodDecl Getter,
ObjCMethodDecl Setter,
SourceLocation  PropertyLoc 
) [inline]

Build a new Objective-C property reference expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2368 of file TreeTransform.h.

References clang::OK_ObjCProperty, and clang::VK_LValue.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildObjCSubscriptRefExpr ( SourceLocation  RB,
Expr Base,
Expr Key,
ObjCMethodDecl getterMethod,
ObjCMethodDecl setterMethod 
) [inline]

Definition at line 2246 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildOffsetOfExpr ( SourceLocation  OperatorLoc,
TypeSourceInfo Type,
Sema::OffsetOfComponent Components,
unsigned  NumComponents,
SourceLocation  RParenLoc 
) [inline]

Build a new builtin offsetof expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1443 of file TreeTransform.h.

template<typename Derived>
TemplateArgumentLoc clang::TreeTransform< Derived >::RebuildPackExpansion ( TemplateArgumentLoc  Pattern,
SourceLocation  EllipsisLoc,
llvm::Optional< unsigned >  NumExpansions 
) [inline]
template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildPackExpansion ( Expr Pattern,
SourceLocation  EllipsisLoc,
llvm::Optional< unsigned >  NumExpansions 
) [inline]

Build a new expression pack expansion.

By default, performs semantic analysis to build a new pack expansion for an expression. Subclasses may override this routine to provide different behavior.

Definition at line 2497 of file TreeTransform.h.

template<typename Derived>
QualType clang::TreeTransform< Derived >::RebuildPackExpansionType ( QualType  Pattern,
SourceRange  PatternRange,
SourceLocation  EllipsisLoc,
llvm::Optional< unsigned >  NumExpansions 
) [inline]

Build a new pack expansion type.

By default, builds a new PackExpansionType type from the given pattern. Subclasses may override this routine to provide different behavior.

Definition at line 937 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildParenExpr ( Expr SubExpr,
SourceLocation  LParen,
SourceLocation  RParen 
) [inline]

Build a new expression in parentheses.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1411 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildParenListExpr ( SourceLocation  LParenLoc,
MultiExprArg  SubExprs,
SourceLocation  RParenLoc 
) [inline]

Build a new expression list in parentheses.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1692 of file TreeTransform.h.

References clang::move().

template<typename Derived>
QualType clang::TreeTransform< Derived >::RebuildParenType ( QualType  InnerType) [inline]

Build a new parenthesized type.

By default, builds a new ParenType type from the inner type. Subclasses may override this routine to provide different behavior.

Definition at line 774 of file TreeTransform.h.

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildPointerType ( QualType  PointeeType,
SourceLocation  Sigil 
)

Build a new pointer type given its pointee type.

By default, performs semantic analysis when building the pointer type. Subclasses may override this routine to provide different behavior.

Definition at line 8871 of file TreeTransform.h.

template<typename Derived>
QualType clang::TreeTransform< Derived >::RebuildRecordType ( RecordDecl Record) [inline]

Build a new class/struct/union type.

Definition at line 723 of file TreeTransform.h.

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildReferenceType ( QualType  ReferentType,
bool  LValue,
SourceLocation  Sigil 
)

Build a new reference type given the type it references.

By default, performs semantic analysis when building the reference type. Subclasses may override this routine to provide different behavior.

Parameters:
LValuewhether the type was written with an lvalue sigil or an rvalue sigil.

Definition at line 8886 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildReturnStmt ( SourceLocation  ReturnLoc,
Expr Result 
) [inline]

Build a new return statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1145 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildSEHExceptStmt ( SourceLocation  Loc,
Expr FilterExpr,
Stmt Block 
) [inline]

Definition at line 1369 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildSEHFinallyStmt ( SourceLocation  Loc,
Stmt Block 
) [inline]

Definition at line 1375 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildSEHTryStmt ( bool  IsCXXTry,
SourceLocation  TryLoc,
Stmt TryBlock,
Stmt Handler 
) [inline]

Definition at line 1362 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildShuffleVectorExpr ( SourceLocation  BuiltinLoc,
MultiExprArg  SubExprs,
SourceLocation  RParenLoc 
) [inline]
template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildSizeOfPackExpr ( SourceLocation  OperatorLoc,
NamedDecl Pack,
SourceLocation  PackLoc,
SourceLocation  RParenLoc,
llvm::Optional< unsigned >  Length 
) [inline]

Build a new expression to compute the length of a parameter pack.

Definition at line 2214 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildStmtExpr ( SourceLocation  LParenLoc,
Stmt SubStmt,
SourceLocation  RParenLoc 
) [inline]

Build a new GNU statement expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1712 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildSwitchStmtBody ( SourceLocation  SwitchLoc,
Stmt Switch,
Stmt Body 
) [inline]

Attach the body to the switch statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1085 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildSwitchStmtStart ( SourceLocation  SwitchLoc,
Expr Cond,
VarDecl CondVar 
) [inline]

Start building a new switch statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1075 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildTemplateIdExpr ( const CXXScopeSpec SS,
SourceLocation  TemplateKWLoc,
LookupResult R,
bool  RequiresADL,
const TemplateArgumentListInfo TemplateArgs 
) [inline]

Build a new template-id expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2097 of file TreeTransform.h.

template<typename Derived >
TemplateName clang::TreeTransform< Derived >::RebuildTemplateName ( CXXScopeSpec SS,
bool  TemplateKW,
TemplateDecl Template 
)

Build a new template name given a nested name specifier, a flag indicating whether the "template" keyword was provided, and the template that the template name refers to.

By default, builds the new template name directly. Subclasses may override this routine to provide different behavior.

Definition at line 9097 of file TreeTransform.h.

References clang::CXXScopeSpec::getScopeRep().

template<typename Derived >
TemplateName clang::TreeTransform< Derived >::RebuildTemplateName ( CXXScopeSpec SS,
const IdentifierInfo Name,
SourceLocation  NameLoc,
QualType  ObjectType,
NamedDecl FirstQualifierInScope 
)

Build a new template name given a nested name specifier and the name that is referred to as a template.

By default, performs semantic analysis to determine whether the name can be resolved to a specific template, then builds the appropriate kind of template name. Subclasses may override this routine to provide different behavior.

Definition at line 9106 of file TreeTransform.h.

References clang::OpaquePtr< PtrTy >::get(), clang::OpaquePtr< QualType >::make(), and clang::UnqualifiedId::setIdentifier().

template<typename Derived >
TemplateName clang::TreeTransform< Derived >::RebuildTemplateName ( CXXScopeSpec SS,
OverloadedOperatorKind  Operator,
SourceLocation  NameLoc,
QualType  ObjectType 
)

Build a new template name given a nested name specifier and the overloaded operator name that is referred to as a template.

By default, performs semantic analysis to determine whether the name can be resolved to a specific template, then builds the appropriate kind of template name. Subclasses may override this routine to provide different behavior.

Definition at line 9125 of file TreeTransform.h.

References clang::OpaquePtr< QualType >::make(), and clang::UnqualifiedId::setOperatorFunctionId().

template<typename Derived>
TemplateName clang::TreeTransform< Derived >::RebuildTemplateName ( TemplateTemplateParmDecl Param,
const TemplateArgument ArgPack 
) [inline]

Build a new template name given a template template parameter pack and the.

By default, performs semantic analysis to determine whether the name can be resolved to a specific template, then builds the appropriate kind of template name. Subclasses may override this routine to provide different behavior.

Definition at line 993 of file TreeTransform.h.

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildTemplateSpecializationType ( TemplateName  Template,
SourceLocation  TemplateLoc,
TemplateArgumentListInfo Args 
)

Build a new template specialization type.

By default, performs semantic analysis when building the template specialization type. Subclasses may override this routine to provide different behavior.

Definition at line 9082 of file TreeTransform.h.

template<typename Derived>
QualType clang::TreeTransform< Derived >::RebuildTypedefType ( TypedefNameDecl Typedef) [inline]

Build a new typedef type.

Definition at line 718 of file TreeTransform.h.

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildTypeOfExprType ( Expr Underlying,
SourceLocation  Loc 
)

Build a new typeof(expr) type.

By default, performs semantic analysis when building the typeof type. Subclasses may override this routine to provide different behavior.

Definition at line 9058 of file TreeTransform.h.

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildTypeOfType ( QualType  Underlying)

Build a new typeof(type) type.

By default, builds a new TypeOfType with the given underlying type.

Definition at line 9064 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildTypeTrait ( TypeTrait  Trait,
SourceLocation  StartLoc,
ArrayRef< TypeSourceInfo * >  Args,
SourceLocation  RParenLoc 
) [inline]

Build a new type trait expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2043 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildUnaryExprOrTypeTrait ( TypeSourceInfo TInfo,
SourceLocation  OpLoc,
UnaryExprOrTypeTrait  ExprKind,
SourceRange  R 
) [inline]

Build a new sizeof, alignof or vec_step expression with a type argument.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1457 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildUnaryExprOrTypeTrait ( Expr SubExpr,
SourceLocation  OpLoc,
UnaryExprOrTypeTrait  ExprKind,
SourceRange  R 
) [inline]

Build a new sizeof, alignof or vec step expression with an expression argument.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1469 of file TreeTransform.h.

References clang::ExprError(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), and clang::move().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildUnaryOperator ( SourceLocation  OpLoc,
UnaryOperatorKind  Opc,
Expr SubExpr 
) [inline]

Build a new unary operator expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1433 of file TreeTransform.h.

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildUnaryTransformType ( QualType  BaseType,
UnaryTransformType::UTTKind  UKind,
SourceLocation  Loc 
)

Build a new unary transform type.

Definition at line 9075 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildUnaryTypeTrait ( UnaryTypeTrait  Trait,
SourceLocation  StartLoc,
TypeSourceInfo T,
SourceLocation  RParenLoc 
) [inline]

Build a new unary type trait expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2020 of file TreeTransform.h.

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildUnresolvedMemberExpr ( Expr BaseE,
QualType  BaseType,
SourceLocation  OperatorLoc,
bool  IsArrow,
NestedNameSpecifierLoc  QualifierLoc,
SourceLocation  TemplateKWLoc,
NamedDecl FirstQualifierInScope,
LookupResult R,
const TemplateArgumentListInfo TemplateArgs 
) [inline]

Build a new member reference expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 2187 of file TreeTransform.h.

References clang::CXXScopeSpec::Adopt().

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildUnresolvedUsingType ( Decl D)

Rebuild an unresolved typename type, given the decl that the UnresolvedUsingTypenameDecl was transformed to.

Definition at line 9033 of file TreeTransform.h.

References clang::Decl::isInvalidDecl(), clang::UsingDecl::isTypeName(), clang::UsingDecl::shadow_begin(), and clang::UsingDecl::shadow_end().

template<typename Derived>
ExprResult clang::TreeTransform< Derived >::RebuildVAArgExpr ( SourceLocation  BuiltinLoc,
Expr SubExpr,
TypeSourceInfo TInfo,
SourceLocation  RParenLoc 
) [inline]

Build a new va_arg expression.

By default, performs semantic analysis to build the new expression. Subclasses may override this routine to provide different behavior.

Definition at line 1680 of file TreeTransform.h.

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildVariableArrayType ( QualType  ElementType,
ArrayType::ArraySizeModifier  SizeMod,
Expr SizeExpr,
unsigned  IndexTypeQuals,
SourceRange  BracketsRange 
)

Build a new variable-length array type given the element type, size modifier, size expression, and index type qualifiers.

By default, performs semantic analysis when building the array type. Subclasses may override this routine to provide different behavior.

Definition at line 8961 of file TreeTransform.h.

References clang::TreeTransform< Derived >::RebuildArrayType().

template<typename Derived >
QualType clang::TreeTransform< Derived >::RebuildVectorType ( QualType  ElementType,
unsigned  NumElements,
VectorType::VectorKind  VecKind 
)

Build a new vector type given the element type and number of elements.

By default, performs semantic analysis when building the vector type. Subclasses may override this routine to provide different behavior.

Definition at line 8984 of file TreeTransform.h.

template<typename Derived>
StmtResult clang::TreeTransform< Derived >::RebuildWhileStmt ( SourceLocation  WhileLoc,
Sema::FullExprArg  Cond,
VarDecl CondVar,
Stmt Body 
) [inline]

Build a new while statement.

By default, performs semantic analysis to build the new statement. Subclasses may override this routine to provide different behavior.

Definition at line 1094 of file TreeTransform.h.

template<typename Derived>
void clang::TreeTransform< Derived >::RememberPartiallySubstitutedPack ( TemplateArgument  Arg) [inline]

"Remember" the partially-substituted pack template argument after performing an instantiation that must preserve the parameter pack use.

This routine is meant to be overridden by the template instantiator.

Definition at line 275 of file TreeTransform.h.

template<typename Derived>
void clang::TreeTransform< Derived >::setBase ( SourceLocation  Loc,
DeclarationName  Entity 
) [inline]

Sets the "base" location and entity when that information is known based on another transformation.

By default, the source location and entity are ignored. Subclasses can override this function to provide a customized implementation.

Definition at line 166 of file TreeTransform.h.

template<typename Derived>
void clang::TreeTransform< Derived >::transformAttrs ( Decl Old,
Decl New 
) [inline]

Transform the attributes associated with the given declaration and place them on the new declaration.

By default, this operation does nothing. Subclasses may override this behavior to transform attributes.

Definition at line 376 of file TreeTransform.h.

template<typename Derived >
StmtResult clang::TreeTransform< Derived >::TransformCompoundStmt ( CompoundStmt S,
bool  IsStmtExpr 
)
template<typename Derived >
ExprResult clang::TreeTransform< Derived >::TransformCXXNamedCastExpr ( CXXNamedCastExpr E)
template<typename Derived>
Decl* clang::TreeTransform< Derived >::TransformDecl ( SourceLocation  Loc,
Decl D 
) [inline]

Transform the given declaration, which is referenced from a type or expression.

By default, acts as the identity function on declarations, unless the transformer has had to transform the declaration itself. Subclasses may override this function to provide alternate behavior.

Definition at line 362 of file TreeTransform.h.

template<typename Derived >
DeclarationNameInfo clang::TreeTransform< Derived >::TransformDeclarationNameInfo ( const DeclarationNameInfo NameInfo)
template<typename Derived>
Decl* clang::TreeTransform< Derived >::TransformDefinition ( SourceLocation  Loc,
Decl D 
) [inline]

Transform the definition of the given declaration.

By default, invokes TransformDecl() to transform the declaration. Subclasses may override this function to provide alternate behavior.

Definition at line 393 of file TreeTransform.h.

template<typename Derived >
QualType clang::TreeTransform< Derived >::TransformDependentTemplateSpecializationType ( TypeLocBuilder TLB,
DependentTemplateSpecializationTypeLoc  TL,
TemplateName  Template,
CXXScopeSpec SS 
)

FIXME: Wrap this in an elaborated-type-specifier?

Definition at line 4737 of file TreeTransform.h.

References clang::TemplateName::getAsDependentTemplateName(), clang::DependentTemplateSpecializationTypeLoc::getElaboratedKeywordLoc(), clang::TypeWithKeyword::getKeyword(), clang::DependentTemplateSpecializationTypeLoc::getLAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::getNumArgs(), clang::DependentTemplateSpecializationTypeLoc::getRAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::getTemplateKeywordLoc(), clang::DependentTemplateSpecializationTypeLoc::getTemplateNameLoc(), clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getTypePtr(), clang::CXXScopeSpec::getWithLocInContext(), clang::QualType::isNull(), clang::TypeLocBuilder::push(), clang::TemplateSpecializationTypeLoc::setArgLocInfo(), clang::DependentTemplateSpecializationTypeLoc::setArgLocInfo(), clang::DependentTemplateSpecializationTypeLoc::setElaboratedKeywordLoc(), clang::TemplateArgumentListInfo::setLAngleLoc(), clang::TemplateSpecializationTypeLoc::setLAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::setLAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::setQualifierLoc(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::TemplateSpecializationTypeLoc::setRAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::setRAngleLoc(), clang::TemplateSpecializationTypeLoc::setTemplateKeywordLoc(), clang::DependentTemplateSpecializationTypeLoc::setTemplateKeywordLoc(), clang::TemplateSpecializationTypeLoc::setTemplateNameLoc(), clang::DependentTemplateSpecializationTypeLoc::setTemplateNameLoc(), and clang::TemplateArgumentListInfo::size().

template<typename Derived >
QualType clang::TreeTransform< Derived >::TransformDependentTemplateSpecializationType ( TypeLocBuilder TLB,
DependentTemplateSpecializationTypeLoc  TL,
NestedNameSpecifierLoc  QualifierLoc 
)

Definition at line 4960 of file TreeTransform.h.

References clang::DependentTemplateSpecializationTypeLoc::getElaboratedKeywordLoc(), clang::DependentTemplateSpecializationType::getIdentifier(), clang::TypeWithKeyword::getKeyword(), clang::DependentTemplateSpecializationTypeLoc::getLAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::getNumArgs(), clang::DependentTemplateSpecializationTypeLoc::getRAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::getTemplateKeywordLoc(), clang::DependentTemplateSpecializationTypeLoc::getTemplateNameLoc(), clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getTypePtr(), clang::QualType::isNull(), clang::TypeLocBuilder::push(), clang::TemplateSpecializationTypeLoc::setArgLocInfo(), clang::DependentTemplateSpecializationTypeLoc::setArgLocInfo(), clang::ElaboratedTypeLoc::setElaboratedKeywordLoc(), clang::DependentTemplateSpecializationTypeLoc::setElaboratedKeywordLoc(), clang::TemplateArgumentListInfo::setLAngleLoc(), clang::TemplateSpecializationTypeLoc::setLAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::setLAngleLoc(), clang::ElaboratedTypeLoc::setQualifierLoc(), clang::DependentTemplateSpecializationTypeLoc::setQualifierLoc(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::TemplateSpecializationTypeLoc::setRAngleLoc(), clang::DependentTemplateSpecializationTypeLoc::setRAngleLoc(), clang::TemplateSpecializationTypeLoc::setTemplateKeywordLoc(), clang::DependentTemplateSpecializationTypeLoc::setTemplateKeywordLoc(), clang::TemplateSpecializationTypeLoc::setTemplateNameLoc(), clang::DependentTemplateSpecializationTypeLoc::setTemplateNameLoc(), and clang::TemplateArgumentListInfo::size().

template<typename Derived>
void clang::TreeTransform< Derived >::transformedLocalDecl ( Decl Old,
Decl New 
) [inline]

Note that a local declaration has been transformed by this transformer.

Local declarations are typically transformed via a call to TransformDefinition. However, in some cases (e.g., lambda expressions), the transformer itself has to transform the declarations. This routine can be overridden by a subclass that keeps track of such mappings.

Definition at line 385 of file TreeTransform.h.

template<typename Derived >
ExprResult clang::TreeTransform< Derived >::TransformExpr ( Expr E)

Transform the given expression.

By default, this routine transforms an expression by delegating to the appropriate TransformXXXExpr function to build a new expression. Subclasses may override this function to transform expressions using some other mechanism.

Returns:
the transformed expression.

Definition at line 2567 of file TreeTransform.h.

References clang::Stmt::getStmtClass(), clang::Stmt::NoStmtClass, and clang::TreeTransform< Derived >::Owned().

template<typename Derived >
bool clang::TreeTransform< Derived >::TransformExprs ( Expr **  Inputs,
unsigned  NumInputs,
bool  IsCall,
SmallVectorImpl< Expr * > &  Outputs,
bool *  ArgChanged = 0 
)

Transform the given list of expressions.

This routine transforms a list of expressions by invoking TransformExpr() for each subexpression. However, it also provides support for variadic templates by expanding any pack expansions (if the derived class permits such expansion) along the way. When pack expansions are present, the number of outputs may not equal the number of inputs.

Parameters:
InputsThe set of expressions to be transformed.
NumInputsThe number of expressions in Inputs.
IsCallIf true, then this transform is being performed on function-call arguments, and any arguments that should be dropped, will be.
OutputsThe transformed input expressions will be added to this vector.
ArgChangedIf non-NULL, will be set true if any argument changed due to transformation.
Returns:
true if an error occurred, false otherwise.

Definition at line 2584 of file TreeTransform.h.

References clang::Expr::containsUnexpandedParameterPack(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Stmt::getSourceRange(), and clang::ActionResult< PtrTy, CompressInvalid >::isInvalid().

template<typename Derived>
NamedDecl* clang::TreeTransform< Derived >::TransformFirstQualifierInScope ( NamedDecl D,
SourceLocation  Loc 
) [inline]

Transform the given declaration, which was the first part of a nested-name-specifier in a member access expression.

This specific declaration transformation only applies to the first identifier in a nested-name-specifier of a member access expression, e.g., the T in x->T::member

By default, invokes TransformDecl() to transform the declaration. Subclasses may override this function to provide alternate behavior.

Definition at line 406 of file TreeTransform.h.

template<typename Derived >
QualType clang::TreeTransform< Derived >::TransformFunctionProtoType ( TypeLocBuilder TLB,
FunctionProtoTypeLoc  TL,
CXXRecordDecl ThisContext,
unsigned  ThisTypeQuals 
)
template<typename Derived >
ParmVarDecl * clang::TreeTransform< Derived >::TransformFunctionTypeParam ( ParmVarDecl OldParm,
int  indexAdjustment,
llvm::Optional< unsigned >  NumExpansions,
bool  ExpectParameterPack 
)
template<typename Derived >
bool clang::TreeTransform< Derived >::TransformFunctionTypeParams ( SourceLocation  Loc,
ParmVarDecl **  Params,
unsigned  NumParams,
const QualType ParamTypes,
SmallVectorImpl< QualType > &  PTypes,
SmallVectorImpl< ParmVarDecl * > *  PVars 
)

Transforms the parameters of a function type into the given vectors.

The result vectors should be kept in sync; null entries in the variables vector are acceptable.

Return true on error.

Definition at line 3981 of file TreeTransform.h.

References clang::PackExpansionTypeLoc::getEllipsisLoc(), clang::PackExpansionType::getNumExpansions(), clang::PackExpansionTypeLoc::getPatternLoc(), clang::ValueDecl::getType(), clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getTypePtr(), and clang::QualType::isNull().

template<typename Derived >
NestedNameSpecifierLoc clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc ( NestedNameSpecifierLoc  NNS,
QualType  ObjectType = QualType(),
NamedDecl FirstQualifierInScope = 0 
)
template<typename Derived >
QualType clang::TreeTransform< Derived >::TransformReferenceType ( TypeLocBuilder TLB,
ReferenceTypeLoc  TL 
)
template<typename Derived >
StmtResult clang::TreeTransform< Derived >::TransformSEHHandler ( Stmt Handler)

Definition at line 6048 of file TreeTransform.h.

template<typename Derived >
StmtResult clang::TreeTransform< Derived >::TransformStmt ( Stmt S)

Transform the given statement.

By default, this routine transforms a statement by delegating to the appropriate TransformXXXStmt function to transform a specific kind of statement or the TransformExpr() function to transform an expression. Subclasses may override this function to transform statements using some other mechanism.

Returns:
the transformed statement.

Definition at line 2534 of file TreeTransform.h.

References clang::Stmt::getStmtClass(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Stmt::NoStmtClass, clang::TreeTransform< Derived >::Owned(), clang::StmtError(), and clang::ActionResult< PtrTy, CompressInvalid >::take().

template<typename Derived >
bool clang::TreeTransform< Derived >::TransformTemplateArgument ( const TemplateArgumentLoc Input,
TemplateArgumentLoc Output 
)

Transform the given template argument.

By default, this operation transforms the type, expression, or declaration stored within the template argument and constructs a new template argument from the transformed result. Subclasses may override this function to provide alternate behavior.

Returns true if there was an error.

Definition at line 2968 of file TreeTransform.h.

References clang::CXXScopeSpec::Adopt(), Arg, clang::Sema::ConstantEvaluated, clang::TemplateArgument::Declaration, clang::TemplateArgument::Expression, clang::TemplateArgumentLoc::getArgument(), clang::TemplateArgument::getAsDecl(), clang::TemplateArgument::getAsExpr(), clang::TemplateArgument::getAsTemplate(), clang::TemplateArgument::getAsType(), clang::TemplateArgument::getKind(), clang::TemplateArgumentLoc::getLocation(), clang::TemplateArgumentLoc::getLocInfo(), clang::TemplateArgumentLoc::getSourceDeclExpression(), clang::TemplateArgumentLoc::getSourceExpression(), clang::TemplateArgumentLoc::getTemplateNameLoc(), clang::TemplateArgumentLoc::getTemplateQualifierLoc(), clang::TemplateArgumentLoc::getTypeSourceInfo(), Input, clang::TemplateArgument::Integral, clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::TemplateName::isNull(), clang::TemplateArgument::Null, NULL, clang::TemplateArgument::Pack, clang::TemplateArgument::pack_begin(), clang::TemplateArgument::pack_end(), clang::TemplateArgument::pack_size(), clang::ActionResult< PtrTy, CompressInvalid >::take(), clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, and clang::TemplateArgument::Type.

template<typename Derived>
bool clang::TreeTransform< Derived >::TransformTemplateArguments ( const TemplateArgumentLoc Inputs,
unsigned  NumInputs,
TemplateArgumentListInfo Outputs 
) [inline]

Transform the given set of template arguments.

By default, this operation transforms all of the template arguments in the input set using TransformTemplateArgument(), and appends the transformed arguments to the output list.

Note that this overload of TransformTemplateArguments() is merely a convenience function. Subclasses that wish to override this behavior should override the iterator-based member template version.

Parameters:
InputsThe set of template arguments to be transformed.
NumInputsThe number of template arguments in Inputs.
OutputsThe set of transformed template arguments output by this routine.

Returns true if an error occurred.

Definition at line 485 of file TreeTransform.h.

template<typename Derived >
template<typename InputIterator >
bool clang::TreeTransform< Derived >::TransformTemplateArguments ( InputIterator  First,
InputIterator  Last,
TemplateArgumentListInfo Outputs 
)

Transform the given set of template arguments.

By default, this operation transforms all of the template arguments in the input set using TransformTemplateArgument(), and appends the transformed arguments to the output list.

Parameters:
FirstAn iterator to the first template argument.
LastAn iterator one step past the last template argument.
OutputsThe set of transformed template arguments output by this routine.

Returns true if an error occurred.

Definition at line 3146 of file TreeTransform.h.

References clang::TemplateArgumentListInfo::addArgument(), clang::TemplateArgument::containsUnexpandedParameterPack(), clang::TemplateArgumentLoc::getArgument(), clang::TemplateArgument::getKind(), clang::TemplateArgumentLoc::getPackExpansionPattern(), clang::TemplateArgumentLoc::getSourceRange(), clang::TemplateArgument::isNull(), clang::TemplateArgument::isPackExpansion(), clang::LangAS::Last, clang::TemplateArgument::Pack, clang::TemplateArgument::pack_begin(), and clang::TemplateArgument::pack_end().

template<typename Derived >
TemplateName clang::TreeTransform< Derived >::TransformTemplateName ( CXXScopeSpec SS,
TemplateName  Name,
SourceLocation  NameLoc,
QualType  ObjectType = QualType(),
NamedDecl FirstQualifierInScope = 0 
)

Transform the given template name.

Parameters:
SSThe nested-name-specifier that qualifies the template name. This nested-name-specifier must already have been transformed.
NameThe template name to transform.
NameLocThe source location of the template name.
ObjectTypeIf we're translating a template name within a member access expression, this is the type of the object whose member template is being referenced.
FirstQualifierInScopeIf the first part of a nested-name-specifier also refers to a name within the current (lexical) scope, this is the declaration it refers to.

By default, transforms the template name by transforming the declarations and nested-name-specifiers that occur within the template name. Subclasses may override this function to provide alternate behavior.

Definition at line 2836 of file TreeTransform.h.

References clang::TemplateName::getAsDependentTemplateName(), clang::TemplateName::getAsQualifiedTemplateName(), clang::TemplateName::getAsSubstTemplateTemplateParmPack(), clang::TemplateName::getAsTemplateDecl(), clang::CXXScopeSpec::getScopeRep(), and clang::QualType::isNull().

template<typename Derived >
QualType clang::TreeTransform< Derived >::TransformTemplateSpecializationType ( TypeLocBuilder TLB,
TemplateSpecializationTypeLoc  TL,
TemplateName  Template 
)
template<typename Derived >
QualType clang::TreeTransform< Derived >::TransformType ( QualType  T)

Transforms the given type into another type.

By default, this routine transforms a type by creating a TypeSourceInfo for it and delegating to the appropriate function. This is expensive, but we don't mind, because this method is deprecated anyway; all users should be switched to storing TypeSourceInfos.

Returns:
the transformed type.

Definition at line 3269 of file TreeTransform.h.

References clang::TypeSourceInfo::getType().

template<typename Derived >
TypeSourceInfo * clang::TreeTransform< Derived >::TransformType ( TypeSourceInfo DI)

Transforms the given type-with-location into a new type-with-location.

By default, this routine transforms a type by delegating to the appropriate TransformXXXType to build a new type. Subclasses may override this function (to take over all type transformations) or some set of the TransformXXXType functions to alter the transformation.

Definition at line 3287 of file TreeTransform.h.

References clang::TypeLoc::getBeginLoc(), clang::TypeLoc::getFullDataSize(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::QualType::isNull(), and clang::TypeLocBuilder::reserve().

template<typename Derived >
QualType clang::TreeTransform< Derived >::TransformType ( TypeLocBuilder TLB,
TypeLoc  TL 
)

Transform the given type-with-location into a new type, collecting location information in the given builder as necessary.

Definition at line 3308 of file TreeTransform.h.

References clang::TypeLoc::getTypeLocClass().

template<typename Derived>
bool clang::TreeTransform< Derived >::TryExpandParameterPacks ( SourceLocation  EllipsisLoc,
SourceRange  PatternRange,
llvm::ArrayRef< UnexpandedParameterPack Unexpanded,
bool &  ShouldExpand,
bool &  RetainExpansion,
llvm::Optional< unsigned > &  NumExpansions 
) [inline]

Determine whether we should expand a pack expansion with the given set of parameter packs into separate arguments by repeatedly transforming the pattern.

By default, the transformer never tries to expand pack expansions. Subclasses can override this routine to provide different behavior.

Parameters:
EllipsisLocThe location of the ellipsis that identifies the pack expansion.
PatternRangeThe source range that covers the entire pattern of the pack expansion.
UnexpandedThe set of unexpanded parameter packs within the pattern.
NumUnexpandedThe number of unexpanded parameter packs in Unexpanded.
ShouldExpandWill be set to true if the transformer should expand the corresponding pack expansions into separate arguments. When set, NumExpansions must also be set.
RetainExpansionWhether the caller should add an unexpanded pack expansion after all of the expanded arguments. This is used when extending explicitly-specified template argument packs per C++0x [temp.arg.explicit]p9.
NumExpansionsThe number of separate arguments that will be in the expanded form of the corresponding pack expansion. This is both an input and an output parameter, which can be set by the caller if the number of expansions is known a priori (e.g., due to a prior substitution) and will be set by the callee when the number of expansions is known. The callee must set this value when ShouldExpand is true; it may set this value in other cases.
Returns:
true if an error occurred (e.g., because the parameter packs are to be instantiated with arguments of different lengths), false otherwise. If false, ShouldExpand (and possibly NumExpansions) must be set.

Definition at line 251 of file TreeTransform.h.


Member Data Documentation

template<typename Derived>
Sema& clang::TreeTransform< Derived >::SemaRef [protected]

Definition at line 113 of file TreeTransform.h.

template<typename Derived>
llvm::DenseMap<Decl *, Decl *> clang::TreeTransform< Derived >::TransformedLocalDecls [protected]

The set of local declarations that have been transformed, for cases where we are forced to build new declarations within the transformer rather than in the subclass (e.g., lambda closure types).

Definition at line 118 of file TreeTransform.h.


The documentation for this class was generated from the following file: