diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2008-02-15 12:20:59 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2008-02-15 12:20:59 +0000 |
commit | 3c2b3170041f69a92904e3bab9b6d654eaf260ac (patch) | |
tree | e065bd1b6c7674a1137f52da7b18dedd32ce1741 | |
parent | f78915fa196b3d284ad756f65eecadaefef71eef (diff) |
Remove useless parameter from isConstantSizeType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47156 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | AST/Expr.cpp | 8 | ||||
-rw-r--r-- | AST/Type.cpp | 4 | ||||
-rw-r--r-- | CodeGen/CGDecl.cpp | 6 | ||||
-rw-r--r-- | CodeGen/CGExpr.cpp | 2 | ||||
-rw-r--r-- | include/clang/AST/Type.h | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/AST/Expr.cpp b/AST/Expr.cpp index f4da0f0751..b8c564e94e 100644 --- a/AST/Expr.cpp +++ b/AST/Expr.cpp @@ -565,7 +565,7 @@ bool Expr::isConstantExpr(ASTContext &Ctx, SourceLocation *Loc) const { case UnaryOperator::AlignOf: case UnaryOperator::OffsetOf: // sizeof(vla) is not a constantexpr: C99 6.5.3.4p2. - if (!Exp->getSubExpr()->getType()->isConstantSizeType(Ctx)) { + if (!Exp->getSubExpr()->getType()->isConstantSizeType()) { if (Loc) *Loc = Exp->getOperatorLoc(); return false; } @@ -580,7 +580,7 @@ bool Expr::isConstantExpr(ASTContext &Ctx, SourceLocation *Loc) const { case SizeOfAlignOfTypeExprClass: { const SizeOfAlignOfTypeExpr *Exp = cast<SizeOfAlignOfTypeExpr>(this); // alignof always evaluates to a constant. - if (Exp->isSizeOf() && !Exp->getArgumentType()->isConstantSizeType(Ctx)) { + if (Exp->isSizeOf() && !Exp->getArgumentType()->isConstantSizeType()) { if (Loc) *Loc = Exp->getOperatorLoc(); return false; } @@ -722,7 +722,7 @@ bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, ASTContext &Ctx, case UnaryOperator::SizeOf: case UnaryOperator::AlignOf: // sizeof(vla) is not a constantexpr: C99 6.5.3.4p2. - if (!Exp->getSubExpr()->getType()->isConstantSizeType(Ctx)) { + if (!Exp->getSubExpr()->getType()->isConstantSizeType()) { if (Loc) *Loc = Exp->getOperatorLoc(); return false; } @@ -771,7 +771,7 @@ bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, ASTContext &Ctx, case SizeOfAlignOfTypeExprClass: { const SizeOfAlignOfTypeExpr *Exp = cast<SizeOfAlignOfTypeExpr>(this); // alignof always evaluates to a constant. - if (Exp->isSizeOf() && !Exp->getArgumentType()->isConstantSizeType(Ctx)) { + if (Exp->isSizeOf() && !Exp->getArgumentType()->isConstantSizeType()) { if (Loc) *Loc = Exp->getOperatorLoc(); return false; } diff --git a/AST/Type.cpp b/AST/Type.cpp index d3eb003eab..1ce5059777 100644 --- a/AST/Type.cpp +++ b/AST/Type.cpp @@ -570,9 +570,9 @@ bool Type::isAggregateType() const { /// isConstantSizeType - Return true if this is not a variable sized type, /// according to the rules of C99 6.7.5p3. It is not legal to call this on /// incomplete types. -bool Type::isConstantSizeType(ASTContext &Ctx) const { +bool Type::isConstantSizeType() const { if (const ASQualType *ASQT = dyn_cast<ASQualType>(CanonicalType)) - return ASQT->getBaseType()->isConstantSizeType(Ctx); + return ASQT->getBaseType()->isConstantSizeType(); assert(!isIncompleteType() && "This doesn't make sense for incomplete types"); // The VAT must have a size, as it is known to be complete. return !isa<VariableArrayType>(CanonicalType); diff --git a/CodeGen/CGDecl.cpp b/CodeGen/CGDecl.cpp index b6f9c7cbd6..d8e8f4e1ca 100644 --- a/CodeGen/CGDecl.cpp +++ b/CodeGen/CGDecl.cpp @@ -66,7 +66,7 @@ void CodeGenFunction::EmitBlockVarDecl(const BlockVarDecl &D) { void CodeGenFunction::EmitStaticBlockVarDecl(const BlockVarDecl &D) { QualType Ty = D.getCanonicalType(); - assert(Ty->isConstantSizeType(getContext()) && "VLAs can't be static"); + assert(Ty->isConstantSizeType() && "VLAs can't be static"); llvm::Value *&DMEntry = LocalDeclMap[&D]; assert(DMEntry == 0 && "Decl already exists in localdeclmap!"); @@ -103,7 +103,7 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const BlockVarDecl &D) { QualType Ty = D.getCanonicalType(); llvm::Value *DeclPtr; - if (Ty->isConstantSizeType(getContext())) { + if (Ty->isConstantSizeType()) { // A normal fixed sized variable becomes an alloca in the entry block. const llvm::Type *LTy = ConvertType(Ty); // TODO: Alignment @@ -135,7 +135,7 @@ void CodeGenFunction::EmitParmDecl(const ParmVarDecl &D, llvm::Value *Arg) { QualType Ty = D.getCanonicalType(); llvm::Value *DeclPtr; - if (!Ty->isConstantSizeType(getContext())) { + if (!Ty->isConstantSizeType()) { // Variable sized values always are passed by-reference. DeclPtr = Arg; } else { diff --git a/CodeGen/CGExpr.cpp b/CodeGen/CGExpr.cpp index 64f2697e4d..24e929188b 100644 --- a/CodeGen/CGExpr.cpp +++ b/CodeGen/CGExpr.cpp @@ -438,7 +438,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) { // We know that the pointer points to a type of the correct size, unless the // size is a VLA. - if (!E->getType()->isConstantSizeType(getContext())) + if (!E->getType()->isConstantSizeType()) assert(0 && "VLA idx not implemented"); return LValue::MakeAddr(Builder.CreateGEP(Base, Idx, "arrayidx")); } diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index fd2ef34274..9ff76ef666 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -355,7 +355,7 @@ public: /// isConstantSizeType - Return true if this is not a variable sized type, /// according to the rules of C99 6.7.5p3. It is not legal to call this on /// incomplete types. - bool isConstantSizeType(ASTContext &Ctx) const; + bool isConstantSizeType() const; private: QualType getCanonicalTypeInternal() const { return CanonicalType; } friend class QualType; |