summaryrefslogtreecommitdiff
path: root/lib/Edit/RewriteObjCFoundationAPI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Edit/RewriteObjCFoundationAPI.cpp')
-rw-r--r--lib/Edit/RewriteObjCFoundationAPI.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/Edit/RewriteObjCFoundationAPI.cpp b/lib/Edit/RewriteObjCFoundationAPI.cpp
index b53a70d87582b..7c9ab170093fa 100644
--- a/lib/Edit/RewriteObjCFoundationAPI.cpp
+++ b/lib/Edit/RewriteObjCFoundationAPI.cpp
@@ -420,8 +420,8 @@ static bool rewriteToArrayLiteral(const ObjCMessageExpr *Msg,
commit.replace(MsgRange, "@[]");
return true;
}
- SourceRange ArgRange(Msg->getArg(0)->getLocStart(),
- Msg->getArg(Msg->getNumArgs()-2)->getLocEnd());
+ SourceRange ArgRange(Msg->getArg(0)->getBeginLoc(),
+ Msg->getArg(Msg->getNumArgs() - 2)->getEndLoc());
commit.replaceWithInner(MsgRange, ArgRange);
commit.insertWrap("@[", ArgRange, "]");
return true;
@@ -550,8 +550,8 @@ static bool rewriteToDictionaryLiteral(const ObjCMessageExpr *Msg,
// Range of arguments up until and including the last key.
// The sentinel and first value are cut off, the value will move after the
// key.
- SourceRange ArgRange(Msg->getArg(1)->getLocStart(),
- Msg->getArg(SentinelIdx-1)->getLocEnd());
+ SourceRange ArgRange(Msg->getArg(1)->getBeginLoc(),
+ Msg->getArg(SentinelIdx - 1)->getEndLoc());
commit.insertWrap("@{", ArgRange, "}");
commit.replaceWithInner(MsgRange, ArgRange);
return true;
@@ -591,8 +591,7 @@ static bool rewriteToDictionaryLiteral(const ObjCMessageExpr *Msg,
}
// Range of arguments up until and including the last key.
// The first value is cut off, the value will move after the key.
- SourceRange ArgRange(Keys.front()->getLocStart(),
- Keys.back()->getLocEnd());
+ SourceRange ArgRange(Keys.front()->getBeginLoc(), Keys.back()->getEndLoc());
commit.insertWrap("@{", ArgRange, "}");
commit.replaceWithInner(MsgRange, ArgRange);
return true;
@@ -1079,13 +1078,16 @@ static bool rewriteToNumericBoxedExpression(const ObjCMessageExpr *Msg,
case CK_NonAtomicToAtomic:
case CK_CopyAndAutoreleaseBlockObject:
case CK_BuiltinFnToFnPtr:
- case CK_ZeroToOCLEvent:
- case CK_ZeroToOCLQueue:
+ case CK_ZeroToOCLOpaqueType:
case CK_IntToOCLSampler:
return false;
case CK_BooleanToSignedIntegral:
llvm_unreachable("OpenCL-specific cast in Objective-C?");
+
+ case CK_FixedPointCast:
+ case CK_FixedPointToBoolean:
+ llvm_unreachable("Fixed point types are disabled for Objective-C");
}
}
@@ -1131,7 +1133,7 @@ static bool doRewriteToUTF8StringBoxedExpressionHelper(
if (const StringLiteral *
StrE = dyn_cast<StringLiteral>(OrigArg->IgnoreParens())) {
commit.replaceWithInner(Msg->getSourceRange(), StrE->getSourceRange());
- commit.insert(StrE->getLocStart(), "@");
+ commit.insert(StrE->getBeginLoc(), "@");
return true;
}