summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/Rewrite
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/Rewrite')
-rw-r--r--clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp30
-rw-r--r--clang/lib/Frontend/Rewrite/RewriteObjC.cpp30
2 files changed, 30 insertions, 30 deletions
diff --git a/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp b/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp
index 7b7179433b1..c1abc54ae82 100644
--- a/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp
+++ b/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp
@@ -932,7 +932,7 @@ void RewriteModernObjC::RewritePropertyImplDecl(ObjCPropertyImplDecl *PID,
assert((*semiBuf == ';') && "@synthesize: can't find ';'");
startGetterSetterLoc = startLoc.getLocWithOffset(semiBuf-startBuf+1);
} else
- startGetterSetterLoc = IMD ? IMD->getLocEnd() : CID->getLocEnd();
+ startGetterSetterLoc = IMD ? IMD->getEndLoc() : CID->getEndLoc();
if (PID->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic)
return; // FIXME: is this correct?
@@ -1109,7 +1109,7 @@ void RewriteModernObjC::RewriteMethodDeclaration(ObjCMethodDecl *Method) {
if (Method->isImplicit())
return;
SourceLocation LocStart = Method->getBeginLoc();
- SourceLocation LocEnd = Method->getLocEnd();
+ SourceLocation LocEnd = Method->getEndLoc();
if (SM->getExpansionLineNumber(LocEnd) >
SM->getExpansionLineNumber(LocStart)) {
@@ -1371,7 +1371,7 @@ void RewriteModernObjC::RewriteImplementationDecl(Decl *OID) {
for (auto *I : IMD ? IMD->property_impls() : CID->property_impls())
RewritePropertyImplDecl(I, IMD, CID);
- InsertText(IMD ? IMD->getLocEnd() : CID->getLocEnd(), "// ");
+ InsertText(IMD ? IMD->getEndLoc() : CID->getEndLoc(), "// ");
}
void RewriteModernObjC::RewriteInterfaceDecl(ObjCInterfaceDecl *ClassDecl) {
@@ -1879,7 +1879,7 @@ Stmt *RewriteModernObjC::RewriteObjCSynchronizedStmt(ObjCAtSynchronizedStmt *S)
buf += "\n\tid sync_exit;";
buf += "\n\t} _sync_exit(_sync_obj);\n";
- // We can't use S->getSynchExpr()->getLocEnd() to find the end location, since
+ // We can't use S->getSynchExpr()->getEndLoc() to find the end location, since
// the sync expression is typically a message expression that's already
// been rewritten! (which implies the SourceLocation's are invalid).
SourceLocation RParenExprLoc = S->getSynchBody()->getBeginLoc();
@@ -1892,7 +1892,7 @@ Stmt *RewriteModernObjC::RewriteObjCSynchronizedStmt(ObjCAtSynchronizedStmt *S)
assert (*LBraceLocBuf == '{');
ReplaceText(RParenExprLoc, (LBraceLocBuf - SM->getCharacterData(RParenExprLoc) + 1), buf);
- SourceLocation startRBraceLoc = S->getSynchBody()->getLocEnd();
+ SourceLocation startRBraceLoc = S->getSynchBody()->getEndLoc();
assert((*SM->getCharacterData(startRBraceLoc) == '}') &&
"bogus @synchronized block");
@@ -2020,7 +2020,7 @@ Stmt *RewriteModernObjC::RewriteObjCTryStmt(ObjCAtTryStmt *S) {
Write_RethrowObject(buf);
ReplaceText(startFinalBodyLoc, 1, buf);
- SourceLocation endFinalBodyLoc = body->getLocEnd();
+ SourceLocation endFinalBodyLoc = body->getEndLoc();
ReplaceText(endFinalBodyLoc, 1, "}\n}");
// Now check for any return/continue/go statements within the @try.
WarnAboutReturnGotoStmts(S->getTryBody());
@@ -2051,7 +2051,7 @@ Stmt *RewriteModernObjC::RewriteObjCThrowStmt(ObjCAtThrowStmt *S) {
assert((*wBuf == 'w') && "@throw: can't find 'w'");
ReplaceText(startLoc, wBuf-startBuf+1, buf);
- SourceLocation endLoc = S->getLocEnd();
+ SourceLocation endLoc = S->getEndLoc();
const char *endBuf = SM->getCharacterData(endLoc);
const char *semiBuf = strchr(endBuf, ';');
assert((*semiBuf == ';') && "@throw: can't find ';'");
@@ -2170,7 +2170,7 @@ void RewriteModernObjC::RewriteObjCQualifiedInterfaceTypes(Expr *E) {
EndLoc = ECE->getRParenLoc();
} else {
Loc = E->getBeginLoc();
- EndLoc = E->getLocEnd();
+ EndLoc = E->getEndLoc();
}
// This will defend against trying to rewrite synthesized expressions.
if (Loc.isInvalid() || EndLoc.isInvalid())
@@ -2301,7 +2301,7 @@ void RewriteModernObjC::RewriteTypeOfDecl(VarDecl *ND) {
ReplaceText(DeclLoc, endBuf-startBuf-1, TypeAsString);
}
else {
- SourceLocation X = ND->getLocEnd();
+ SourceLocation X = ND->getEndLoc();
X = SM->getExpansionLoc(X);
const char *endBuf = SM->getCharacterData(X);
ReplaceText(DeclLoc, endBuf-startBuf-1, TypeAsString);
@@ -2625,7 +2625,7 @@ Stmt *RewriteModernObjC::RewriteObjCBoxedExpr(ObjCBoxedExpr *Exp) {
FunctionDecl *MsgSendFlavor = MsgSendFunctionDecl;
SourceLocation StartLoc = Exp->getBeginLoc();
- SourceLocation EndLoc = Exp->getLocEnd();
+ SourceLocation EndLoc = Exp->getEndLoc();
// Synthesize a call to objc_msgSend().
SmallVector<Expr*, 4> MsgExprs;
@@ -2709,7 +2709,7 @@ Stmt *RewriteModernObjC::RewriteObjCArrayLiteralExpr(ObjCArrayLiteral *Exp) {
FunctionDecl *MsgSendFlavor = MsgSendFunctionDecl;
SourceLocation StartLoc = Exp->getBeginLoc();
- SourceLocation EndLoc = Exp->getLocEnd();
+ SourceLocation EndLoc = Exp->getEndLoc();
// Build the expression: __NSContainer_literal(int, ...).arr
QualType IntQT = Context->IntTy;
@@ -2832,7 +2832,7 @@ Stmt *RewriteModernObjC::RewriteObjCDictionaryLiteralExpr(ObjCDictionaryLiteral
FunctionDecl *MsgSendFlavor = MsgSendFunctionDecl;
SourceLocation StartLoc = Exp->getBeginLoc();
- SourceLocation EndLoc = Exp->getLocEnd();
+ SourceLocation EndLoc = Exp->getEndLoc();
// Build the expression: __NSContainer_literal(int, ...).arr
QualType IntQT = Context->IntTy;
@@ -3563,7 +3563,7 @@ Stmt *RewriteModernObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
Stmt *RewriteModernObjC::RewriteMessageExpr(ObjCMessageExpr *Exp) {
Stmt *ReplacingStmt =
- SynthMessageExpr(Exp, Exp->getBeginLoc(), Exp->getLocEnd());
+ SynthMessageExpr(Exp, Exp->getBeginLoc(), Exp->getEndLoc());
// Now do the actual rewrite.
ReplaceStmt(Exp, ReplacingStmt);
@@ -5035,7 +5035,7 @@ void RewriteModernObjC::RewriteByRefVar(VarDecl *ND, bool firstDecl,
// Use variable's location which is good for this case.
DeclLoc = ND->getLocation();
const char *startBuf = SM->getCharacterData(DeclLoc);
- SourceLocation X = ND->getLocEnd();
+ SourceLocation X = ND->getEndLoc();
X = SM->getExpansionLoc(X);
const char *endBuf = SM->getCharacterData(X);
std::string Name(ND->getNameAsString());
@@ -5537,7 +5537,7 @@ Stmt *RewriteModernObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) {
#if 0
// Before we rewrite it, put the original message expression in a comment.
SourceLocation startLoc = MessExpr->getBeginLoc();
- SourceLocation endLoc = MessExpr->getLocEnd();
+ SourceLocation endLoc = MessExpr->getEndLoc();
const char *startBuf = SM->getCharacterData(startLoc);
const char *endBuf = SM->getCharacterData(endLoc);
diff --git a/clang/lib/Frontend/Rewrite/RewriteObjC.cpp b/clang/lib/Frontend/Rewrite/RewriteObjC.cpp
index 7049520ebb8..8d950e70f9d 100644
--- a/clang/lib/Frontend/Rewrite/RewriteObjC.cpp
+++ b/clang/lib/Frontend/Rewrite/RewriteObjC.cpp
@@ -946,7 +946,7 @@ void RewriteObjC::RewriteMethodDeclaration(ObjCMethodDecl *Method) {
if (Method->isImplicit())
return;
SourceLocation LocStart = Method->getBeginLoc();
- SourceLocation LocEnd = Method->getLocEnd();
+ SourceLocation LocEnd = Method->getEndLoc();
if (SM->getExpansionLineNumber(LocEnd) >
SM->getExpansionLineNumber(LocStart)) {
@@ -1191,7 +1191,7 @@ void RewriteObjC::RewriteImplementationDecl(Decl *OID) {
for (auto *I : IMD ? IMD->property_impls() : CID->property_impls())
RewritePropertyImplDecl(I, IMD, CID);
- InsertText(IMD ? IMD->getLocEnd() : CID->getLocEnd(), "// ");
+ InsertText(IMD ? IMD->getEndLoc() : CID->getEndLoc(), "// ");
}
void RewriteObjC::RewriteInterfaceDecl(ObjCInterfaceDecl *ClassDecl) {
@@ -1651,7 +1651,7 @@ Stmt *RewriteObjC::RewriteObjCSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
const char *lparenBuf = startBuf;
while (*lparenBuf != '(') lparenBuf++;
ReplaceText(startLoc, lparenBuf-startBuf+1, buf);
- // We can't use S->getSynchExpr()->getLocEnd() to find the end location, since
+ // We can't use S->getSynchExpr()->getEndLoc() to find the end location, since
// the sync expression is typically a message expression that's already
// been rewritten! (which implies the SourceLocation's are invalid).
SourceLocation endLoc = S->getSynchBody()->getBeginLoc();
@@ -1667,7 +1667,7 @@ Stmt *RewriteObjC::RewriteObjCSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
buf += "objc_exception_try_enter(&_stack);\n";
buf += "if (!_setjmp(_stack.buf)) /* @try block continue */\n";
ReplaceText(rparenLoc, 1, buf);
- startLoc = S->getSynchBody()->getLocEnd();
+ startLoc = S->getSynchBody()->getEndLoc();
startBuf = SM->getCharacterData(startLoc);
assert((*startBuf == '}') && "bogus @synchronized block");
@@ -1798,7 +1798,7 @@ Stmt *RewriteObjC::RewriteObjCTryStmt(ObjCAtTryStmt *S) {
ReplaceText(startLoc, 4, buf);
- startLoc = S->getTryBody()->getLocEnd();
+ startLoc = S->getTryBody()->getEndLoc();
startBuf = SM->getCharacterData(startLoc);
assert((*startBuf == '}') && "bogus @try block");
@@ -1881,7 +1881,7 @@ Stmt *RewriteObjC::RewriteObjCTryStmt(ObjCAtTryStmt *S) {
}
// Complete the catch list...
if (lastCatchBody) {
- SourceLocation bodyLoc = lastCatchBody->getLocEnd();
+ SourceLocation bodyLoc = lastCatchBody->getEndLoc();
assert(*SM->getCharacterData(bodyLoc) == '}' &&
"bogus @catch body location");
@@ -1897,7 +1897,7 @@ Stmt *RewriteObjC::RewriteObjCTryStmt(ObjCAtTryStmt *S) {
InsertText(bodyLoc, buf);
// Set lastCurlyLoc
- lastCurlyLoc = lastCatchBody->getLocEnd();
+ lastCurlyLoc = lastCatchBody->getEndLoc();
}
if (ObjCAtFinallyStmt *finalStmt = S->getFinallyStmt()) {
startLoc = finalStmt->getBeginLoc();
@@ -1908,7 +1908,7 @@ Stmt *RewriteObjC::RewriteObjCTryStmt(ObjCAtTryStmt *S) {
Stmt *body = finalStmt->getFinallyBody();
SourceLocation startLoc = body->getBeginLoc();
- SourceLocation endLoc = body->getLocEnd();
+ SourceLocation endLoc = body->getEndLoc();
assert(*SM->getCharacterData(startLoc) == '{' &&
"bogus @finally body location");
assert(*SM->getCharacterData(endLoc) == '}' &&
@@ -1920,7 +1920,7 @@ Stmt *RewriteObjC::RewriteObjCTryStmt(ObjCAtTryStmt *S) {
InsertText(endLoc, " if (_rethrow) objc_exception_throw(_rethrow);\n");
// Set lastCurlyLoc
- lastCurlyLoc = body->getLocEnd();
+ lastCurlyLoc = body->getEndLoc();
// Now check for any return/continue/go statements within the @try.
WarnAboutReturnGotoStmts(S->getTryBody());
@@ -2083,7 +2083,7 @@ void RewriteObjC::RewriteObjCQualifiedInterfaceTypes(Expr *E) {
EndLoc = ECE->getRParenLoc();
} else {
Loc = E->getBeginLoc();
- EndLoc = E->getLocEnd();
+ EndLoc = E->getEndLoc();
}
// This will defend against trying to rewrite synthesized expressions.
if (Loc.isInvalid() || EndLoc.isInvalid())
@@ -2210,7 +2210,7 @@ void RewriteObjC::RewriteTypeOfDecl(VarDecl *ND) {
ReplaceText(DeclLoc, endBuf-startBuf-1, TypeAsString);
}
else {
- SourceLocation X = ND->getLocEnd();
+ SourceLocation X = ND->getEndLoc();
X = SM->getExpansionLoc(X);
const char *endBuf = SM->getCharacterData(X);
ReplaceText(DeclLoc, endBuf-startBuf-1, TypeAsString);
@@ -3009,7 +3009,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp,
Stmt *RewriteObjC::RewriteMessageExpr(ObjCMessageExpr *Exp) {
Stmt *ReplacingStmt =
- SynthMessageExpr(Exp, Exp->getBeginLoc(), Exp->getLocEnd());
+ SynthMessageExpr(Exp, Exp->getBeginLoc(), Exp->getEndLoc());
// Now do the actual rewrite.
ReplaceStmt(Exp, ReplacingStmt);
@@ -4179,7 +4179,7 @@ void RewriteObjC::RewriteByRefVar(VarDecl *ND) {
// Use variable's location which is good for this case.
DeclLoc = ND->getLocation();
const char *startBuf = SM->getCharacterData(DeclLoc);
- SourceLocation X = ND->getLocEnd();
+ SourceLocation X = ND->getEndLoc();
X = SM->getExpansionLoc(X);
const char *endBuf = SM->getCharacterData(X);
std::string Name(ND->getNameAsString());
@@ -4633,7 +4633,7 @@ Stmt *RewriteObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) {
#if 0
// Before we rewrite it, put the original message expression in a comment.
SourceLocation startLoc = MessExpr->getBeginLoc();
- SourceLocation endLoc = MessExpr->getLocEnd();
+ SourceLocation endLoc = MessExpr->getEndLoc();
const char *startBuf = SM->getCharacterData(startLoc);
const char *endBuf = SM->getCharacterData(endLoc);
@@ -5874,7 +5874,7 @@ Stmt *RewriteObjCFragileABI::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV) {
IV->getBase());
// Don't forget the parens to enforce the proper binding.
ParenExpr *PE = new (Context) ParenExpr(
- IV->getBase()->getBeginLoc(), IV->getBase()->getLocEnd(), castExpr);
+ IV->getBase()->getBeginLoc(), IV->getBase()->getEndLoc(), castExpr);
// Cannot delete IV->getBase(), since PE points to it.
// Replace the old base with the cast. This is important when doing
// embedded rewrites. For example, [newInv->_container addObject:0].
OpenPOWER on IntegriCloud