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;
}
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;
}
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;
}
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;
}
/// 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);
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!");
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
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 {
// 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"));
}
/// 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;