зеркало из https://github.com/microsoft/clang-1.git
Remove useless parameter from isConstantSizeType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47156 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
f78915fa19
Коммит
3c2b317004
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче