summaryrefslogtreecommitdiffstats
path: root/lib/Rewrite
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-03-19 20:38:08 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-03-19 20:38:08 +0000
commit4bcf3d0e3d07771839bb71edb8b64fa206a7909e (patch)
treecfde3236a63365e9fdf76ab6fb5e8478b7f9ab53 /lib/Rewrite
parentb4556860fbe7cd98624e0cf3d79e31577bedabee (diff)
removed unused code in the modern objc rewriter file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153052 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite')
-rw-r--r--lib/Rewrite/RewriteModernObjC.cpp68
1 files changed, 0 insertions, 68 deletions
diff --git a/lib/Rewrite/RewriteModernObjC.cpp b/lib/Rewrite/RewriteModernObjC.cpp
index 648bce7be2..d3d8622b70 100644
--- a/lib/Rewrite/RewriteModernObjC.cpp
+++ b/lib/Rewrite/RewriteModernObjC.cpp
@@ -316,8 +316,6 @@ namespace {
Stmt *RewriteMessageExpr(ObjCMessageExpr *Exp);
Stmt *RewriteObjCStringLiteral(ObjCStringLiteral *Exp);
Stmt *RewriteObjCProtocolExpr(ObjCProtocolExpr *Exp);
- void RewriteTryReturnStmts(Stmt *S);
- void RewriteSyncReturnStmts(Stmt *S, std::string buf);
Stmt *RewriteObjCTryStmt(ObjCAtTryStmt *S);
Stmt *RewriteObjCSynchronizedStmt(ObjCAtSynchronizedStmt *S);
Stmt *RewriteObjCThrowStmt(ObjCAtThrowStmt *S);
@@ -419,7 +417,6 @@ namespace {
// Misc. helper routines.
QualType getProtocolType();
void WarnAboutReturnGotoStmts(Stmt *S);
- void HasReturnStmts(Stmt *S, bool &hasReturns);
void CheckFunctionPointerDecl(QualType dType, NamedDecl *ND);
void InsertBlockLiteralsWithinFunction(FunctionDecl *FD);
void InsertBlockLiteralsWithinMethod(ObjCMethodDecl *MD);
@@ -1756,66 +1753,6 @@ void RewriteModernObjC::WarnAboutReturnGotoStmts(Stmt *S)
return;
}
-void RewriteModernObjC::HasReturnStmts(Stmt *S, bool &hasReturns)
-{
- // Perform a bottom up traversal of all children.
- for (Stmt::child_range CI = S->children(); CI; ++CI)
- if (*CI)
- HasReturnStmts(*CI, hasReturns);
-
- if (isa<ReturnStmt>(S))
- hasReturns = true;
- return;
-}
-
-void RewriteModernObjC::RewriteTryReturnStmts(Stmt *S) {
- // Perform a bottom up traversal of all children.
- for (Stmt::child_range CI = S->children(); CI; ++CI)
- if (*CI) {
- RewriteTryReturnStmts(*CI);
- }
- if (isa<ReturnStmt>(S)) {
- SourceLocation startLoc = S->getLocStart();
- const char *startBuf = SM->getCharacterData(startLoc);
-
- const char *semiBuf = strchr(startBuf, ';');
- assert((*semiBuf == ';') && "RewriteTryReturnStmts: can't find ';'");
- SourceLocation onePastSemiLoc = startLoc.getLocWithOffset(semiBuf-startBuf+1);
-
- std::string buf;
- buf = "{ objc_exception_try_exit(&_stack); return";
-
- ReplaceText(startLoc, 6, buf);
- InsertText(onePastSemiLoc, "}");
- }
- return;
-}
-
-void RewriteModernObjC::RewriteSyncReturnStmts(Stmt *S, std::string syncExitBuf) {
- // Perform a bottom up traversal of all children.
- for (Stmt::child_range CI = S->children(); CI; ++CI)
- if (*CI) {
- RewriteSyncReturnStmts(*CI, syncExitBuf);
- }
- if (isa<ReturnStmt>(S)) {
- SourceLocation startLoc = S->getLocStart();
- const char *startBuf = SM->getCharacterData(startLoc);
-
- const char *semiBuf = strchr(startBuf, ';');
- assert((*semiBuf == ';') && "RewriteSyncReturnStmts: can't find ';'");
- SourceLocation onePastSemiLoc = startLoc.getLocWithOffset(semiBuf-startBuf+1);
-
- std::string buf;
- buf = "{ objc_exception_try_exit(&_stack);";
- buf += syncExitBuf;
- buf += " return";
-
- ReplaceText(startLoc, 6, buf);
- InsertText(onePastSemiLoc, "}");
- }
- return;
-}
-
Stmt *RewriteModernObjC::RewriteObjCTryStmt(ObjCAtTryStmt *S) {
ObjCAtFinallyStmt *finalStmt = S->getFinallyStmt();
bool noCatch = S->getNumCatchStmts() == 0;
@@ -5163,11 +5100,6 @@ void RewriteModernObjC::Initialize(ASTContext &context) {
Preamble += "__OBJC_RW_DLLIMPORT struct objc_object *objc_getMetaClass";
Preamble += "(const char *);\n";
Preamble += "__OBJC_RW_DLLIMPORT void objc_exception_throw( struct objc_object *);\n";
- Preamble += "__OBJC_RW_DLLIMPORT void objc_exception_try_enter(void *);\n";
- Preamble += "__OBJC_RW_DLLIMPORT void objc_exception_try_exit(void *);\n";
- Preamble += "__OBJC_RW_DLLIMPORT struct objc_object *objc_exception_extract(void *);\n";
- Preamble += "__OBJC_RW_DLLIMPORT int objc_exception_match";
- Preamble += "(struct objc_class *, struct objc_object *);\n";
// @synchronized hooks.
Preamble += "__OBJC_RW_DLLIMPORT void objc_sync_enter( struct objc_object *);\n";
Preamble += "__OBJC_RW_DLLIMPORT void objc_sync_exit( struct objc_object *);\n";