diff options
author | Chris Lattner <sabre@nondot.org> | 2007-12-18 07:18:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-12-18 07:18:16 +0000 |
commit | 9bfa73c5ab7bf4b0e749d04f29da6884e8d5bd9f (patch) | |
tree | a00adc0d5b6bf4bf910868d46e034928e260dcf9 | |
parent | 65383479cb2caf0f136f58fecdbdbaf9c497b7a1 (diff) |
remove the loc argument to Type::isConstantSizeType, which isn't useful.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45155 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | AST/Type.cpp | 16 | ||||
-rw-r--r-- | include/clang/AST/Type.h | 7 |
2 files changed, 9 insertions, 14 deletions
diff --git a/AST/Type.cpp b/AST/Type.cpp index ccd4630843..04c236c31b 100644 --- a/AST/Type.cpp +++ b/AST/Type.cpp @@ -446,17 +446,13 @@ bool Type::isAggregateType() const { CanonicalType->getTypeClass() == VariableArray; } -// The only variable size types are auto arrays within a function. Structures -// cannot contain a VLA member. They can have a flexible array member, however -// the structure is still constant size (C99 6.7.2.1p16). -bool Type::isConstantSizeType(ASTContext &Ctx, SourceLocation *Loc) 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 { assert(!isIncompleteType() && "This doesn't make sense for incomplete types"); - if (const VariableArrayType *VAT =dyn_cast<VariableArrayType>(CanonicalType)){ - // The VAT must have a size, as it is known to be complete. - if (Loc) *Loc = VAT->getSizeExpr()->getLocStart(); - return false; - } - return true; + // The VAT must have a size, as it is known to be complete. + return !isa<VariableArrayType>(CanonicalType); } /// isIncompleteType - Return true if this is an incomplete type (C99 6.2.5p1) diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 641e62f1ba..24388ea888 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -338,10 +338,9 @@ public: bool isUnsignedIntegerType() const; /// isConstantSizeType - Return true if this is not a variable sized type, - /// according to the rules of C99 6.7.5p3. If Loc is non-null, it is set to - /// the location of the subexpression that makes it a vla type. It is not - /// legal to call this on incomplete types. - bool isConstantSizeType(ASTContext &Ctx, SourceLocation *Loc = 0) const; + /// according to the rules of C99 6.7.5p3. It is not legal to call this on + /// incomplete types. + bool isConstantSizeType(ASTContext &Ctx) const; private: QualType getCanonicalTypeInternal() const { return CanonicalType; } friend class QualType; |