[cfe-commits] r47156 - in /cfe/trunk: AST/Expr.cpp AST/Type.cpp CodeGen/CGDecl.cpp CodeGen/CGExpr.cpp include/clang/AST/Type.h
Eli Friedman
eli.friedman at gmail.com
Fri Feb 15 04:21:00 PST 2008
Author: efriedma
Date: Fri Feb 15 06:20:59 2008
New Revision: 47156
URL: http://llvm.org/viewvc/llvm-project?rev=47156&view=rev
Log:
Remove useless parameter from isConstantSizeType.
Modified:
cfe/trunk/AST/Expr.cpp
cfe/trunk/AST/Type.cpp
cfe/trunk/CodeGen/CGDecl.cpp
cfe/trunk/CodeGen/CGExpr.cpp
cfe/trunk/include/clang/AST/Type.h
Modified: cfe/trunk/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/Expr.cpp?rev=47156&r1=47155&r2=47156&view=diff
==============================================================================
--- cfe/trunk/AST/Expr.cpp (original)
+++ cfe/trunk/AST/Expr.cpp Fri Feb 15 06:20:59 2008
@@ -565,7 +565,7 @@
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 @@
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 @@
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 @@
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;
}
Modified: cfe/trunk/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/Type.cpp?rev=47156&r1=47155&r2=47156&view=diff
==============================================================================
--- cfe/trunk/AST/Type.cpp (original)
+++ cfe/trunk/AST/Type.cpp Fri Feb 15 06:20:59 2008
@@ -570,9 +570,9 @@
/// 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);
Modified: cfe/trunk/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGDecl.cpp?rev=47156&r1=47155&r2=47156&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/CodeGen/CGDecl.cpp Fri Feb 15 06:20:59 2008
@@ -66,7 +66,7 @@
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 @@
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 @@
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 {
Modified: cfe/trunk/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGExpr.cpp?rev=47156&r1=47155&r2=47156&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/CodeGen/CGExpr.cpp Fri Feb 15 06:20:59 2008
@@ -438,7 +438,7 @@
// 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"));
}
Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=47156&r1=47155&r2=47156&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Fri Feb 15 06:20:59 2008
@@ -355,7 +355,7 @@
/// 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;
More information about the cfe-commits
mailing list