]> granicus.if.org Git - clang/commitdiff
Remove useless parameter from isConstantSizeType.
authorEli Friedman <eli.friedman@gmail.com>
Fri, 15 Feb 2008 12:20:59 +0000 (12:20 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Fri, 15 Feb 2008 12:20:59 +0000 (12:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47156 91177308-0d34-0410-b5e6-96231b3b80d8

AST/Expr.cpp
AST/Type.cpp
CodeGen/CGDecl.cpp
CodeGen/CGExpr.cpp
include/clang/AST/Type.h

index f4da0f0751620ebd49e0e30c1b4d0812b7568abb..b8c564e94e1b901658d3fd8d155c2e729e655fa6 100644 (file)
@@ -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;
     }
index d3eb003eab279088850968441e28db6db377636b..1ce5059777454c3ebfad1239491845b68471b96e 100644 (file)
@@ -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);
index b6f9c7cbd6e512cbd631ac3267872809f7cd46a2..d8e8f4e1ca2f5d01d992ea664be1a047c7114634 100644 (file)
@@ -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 {
index 64f2697e4df55f9b08332126e70e1e2278d9c503..24e929188b43a606a9b558ed36a50372fb0d5c61 100644 (file)
@@ -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"));
 }
index fd2ef34274d40f3491e3f59558950b1ac3c71800..9ff76ef666dd599c8d505c81a29e81c6e09dfb30 100644 (file)
@@ -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;