diff options
Diffstat (limited to 'clang/lib/AST/ExprCXX.cpp')
-rw-r--r-- | clang/lib/AST/ExprCXX.cpp | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/clang/lib/AST/ExprCXX.cpp b/clang/lib/AST/ExprCXX.cpp index 9758b607279..f60f195b363 100644 --- a/clang/lib/AST/ExprCXX.cpp +++ b/clang/lib/AST/ExprCXX.cpp @@ -88,14 +88,14 @@ CXXNewExpr::CXXNewExpr(ASTContext &C, bool globalNew, FunctionDecl *operatorNew, InitializationStyle initializationStyle, Expr *initializer, QualType ty, TypeSourceInfo *allocatedTypeInfo, - SourceLocation startLoc, SourceRange directInitRange) + SourceRange Range, SourceRange directInitRange) : Expr(CXXNewExprClass, ty, VK_RValue, OK_Ordinary, ty->isDependentType(), ty->isDependentType(), ty->isInstantiationDependentType(), ty->containsUnexpandedParameterPack()), SubExprs(0), OperatorNew(operatorNew), OperatorDelete(operatorDelete), AllocatedTypeInfo(allocatedTypeInfo), TypeIdParens(typeIdParens), - StartLoc(startLoc), DirectInitRange(directInitRange), + Range(Range), DirectInitRange(directInitRange), GlobalNew(globalNew), UsualArrayDeleteWantsSize(usualArrayDeleteWantsSize) { assert((initializer != 0 || initializationStyle == NoInit) && "Only NoInit can have no initializer."); @@ -147,18 +147,6 @@ bool CXXNewExpr::shouldNullCheckAllocation(ASTContext &Ctx) const { castAs<FunctionProtoType>()->isNothrow(Ctx); } -SourceLocation CXXNewExpr::getEndLoc() const { - switch (getInitializationStyle()) { - case NoInit: - return AllocatedTypeInfo->getTypeLoc().getEndLoc(); - case CallInit: - return DirectInitRange.getEnd(); - case ListInit: - return getInitializer()->getSourceRange().getEnd(); - } - llvm_unreachable("bogus initialization style"); -} - // CXXDeleteExpr QualType CXXDeleteExpr::getDestroyedType() const { const Expr *Arg = getArgument(); |