diff options
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaCXXCast.cpp | 6 | ||||
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 10 | ||||
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 4 | ||||
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 10 | ||||
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 60 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 146 | ||||
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 78 | ||||
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 28 | ||||
-rw-r--r-- | lib/Sema/SemaInit.cpp | 30 | ||||
-rw-r--r-- | lib/Sema/SemaObjCProperty.cpp | 6 | ||||
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 40 | ||||
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 72 | ||||
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 24 | ||||
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 24 | ||||
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 18 | ||||
-rw-r--r-- | lib/Sema/TreeTransform.h | 616 |
16 files changed, 584 insertions, 588 deletions
diff --git a/lib/Sema/SemaCXXCast.cpp b/lib/Sema/SemaCXXCast.cpp index 72b58f4e43..56531c7f70 100644 --- a/lib/Sema/SemaCXXCast.cpp +++ b/lib/Sema/SemaCXXCast.cpp @@ -116,7 +116,7 @@ static TryCastResult TryReinterpretCast(Sema &Self, Expr *SrcExpr, CastExpr::CastKind &Kind); /// ActOnCXXNamedCast - Parse {dynamic,static,reinterpret,const}_cast's. -Action::OwningExprResult +ExprResult Sema::ActOnCXXNamedCast(SourceLocation OpLoc, tok::TokenKind Kind, SourceLocation LAngleBracketLoc, ParsedType Ty, SourceLocation RAngleBracketLoc, @@ -133,7 +133,7 @@ Sema::ActOnCXXNamedCast(SourceLocation OpLoc, tok::TokenKind Kind, SourceRange(LParenLoc, RParenLoc)); } -Action::OwningExprResult +ExprResult Sema::BuildCXXNamedCast(SourceLocation OpLoc, tok::TokenKind Kind, TypeSourceInfo *DestTInfo, ExprArg Ex, SourceRange AngleBrackets, SourceRange Parens) { @@ -964,7 +964,7 @@ TryStaticImplicitCast(Sema &Self, Expr *&SrcExpr, QualType DestType, (CStyle || !DestType->isReferenceType())) return TC_NotApplicable; - Sema::OwningExprResult Result + ExprResult Result = InitSeq.Perform(Self, Entity, InitKind, Action::MultiExprArg(Self, &SrcExpr, 1)); if (Result.isInvalid()) { diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 4e8c82fd7e..6148faaf90 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -121,9 +121,9 @@ bool Sema::CheckablePrintfAttr(const FormatAttr *Format, CallExpr *TheCall) { return false; } -Action::OwningExprResult +ExprResult Sema::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { - OwningExprResult TheCallResult(Owned(TheCall)); + ExprResult TheCallResult(Owned(TheCall)); switch (BuiltinID) { case Builtin::BI__builtin___CFStringMakeConstantString: @@ -390,8 +390,8 @@ bool Sema::CheckBlockCall(NamedDecl *NDecl, CallExpr *TheCall) { /// /// This function goes through and does final semantic checking for these /// builtins, -Sema::OwningExprResult -Sema::SemaBuiltinAtomicOverloaded(OwningExprResult TheCallResult) { +ExprResult +Sema::SemaBuiltinAtomicOverloaded(ExprResult TheCallResult) { CallExpr *TheCall = (CallExpr *)TheCallResult.get(); DeclRefExpr *DRE =cast<DeclRefExpr>(TheCall->getCallee()->IgnoreParenCasts()); FunctionDecl *FDecl = cast<FunctionDecl>(DRE->getDecl()); @@ -746,7 +746,7 @@ bool Sema::SemaBuiltinFPClassification(CallExpr *TheCall, unsigned NumArgs) { /// SemaBuiltinShuffleVector - Handle __builtin_shufflevector. // This is declared to take (...), so we have to check everything. -Action::OwningExprResult Sema::SemaBuiltinShuffleVector(CallExpr *TheCall) { +ExprResult Sema::SemaBuiltinShuffleVector(CallExpr *TheCall) { if (TheCall->getNumArgs() < 2) return ExprError(Diag(TheCall->getLocEnd(), diag::err_typecheck_call_too_few_args_at_least) diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index fba670e595..649f70b7b4 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -3707,7 +3707,7 @@ void Sema::CodeCompleteObjCSuperMessage(Scope *S, SourceLocation SuperLoc, // an instance method. QualType SuperTy = Context.getObjCInterfaceType(CDecl); SuperTy = Context.getObjCObjectPointerType(SuperTy); - OwningExprResult Super + ExprResult Super = Owned(new (Context) ObjCSuperExpr(SuperLoc, SuperTy)); return CodeCompleteObjCInstanceMessage(S, (Expr *)Super.get(), SelIdents, NumSelIdents); @@ -3733,7 +3733,7 @@ void Sema::CodeCompleteObjCSuperMessage(Scope *S, SourceLocation SuperLoc, CXXScopeSpec SS; UnqualifiedId id; id.setIdentifier(Super, SuperLoc); - OwningExprResult SuperExpr = ActOnIdExpression(S, SS, id, false, false); + ExprResult SuperExpr = ActOnIdExpression(S, SS, id, false, false); return CodeCompleteObjCInstanceMessage(S, (Expr *)SuperExpr.get(), SelIdents, NumSelIdents); } diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 30cfb18706..944993b2c9 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -2147,7 +2147,7 @@ static bool RebuildDeclaratorInCurrentInstantiation(Sema &S, Declarator &D, case DeclSpec::TST_typeofExpr: { Expr *E = DS.getRepAsExpr(); - OwningExprResult Result = S.RebuildExprInCurrentInstantiation(E); + ExprResult Result = S.RebuildExprInCurrentInstantiation(E); if (Result.isInvalid()) return true; DS.UpdateExprRep(Result.get()); break; @@ -4156,7 +4156,7 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { VDecl->setInvalidDecl(); } else if (!VDecl->isInvalidDecl()) { InitializationSequence InitSeq(*this, Entity, Kind, &Init, 1); - OwningExprResult Result = InitSeq.Perform(*this, Entity, Kind, + ExprResult Result = InitSeq.Perform(*this, Entity, Kind, MultiExprArg(*this, &Init, 1), &DclT); if (Result.isInvalid()) { @@ -4227,7 +4227,7 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { Diag(VDecl->getLocation(), diag::warn_extern_init); if (!VDecl->isInvalidDecl()) { InitializationSequence InitSeq(*this, Entity, Kind, &Init, 1); - OwningExprResult Result = InitSeq.Perform(*this, Entity, Kind, + ExprResult Result = InitSeq.Perform(*this, Entity, Kind, MultiExprArg(*this, &Init, 1), &DclT); if (Result.isInvalid()) { @@ -4465,8 +4465,8 @@ void Sema::ActOnUninitializedDecl(Decl *RealDecl, = InitializationKind::CreateDefault(Var->getLocation()); InitializationSequence InitSeq(*this, Entity, Kind, 0, 0); - OwningExprResult Init = InitSeq.Perform(*this, Entity, Kind, - MultiExprArg(*this, 0, 0)); + ExprResult Init = InitSeq.Perform(*this, Entity, Kind, + MultiExprArg(*this, 0, 0)); if (Init.isInvalid()) Var->setInvalidDecl(); else if (Init.get()) { diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index f30cbc53af..ee407a8859 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -126,7 +126,7 @@ Sema::SetParamDefaultArgument(ParmVarDecl *Param, Expr *Arg, InitializationKind Kind = InitializationKind::CreateCopy(Param->getLocation(), EqualLoc); InitializationSequence InitSeq(*this, Entity, Kind, &Arg, 1); - OwningExprResult Result = InitSeq.Perform(*this, Entity, Kind, + ExprResult Result = InitSeq.Perform(*this, Entity, Kind, MultiExprArg(*this, &Arg, 1)); if (Result.isInvalid()) return true; @@ -1317,7 +1317,7 @@ Sema::BuildMemberInitializer(FieldDecl *Member, Expr **Args, InitializationSequence InitSeq(*this, MemberEntity, Kind, Args, NumArgs); - OwningExprResult MemberInit = + ExprResult MemberInit = InitSeq.Perform(*this, MemberEntity, Kind, MultiExprArg(*this, Args, NumArgs), 0); if (MemberInit.isInvalid()) @@ -1409,7 +1409,7 @@ Sema::BuildBaseInitializer(QualType BaseType, TypeSourceInfo *BaseTInfo, if (Dependent) { // Can't check initialization for a base of dependent type or when // any of the arguments are type-dependent expressions. - OwningExprResult BaseInit + ExprResult BaseInit = Owned(new (Context) ParenListExpr(Context, LParenLoc, Args, NumArgs, RParenLoc)); @@ -1448,7 +1448,7 @@ Sema::BuildBaseInitializer(QualType BaseType, TypeSourceInfo *BaseTInfo, InitializationSequence InitSeq(*this, BaseEntity, Kind, Args, NumArgs); - OwningExprResult BaseInit = + ExprResult BaseInit = InitSeq.Perform(*this, BaseEntity, Kind, MultiExprArg(*this, Args, NumArgs), 0); if (BaseInit.isInvalid()) @@ -1473,7 +1473,7 @@ Sema::BuildBaseInitializer(QualType BaseType, TypeSourceInfo *BaseTInfo, for (unsigned I = 0; I != NumArgs; ++I) Args[I]->Retain(); - OwningExprResult Init + ExprResult Init = Owned(new (Context) ParenListExpr(Context, LParenLoc, Args, NumArgs, RParenLoc)); return new (Context) CXXBaseOrMemberInitializer(Context, BaseTInfo, @@ -1508,7 +1508,7 @@ BuildImplicitBaseInitializer(Sema &SemaRef, CXXConstructorDecl *Constructor, = InitializedEntity::InitializeBase(SemaRef.Context, BaseSpec, IsInheritedVirtualBase); - Sema::OwningExprResult BaseInit; + ExprResult BaseInit; switch (ImplicitInitKind) { case IIK_Default: { @@ -1597,7 +1597,7 @@ BuildImplicitMemberInitializer(Sema &SemaRef, CXXConstructorDecl *Constructor, Sema::LookupMemberName); MemberLookup.addDecl(Field, AS_public); MemberLookup.resolveKind(); - Sema::OwningExprResult CopyCtorArg + ExprResult CopyCtorArg = SemaRef.BuildMemberReferenceExpr(MemberExprBase, ParamType, Loc, /*IsArrow=*/false, @@ -1633,7 +1633,7 @@ BuildImplicitMemberInitializer(Sema &SemaRef, CXXConstructorDecl *Constructor, IndexVariables.push_back(IterationVar); // Create a reference to the iteration variable. - Sema::OwningExprResult IterationVarRef + ExprResult IterationVarRef = SemaRef.BuildDeclRefExpr(IterationVar, SizeType, Loc); assert(!IterationVarRef.isInvalid() && "Reference to invented variable cannot fail!"); @@ -1668,7 +1668,7 @@ BuildImplicitMemberInitializer(Sema &SemaRef, CXXConstructorDecl *Constructor, InitializationSequence InitSeq(SemaRef, Entities.back(), InitKind, &CopyCtorArgE, 1); - Sema::OwningExprResult MemberInit + ExprResult MemberInit = InitSeq.Perform(SemaRef, Entities.back(), InitKind, Sema::MultiExprArg(SemaRef, &CopyCtorArgE, 1)); MemberInit = SemaRef.MaybeCreateCXXExprWithTemporaries(MemberInit.get()); @@ -1694,7 +1694,7 @@ BuildImplicitMemberInitializer(Sema &SemaRef, CXXConstructorDecl *Constructor, InitializationKind::CreateDefault(Loc); InitializationSequence InitSeq(SemaRef, InitEntity, InitKind, 0, 0); - Sema::OwningExprResult MemberInit = + ExprResult MemberInit = InitSeq.Perform(SemaRef, InitEntity, InitKind, Sema::MultiExprArg(SemaRef, 0, 0)); if (MemberInit.isInvalid()) @@ -4540,7 +4540,7 @@ void Sema::DefineImplicitDestructor(SourceLocation CurrentLocation, /// \param Depth Internal parameter recording the depth of the recursion. /// /// \returns A statement or a loop that copies the expressions. -static OwningStmtResult +static StmtResult BuildSingleCopyAssign(Sema &S, SourceLocation Loc, QualType T, Expr *To, Expr *From, bool CopyingBaseSubobject, unsigned Depth = 0) { @@ -4600,7 +4600,7 @@ BuildSingleCopyAssign(Sema &S, SourceLocation Loc, QualType T, T.getTypePtr())); // Create the reference to operator=. - OwningExprResult OpEqualRef + ExprResult OpEqualRef = S.BuildMemberReferenceExpr(To, T, Loc, /*isArrow=*/false, SS, /*FirstQualifierInScope=*/0, OpLookup, /*TemplateArgs=*/0, @@ -4610,7 +4610,7 @@ BuildSingleCopyAssign(Sema &S, SourceLocation Loc, QualType T, // Build the call to the assignment operator. - OwningExprResult Call = S.BuildCallToMemberFunction(/*Scope=*/0, + ExprResult Call = S.BuildCallToMemberFunction(/*Scope=*/0, OpEqualRef.takeAs<Expr>(), Loc, &From, 1, 0, Loc); if (Call.isInvalid()) @@ -4623,7 +4623,7 @@ BuildSingleCopyAssign(Sema &S, SourceLocation Loc, QualType T, // operator is used. const ConstantArrayType *ArrayTy = S.Context.getAsConstantArrayType(T); if (!ArrayTy) { - OwningExprResult Assignment = S.CreateBuiltinBinOp(Loc, + ExprResult Assignment = S.CreateBuiltinBinOp(Loc, BinaryOperator::Assign, To, From); @@ -4690,7 +4690,7 @@ BuildSingleCopyAssign(Sema &S, SourceLocation Loc, QualType T, IterationVarRef, Loc)); // Build the copy for an individual element of the array. - OwningStmtResult Copy = BuildSingleCopyAssign(S, Loc, + StmtResult Copy = BuildSingleCopyAssign(S, Loc, ArrayTy->getElementType(), To, From, CopyingBaseSubobject, Depth+1); @@ -4970,7 +4970,7 @@ void Sema::DefineImplicitCopyAssignment(SourceLocation CurrentLocation, ImplicitCastExpr::LValue, &BasePath); // Dereference "this". - OwningExprResult To = CreateBuiltinUnaryOp(Loc, UnaryOperator::Deref, This); + ExprResult To = CreateBuiltinUnaryOp(Loc, UnaryOperator::Deref, This); // Implicitly cast "this" to the appropriately-qualified base type. Expr *ToE = To.takeAs<Expr>(); @@ -4982,7 +4982,7 @@ void Sema::DefineImplicitCopyAssignment(SourceLocation CurrentLocation, To = Owned(ToE); // Build the copy. - OwningStmtResult Copy = BuildSingleCopyAssign(*this, Loc, BaseType, + StmtResult Copy = BuildSingleCopyAssign(*this, Loc, BaseType, To.get(), From, /*CopyingBaseSubobject=*/true); if (Copy.isInvalid()) { @@ -5041,10 +5041,10 @@ void Sema::DefineImplicitCopyAssignment(SourceLocation CurrentLocation, LookupMemberName); MemberLookup.addDecl(*Field); MemberLookup.resolveKind(); - OwningExprResult From = BuildMemberReferenceExpr(OtherRef, OtherRefType, + ExprResult From = BuildMemberReferenceExpr(OtherRef, OtherRefType, Loc, /*IsArrow=*/false, SS, 0, MemberLookup, 0); - OwningExprResult To = BuildMemberReferenceExpr(This, This->getType(), + ExprResult To = BuildMemberReferenceExpr(This, This->getType(), Loc, /*IsArrow=*/true, SS, 0, MemberLookup, 0); assert(!From.isInvalid() && "Implicit field reference cannot fail"); @@ -5128,7 +5128,7 @@ void Sema::DefineImplicitCopyAssignment(SourceLocation CurrentLocation, llvm::SmallVector<SourceLocation, 4> Commas; // FIXME: Silly Commas.push_back(Loc); Commas.push_back(Loc); - OwningExprResult Call = ExprError(); + ExprResult Call = ExprError(); if (NeedsCollectableMemCpy) Call = ActOnCallExpr(/*Scope=*/0, CollectableMemCpyRef, @@ -5146,7 +5146,7 @@ void Sema::DefineImplicitCopyAssignment(SourceLocation CurrentLocation, } // Build the copy of this field. - OwningStmtResult Copy = BuildSingleCopyAssign(*this, Loc, FieldType, + StmtResult Copy = BuildSingleCopyAssign(*this, Loc, FieldType, To.get(), From.get(), /*CopyingBaseSubobject=*/false); if (Copy.isInvalid()) { @@ -5162,10 +5162,10 @@ void Sema::DefineImplicitCopyAssignment(SourceLocation CurrentLocation, if (!Invalid) { // Add a "return *this;" - OwningExprResult ThisObj = CreateBuiltinUnaryOp(Loc, UnaryOperator::Deref, + ExprResult ThisObj = CreateBuiltinUnaryOp(Loc, UnaryOperator::Deref, This); - OwningStmtResult Return = ActOnReturnStmt(Loc, ThisObj.get()); + StmtResult Return = ActOnReturnStmt(Loc, ThisObj.get()); if (Return.isInvalid()) Invalid = true; else { @@ -5184,7 +5184,7 @@ void Sema::DefineImplicitCopyAssignment(SourceLocation CurrentLocation, return; } - OwningStmtResult Body = ActOnCompoundStmt(Loc, Loc, move_arg(Statements), + StmtResult Body = ActOnCompoundStmt(Loc, Loc, move_arg(Statements), /*isStmtExpr=*/false); assert(!Body.isInvalid() && "Compound statement creation cannot fail"); CopyAssignOperator->setBody(Body.takeAs<Stmt>()); @@ -5393,7 +5393,7 @@ void Sema::DefineImplicitCopyConstructor(SourceLocation CurrentLocation, CopyConstructor->setUsed(); } -Sema::OwningExprResult +ExprResult Sema::BuildCXXConstructExpr(SourceLocation ConstructLoc, QualType DeclInitType, CXXConstructorDecl *Constructor, MultiExprArg ExprArgs, @@ -5426,7 +5426,7 @@ Sema::BuildCXXConstructExpr(SourceLocation ConstructLoc, QualType DeclInitType, /// BuildCXXConstructExpr - Creates a complete call to a constructor, /// including handling of its default argument expressions. -Sema::OwningExprResult +ExprResult Sema::BuildCXXConstructExpr(SourceLocation ConstructLoc, QualType DeclInitType, CXXConstructorDecl *Constructor, bool Elidable, MultiExprArg ExprArgs, @@ -5444,7 +5444,7 @@ Sema::BuildCXXConstructExpr(SourceLocation ConstructLoc, QualType DeclInitType, bool Sema::InitializeVarWithConstructor(VarDecl *VD, CXXConstructorDecl *Constructor, MultiExprArg Exprs) { - OwningExprResult TempResult = + ExprResult TempResult = BuildCXXConstructExpr(VD->getLocation(), VD->getType(), Constructor, move(Exprs)); if (TempResult.isInvalid()) @@ -5579,7 +5579,7 @@ void Sema::AddCXXDirectInitializerToDecl(Decl *RealDecl, InitializationSequence InitSeq(*this, Entity, Kind, Exprs.get(), Exprs.size()); - OwningExprResult Result = InitSeq.Perform(*this, Entity, Kind, move(Exprs)); + ExprResult Result = InitSeq.Perform(*this, Entity, Kind, move(Exprs)); if (Result.isInvalid()) { VDecl->setInvalidDecl(); return; @@ -6146,7 +6146,7 @@ VarDecl *Sema::BuildExceptionDeclaration(Scope *S, QualType ExDeclType, InitializationKind Kind = InitializationKind::CreateCopy(Loc, SourceLocation()); InitializationSequence InitSeq(*this, Entity, Kind, &ExDeclRef, 1); - OwningExprResult Result = InitSeq.Perform(*this, Entity, Kind, + ExprResult Result = InitSeq.Perform(*this, Entity, Kind, MultiExprArg(*this, &ExDeclRef, 1)); if (Result.isInvalid()) Invalid = true; @@ -6934,7 +6934,7 @@ void Sema::SetIvarInitializers(ObjCImplementationDecl *ObjCImplementation) { InitializationKind::CreateDefault(ObjCImplementation->getLocation()); InitializationSequence InitSeq(*this, InitEntity, InitKind, 0, 0); - Sema::OwningExprResult MemberInit = + ExprResult MemberInit = InitSeq.Perform(*this, InitEntity, InitKind, Sema::MultiExprArg(*this, 0, 0)); MemberInit = MaybeCreateCXXExprWithTemporaries(MemberInit.get()); diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index b1e2b7f049..1aede96a25 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -371,7 +371,7 @@ QualType Sema::UsualArithmeticConversions(Expr *&lhsExpr, Expr *&rhsExpr, /// multiple tokens. However, the common case is that StringToks points to one /// string. /// -Action::OwningExprResult +ExprResult Sema::ActOnStringLiteral(const Token *StringToks, unsigned NumStringToks) { assert(NumStringToks && "Must have at least one string!"); @@ -459,7 +459,7 @@ static bool ShouldSnapshotBlockValueReference(Sema &S, BlockScopeInfo *CurBlock, } -Sema::OwningExprResult +ExprResult Sema::BuildDeclRefExpr(ValueDecl *D, QualType Ty, SourceLocation Loc, const CXXScopeSpec *SS) { DeclarationNameInfo NameInfo(D->getDeclName(), Loc); @@ -467,7 +467,7 @@ Sema::BuildDeclRefExpr(ValueDecl *D, QualType Ty, SourceLocation Loc, } /// BuildDeclRefExpr - Build a DeclRefExpr. -Sema::OwningExprResult +ExprResult Sema::BuildDeclRefExpr(ValueDecl *D, QualType Ty, const DeclarationNameInfo &NameInfo, const CXXScopeSpec *SS) { @@ -543,7 +543,7 @@ VarDecl *Sema::BuildAnonymousStructUnionMemberPath(FieldDecl *Field, return BaseObject; } -Sema::OwningExprResult +ExprResult Sema::BuildAnonymousStructUnionMemberReference(SourceLocation Loc, FieldDecl *Field, Expr *BaseObjectExpr, @@ -1061,7 +1061,7 @@ static ObjCIvarDecl *SynthesizeProvisionalIvar(Sema &SemaRef, return 0; } -Sema::OwningExprResult Sema::ActOnIdExpression(Scope *S, +ExprResult Sema::ActOnIdExpression(Scope *S, CXXScopeSpec &SS, UnqualifiedId &Id, bool HasTrailingLParen, @@ -1134,7 +1134,7 @@ Sema::OwningExprResult Sema::ActOnIdExpression(Scope *S, // If this reference is in an Objective-C method, then we need to do // some special Objective-C lookup, too. if (IvarLookupFollowUp) { - OwningExprResult E(LookupInObjCMethod(R, S, II, true)); + ExprResult E(LookupInObjCMethod(R, S, II, true)); if (E.isInvalid()) return ExprError(); @@ -1180,7 +1180,7 @@ Sema::OwningExprResult Sema::ActOnIdExpression(Scope *S, // reference the ivar. if (ObjCIvarDecl *Ivar = R.getAsSingle<ObjCIvarDecl>()) { R.clear(); - OwningExprResult E(LookupInObjCMethod(R, S, Ivar->getIdentifier())); + ExprResult E(LookupInObjCMethod(R, S, Ivar->getIdentifier())); assert(E.isInvalid() || E.get()); return move(E); } @@ -1241,7 +1241,7 @@ Sema::OwningExprResult Sema::ActOnIdExpression(Scope *S, } /// Builds an expression which might be an implicit member expression. -Sema::OwningExprResult +ExprResult Sema::BuildPossibleImplicitMemberExpr(const CXXScopeSpec &SS, LookupResult &R, const TemplateArgumentListInfo *TemplateArgs) { @@ -1280,7 +1280,7 @@ Sema::BuildPossibleImplicitMemberExpr(const CXXScopeSpec &SS, /// declaration name, generally during template instantiation. /// There's a large number of things which don't need to be done along /// this path. -Sema::OwningExprResult +ExprResult Sema::BuildQualifiedDeclarationNameExpr(CXXScopeSpec &SS, const DeclarationNameInfo &NameInfo) { DeclContext *DC; @@ -1313,7 +1313,7 @@ Sema::BuildQualifiedDeclarationNameExpr(CXXScopeSpec &SS, /// actually quite a lot of extra work involved. /// /// Returns a null sentinel to indicate trivial success. -Sema::OwningExprResult +ExprResult Sema::LookupInObjCMethod(LookupResult &Lookup, Scope *S, IdentifierInfo *II, bool AllowBuiltinCreation) { SourceLocation Loc = Lookup.getNameLoc(); @@ -1368,7 +1368,7 @@ Sema::LookupInObjCMethod(LookupResult &Lookup, Scope *S, UnqualifiedId SelfName; SelfName.setIdentifier(&II, SourceLocation()); CXXScopeSpec SelfScopeSpec; - OwningExprResult SelfExpr = ActOnIdExpression(S, SelfScopeSpec, + ExprResult SelfExpr = ActOnIdExpression(S, SelfScopeSpec, SelfName, false, false); MarkDeclarationReferenced(Loc, IV); return Owned(new (Context) @@ -1593,7 +1593,7 @@ static MemberExpr *BuildMemberExpr(ASTContext &C, Expr *Base, bool isArrow, /// is known to be an instance method, and the given unqualified lookup /// set is known to contain only instance members, at least one of which /// is from an appropriate type. -Sema::OwningExprResult +ExprResult Sema::BuildImplicitMemberExpr(const CXXScopeSpec &SS, LookupResult &R, const TemplateArgumentListInfo *TemplateArgs, @@ -1709,7 +1709,7 @@ static bool CheckDeclInExpr(Sema &S, SourceLocation Loc, NamedDecl *D) { return false; } -Sema::OwningExprResult +ExprResult Sema::BuildDeclarationNameExpr(const CXXScopeSpec &SS, LookupResult &R, bool NeedsADL) { @@ -1745,7 +1745,7 @@ Sema::BuildDeclarationNameExpr(const CXXScopeSpec &SS, /// \brief Complete semantic analysis for a reference to the given declaration. -Sema::OwningExprResult +ExprResult Sema::BuildDeclarationNameExpr(const CXXScopeSpec &SS, const DeclarationNameInfo &NameInfo, NamedDecl *D) { @@ -1828,7 +1828,7 @@ Sema::BuildDeclarationNameExpr(const CXXScopeSpec &SS, DeclRefExpr(const_cast<ValueDecl*>(BDRE->getDecl()), T, SourceLocation()); - OwningExprResult Res = PerformCopyInitialization( + ExprResult Res = PerformCopyInitialization( InitializedEntity::InitializeBlock(VD->getLocation(), T, false), SourceLocation(), @@ -1849,7 +1849,7 @@ Sema::BuildDeclarationNameExpr(const CXXScopeSpec &SS, NameInfo, &SS); } -Sema::OwningExprResult Sema::ActOnPredefinedExpr(SourceLocation Loc, +ExprResult Sema::ActOnPredefinedExpr(SourceLocation Loc, tok::TokenKind Kind) { PredefinedExpr::IdentType IT; @@ -1884,7 +1884,7 @@ Sema::OwningExprResult Sema::ActOnPredefinedExpr(SourceLocation Loc, return Owned(new (Context) PredefinedExpr(Loc, ResTy, IT)); } -Sema::OwningExprResult Sema::ActOnCharacterConstant(const Token &Tok) { +ExprResult Sema::ActOnCharacterConstant(const Token &Tok) { llvm::SmallString<16> CharBuffer; bool Invalid = false; llvm::StringRef ThisTok = PP.getSpelling(Tok, CharBuffer, &Invalid); @@ -1911,7 +1911,7 @@ Sema::OwningExprResult Sema::ActOnCharacterConstant(const Token &Tok) { Ty, Tok.getLocation())); } -Action::OwningExprResult Sema::ActOnNumericConstant(const Token &Tok) { +ExprResult Sema::ActOnNumericConstant(const Token &Tok) { // Fast path for a single digit (which is quite common). A single digit // cannot have a trigraph, escaped newline, radix prefix, or type suffix. if (Tok.getLength() == 1) { @@ -2073,7 +2073,7 @@ Action::OwningExprResult Sema::ActOnNumericConstant(const Token &Tok) { return Owned(Res); } -Action::OwningExprResult Sema::ActOnParenExpr(SourceLocation L, +ExprResult Sema::ActOnParenExpr(SourceLocation L, SourceLocation R, Expr *E) { assert((E != 0) && "ActOnParenExpr() missing expr"); return Owned(new (Context) ParenExpr(L, R, E)); @@ -2158,7 +2158,7 @@ bool Sema::CheckAlignOfExpr(Expr *E, SourceLocation OpLoc, } /// \brief Build a sizeof or alignof expression given a type operand. -Action::OwningExprResult +ExprResult Sema::CreateSizeOfAlignOfExpr(TypeSourceInfo *TInfo, SourceLocation OpLoc, bool isSizeOf, SourceRange R) { @@ -2179,7 +2179,7 @@ Sema::CreateSizeOfAlignOfExpr(TypeSourceInfo *TInfo, /// \brief Build a sizeof or alignof expression given an expression /// operand. -Action::OwningExprResult +ExprResult Sema::CreateSizeOfAlignOfExpr(Expr *E, SourceLocation OpLoc, bool isSizeOf, SourceRange R) { // Verify that the operand is valid. @@ -2207,7 +2207,7 @@ Sema::CreateSizeOfAlignOfExpr(Expr *E, SourceLocation OpLoc, /// ActOnSizeOfAlignOfExpr - Handle @c sizeof(type) and @c sizeof @c expr and /// the same for @c alignof and @c __alignof /// Note that the ArgRange is invalid if isType is false. -Action::OwningExprResult +ExprResult Sema::ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType, void *TyOrEx, const SourceRange &ArgRange) { // If error parsing type, ignore. @@ -2220,7 +2220,7 @@ Sema::ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType, } Expr *ArgEx = (Expr *)TyOrEx; - Action::OwningExprResult Result + ExprResult Result = CreateSizeOfAlignOfExpr(ArgEx, OpLoc, isSizeof, ArgEx->getSourceRange()); if (Result.isInvalid()) @@ -2249,7 +2249,7 @@ QualType Sema::CheckRealImagOperand(Expr *&V, SourceLocation Loc, bool isReal) { -Action::OwningExprResult +ExprResult Sema::ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc, tok::TokenKind Kind, Expr *Input) { UnaryOperator::Opcode Opc; @@ -2262,11 +2262,11 @@ Sema::ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc, return BuildUnaryOp(S, OpLoc, Opc, Input); } -Action::OwningExprResult +ExprResult Sema::ActOnArraySubscriptExpr(Scope *S, Expr *Base, SourceLocation LLoc, Expr *Idx, SourceLocation RLoc) { // Since this might be a postfix expression, get rid of ParenListExprs. - OwningExprResult Result = MaybeConvertParenListExprToParenExpr(S, Base); + ExprResult Result = MaybeConvertParenListExprToParenExpr(S, Base); if (Result.isInvalid()) return ExprError(); Base = Result.take(); @@ -2290,7 +2290,7 @@ Sema::ActOnArraySubscriptExpr(Scope *S, Expr *Base, SourceLocation LLoc, } -Action::OwningExprResult +ExprResult Sema::CreateBuiltinArraySubscriptExpr(Expr *Base, SourceLocation LLoc, Expr *Idx, SourceLocation RLoc) { Expr *LHSExp = Base; @@ -2541,7 +2541,7 @@ static Decl *FindGetterNameDecl(const ObjCObjectPointerType *QIdTy, return GDecl; } -Sema::OwningExprResult +ExprResult Sema::ActOnDependentMemberExpr(Expr *BaseExpr, QualType BaseType, bool IsArrow, SourceLocation OpLoc, const CXXScopeSpec &SS, @@ -2718,7 +2718,7 @@ LookupMemberExprInRecord(Sema &SemaRef, LookupResult &R, return false; } -Sema::OwningExprResult +ExprResult Sema::BuildMemberReferenceExpr(Expr *Base, QualType BaseType, SourceLocation OpLoc, bool IsArrow, CXXScopeSpec &SS, @@ -2745,7 +2745,7 @@ Sema::BuildMemberReferenceExpr(Expr *Base, QualType BaseType, // Explicit member accesses. } else { - OwningExprResult Result = + ExprResult Result = LookupMemberExpr(R, Base, IsArrow, OpLoc, SS, /*ObjCImpDecl*/ 0, TemplateArgs != 0); @@ -2766,7 +2766,7 @@ Sema::BuildMemberReferenceExpr(Expr *Base, QualType BaseType, R, TemplateArgs); } -Sema::OwningExprResult +ExprResult Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType, SourceLocation OpLoc, bool IsArrow, const CXXScopeSpec &SS, @@ -2957,7 +2957,7 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType, /// /// The ObjCImpDecl bit is a gross hack that will need to be properly /// fixed for ObjC++. -Sema::OwningExprResult +ExprResult Sema::LookupMemberExpr(LookupResult &R, Expr *&BaseExpr, bool &IsArrow, SourceLocation OpLoc, CXXScopeSpec &SS, @@ -2991,7 +2991,7 @@ Sema::LookupMemberExpr(LookupResult &R, Expr *&BaseExpr, << QualType(Fun, 0) << FixItHint::CreateInsertion(Loc, "()"); - OwningExprResult NewBase + ExprResult NewBase = ActOnCallExpr(0, BaseExpr, Loc, MultiExprArg(*this, 0, 0), 0, Loc); BaseExpr = 0; @@ -3304,7 +3304,7 @@ Sema::LookupMemberExpr(LookupResult &R, Expr *&BaseExpr, /// \param ObjCImpDecl the current ObjC @implementation decl; /// this is an ugly hack around the fact that ObjC @implementations /// aren't properly put in the context chain -Sema::OwningExprResult Sema::ActOnMemberAccessExpr(Scope *S, Expr *Base, +ExprResult Sema::ActOnMemberAccessExpr(Scope *S, Expr *Base, SourceLocation OpLoc, tok::TokenKind OpKind, CXXScopeSpec &SS, @@ -3330,7 +3330,7 @@ Sema::OwningExprResult Sema::ActOnMemberAccessExpr(Scope *S, Expr *Base, static_cast<NestedNameSpecifier*>(SS.getScopeRep()))); // This is a postfix expression, so get rid of ParenListExprs. - OwningExprResult Result = MaybeConvertParenListExprToParenExpr(S, Base); + ExprResult Result = MaybeConvertParenListExprToParenExpr(S, Base); if (Result.isInvalid()) return ExprError(); Base = Result.take(); @@ -3370,7 +3370,7 @@ Sema::OwningExprResult Sema::ActOnMemberAccessExpr(Scope *S, Expr *Base, return move(Result); } -Sema::OwningExprResult Sema::BuildCXXDefaultArgExpr(SourceLocation CallLoc, +ExprResult Sema::BuildCXXDefaultArgExpr(SourceLocation CallLoc, FunctionDecl *FD, ParmVarDecl *Param) { if (Param->hasUnparsedDefaultArg()) { @@ -3392,7 +3392,7 @@ Sema::OwningExprResult Sema::BuildCXXDefaultArgExpr(SourceLocation CallLoc, InstantiatingTemplate Inst(*this, CallLoc, Param, Innermost.first, Innermost.second); |