diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-05-16 00:21:21 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-05-16 00:21:21 +0000 |
commit | 0773659881064e7773a63eabc26a4d90293e2f04 (patch) | |
tree | 9a59121f636f2ddc59f09f27a0999299dd85ca0a /lib/Edit/RewriteObjCFoundationAPI.cpp | |
parent | f1db0c9d8db882972832b0a16bbf2e5943605ed0 (diff) |
[objcmt] Accept char arrays for rewriting to @() syntax.
Part of rdar://11438360
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156880 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Edit/RewriteObjCFoundationAPI.cpp')
-rw-r--r-- | lib/Edit/RewriteObjCFoundationAPI.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Edit/RewriteObjCFoundationAPI.cpp b/lib/Edit/RewriteObjCFoundationAPI.cpp index 5f7bef6f54..846d58fc2c 100644 --- a/lib/Edit/RewriteObjCFoundationAPI.cpp +++ b/lib/Edit/RewriteObjCFoundationAPI.cpp @@ -824,8 +824,12 @@ static bool doRewriteToUTF8StringBoxedExpressionHelper( if (Arg->isTypeDependent()) return false; + ASTContext &Ctx = NS.getASTContext(); + const Expr *OrigArg = Arg->IgnoreImpCasts(); QualType OrigTy = OrigArg->getType(); + if (OrigTy->isArrayType()) + OrigTy = Ctx.getArrayDecayedType(OrigTy); if (const StringLiteral * StrE = dyn_cast<StringLiteral>(OrigArg->IgnoreParens())) { @@ -834,8 +838,6 @@ static bool doRewriteToUTF8StringBoxedExpressionHelper( return true; } - ASTContext &Ctx = NS.getASTContext(); - if (const PointerType *PT = OrigTy->getAs<PointerType>()) { QualType PointeeType = PT->getPointeeType(); if (Ctx.hasSameUnqualifiedType(PointeeType, Ctx.CharTy)) { |