diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-24 21:54:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-24 21:54:33 +0000 |
commit | 111c2ee5fe984219d1950b389ea4d2dcabaf83da (patch) | |
tree | d8b7001b391a7c39630e6704a03ee68a2f92ee11 /lib/Sema/SemaDecl.cpp | |
parent | c4a09c189981b4561428e4b56fd250718e2717bb (diff) |
some minor cleanups, handle ObjCEncodeExpr in a couple places.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65389 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index a728757adb..2af6ab1bb3 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1149,10 +1149,9 @@ bool Sema::CheckStringLiteralInit(StringLiteral *strLiteral, QualType &DeclT) { } StringLiteral *Sema::IsStringLiteralInit(Expr *Init, QualType DeclType) { - const ArrayType *AT = Context.getAsArrayType(DeclType); - if (AT && AT->getElementType()->isCharType()) { - return dyn_cast<StringLiteral>(Init->IgnoreParens()); - } + if (const ArrayType *AT = Context.getAsArrayType(DeclType)) + if (AT->getElementType()->isCharType()) + return dyn_cast<StringLiteral>(Init->IgnoreParens()); return 0; } @@ -2194,6 +2193,7 @@ bool Sema::CheckAddressConstantExpressionLValue(const Expr* Init) { CheckArithmeticConstantExpression(ASE->getIdx()); } case Expr::StringLiteralClass: + case Expr::ObjCEncodeExprClass: case Expr::PredefinedExprClass: return false; case Expr::UnaryOperatorClass: { @@ -2217,6 +2217,7 @@ bool Sema::CheckAddressConstantExpression(const Expr* Init) { case Expr::ParenExprClass: return CheckAddressConstantExpression(cast<ParenExpr>(Init)->getSubExpr()); case Expr::StringLiteralClass: + case Expr::ObjCEncodeExprClass: case Expr::ObjCStringLiteralClass: return false; case Expr::CallExprClass: @@ -2576,9 +2577,8 @@ bool Sema::CheckArithmeticConstantExpression(const Expr* Init) { } bool Sema::CheckForConstantInitializer(Expr *Init, QualType DclT) { - if (Init->isConstantInitializer(Context)) { + if (Init->isConstantInitializer(Context)) return false; - } InitializerElementNotConstant(Init); return true; |