summaryrefslogtreecommitdiffstats
path: root/clang/lib/ARCMigrate/Transforms.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2018-07-30 19:24:48 +0000
committerFangrui Song <maskray@google.com>2018-07-30 19:24:48 +0000
commit6907ce2f8f7410b179beb6e2db9c8d16a257ce9f (patch)
tree31081ac1b3df5965102999757410e052925e03af /clang/lib/ARCMigrate/Transforms.cpp
parentce9b3e084c43e99fbcfeb730ddb5fd0e575d5237 (diff)
downloadbcm5719-llvm-6907ce2f8f7410b179beb6e2db9c8d16a257ce9f.tar.gz
bcm5719-llvm-6907ce2f8f7410b179beb6e2db9c8d16a257ce9f.zip
Remove trailing space
sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} llvm-svn: 338291
Diffstat (limited to 'clang/lib/ARCMigrate/Transforms.cpp')
-rw-r--r--clang/lib/ARCMigrate/Transforms.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/clang/lib/ARCMigrate/Transforms.cpp b/clang/lib/ARCMigrate/Transforms.cpp
index 1f4e6a297fc..4a7af285887 100644
--- a/clang/lib/ARCMigrate/Transforms.cpp
+++ b/clang/lib/ARCMigrate/Transforms.cpp
@@ -203,7 +203,7 @@ bool trans::isGlobalVar(Expr *E) {
return isGlobalVar(condOp->getTrueExpr()) &&
isGlobalVar(condOp->getFalseExpr());
- return false;
+ return false;
}
StringRef trans::getNilString(MigrationPass &Pass) {
@@ -240,9 +240,9 @@ class RemovablesCollector : public RecursiveASTVisitor<RemovablesCollector> {
public:
RemovablesCollector(ExprSet &removables)
: Removables(removables) { }
-
+
bool shouldWalkTypesOfTypeLocs() const { return false; }
-
+
bool TraverseStmtExpr(StmtExpr *E) {
CompoundStmt *S = E->getSubStmt();
for (CompoundStmt::body_iterator
@@ -253,40 +253,40 @@ public:
}
return true;
}
-
+
bool VisitCompoundStmt(CompoundStmt *S) {
for (auto *I : S->body())
mark(I);
return true;
}
-
+
bool VisitIfStmt(IfStmt *S) {
mark(S->getThen());
mark(S->getElse());
return true;
}
-
+
bool VisitWhileStmt(WhileStmt *S) {
mark(S->getBody());
return true;
}
-
+
bool VisitDoStmt(DoStmt *S) {
mark(S->getBody());
return true;
}
-
+
bool VisitForStmt(ForStmt *S) {
mark(S->getInit());
mark(S->getInc());
mark(S->getBody());
return true;
}
-
+
private:
void mark(Stmt *S) {
if (!S) return;
-
+
while (LabelStmt *Label = dyn_cast<LabelStmt>(S))
S = Label->getSubStmt();
S = S->IgnoreImplicit();
@@ -408,12 +408,12 @@ bool MigrationContext::rewritePropertyAttribute(StringRef fromAttr,
return false;
lexer.LexFromRawLexer(tok);
if (tok.isNot(tok::l_paren)) return false;
-
+
Token BeforeTok = tok;
Token AfterTok;
AfterTok.startToken();
SourceLocation AttrLoc;
-
+
lexer.LexFromRawLexer(tok);
if (tok.is(tok::r_paren))
return false;
@@ -454,7 +454,7 @@ bool MigrationContext::rewritePropertyAttribute(StringRef fromAttr,
return true;
}
-
+
return false;
}
@@ -493,7 +493,7 @@ bool MigrationContext::addPropertyAttribute(StringRef attr,
Pass.TA.insert(tok.getLocation(), std::string("(") + attr.str() + ") ");
return true;
}
-
+
lexer.LexFromRawLexer(tok);
if (tok.is(tok::r_paren)) {
Pass.TA.insert(tok.getLocation(), attr);
@@ -520,7 +520,7 @@ static void GCRewriteFinalize(MigrationPass &pass) {
DeclContext *DC = Ctx.getTranslationUnitDecl();
Selector FinalizeSel =
Ctx.Selectors.getNullarySelector(&pass.Ctx.Idents.get("finalize"));
-
+
typedef DeclContext::specific_decl_iterator<ObjCImplementationDecl>
impl_iterator;
for (impl_iterator I = impl_iterator(DC->decls_begin()),
@@ -528,11 +528,11 @@ static void GCRewriteFinalize(MigrationPass &pass) {
for (const auto *MD : I->instance_methods()) {
if (!MD->hasBody())
continue;
-
+
if (MD->isInstanceMethod() && MD->getSelector() == FinalizeSel) {
const ObjCMethodDecl *FinalizeM = MD;
Transaction Trans(TA);
- TA.insert(FinalizeM->getSourceRange().getBegin(),
+ TA.insert(FinalizeM->getSourceRange().getBegin(),
"#if !__has_feature(objc_arc)\n");
CharSourceRange::getTokenRange(FinalizeM->getSourceRange());
const SourceManager &SM = pass.Ctx.getSourceManager();
@@ -540,10 +540,10 @@ static void GCRewriteFinalize(MigrationPass &pass) {
bool Invalid;
std::string str = "\n#endif\n";
str += Lexer::getSourceText(
- CharSourceRange::getTokenRange(FinalizeM->getSourceRange()),
+ CharSourceRange::getTokenRange(FinalizeM->getSourceRange()),
SM, LangOpts, &Invalid);
TA.insertAfterToken(FinalizeM->getSourceRange().getEnd(), str);
-
+
break;
}
}
OpenPOWER on IntegriCloud