aboutsummaryrefslogtreecommitdiff
path: root/lib/Rewrite/RewriteObjC.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-08-15 01:15:58 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-08-15 01:15:58 +0000
commitba6f816d633e3b88c38c6896c2d78d19489650f2 (patch)
tree1a3ff23c5ce234b47d2b7f255eb0baf5dbf78ae6 /lib/Rewrite/RewriteObjC.cpp
parent469865cf50f5d11951cc13a935f0fe52cbf17360 (diff)
Remove dead code, caught by unused function warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111091 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/RewriteObjC.cpp')
-rw-r--r--lib/Rewrite/RewriteObjC.cpp63
1 files changed, 0 insertions, 63 deletions
diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp
index 45c707fe29..2cbf5f308c 100644
--- a/lib/Rewrite/RewriteObjC.cpp
+++ b/lib/Rewrite/RewriteObjC.cpp
@@ -229,14 +229,6 @@ namespace {
Diags.Report(Context->getFullLoc(Loc), RewriteFailedDiag);
}
- void RemoveText(SourceLocation Loc, unsigned StrLen) {
- // If removal succeeded or warning disabled return with no warning.
- if (!Rewrite.RemoveText(Loc, StrLen) || SilenceRewriteMacroWarning)
- return;
-
- Diags.Report(Context->getFullLoc(Loc), RewriteFailedDiag);
- }
-
void ReplaceText(SourceLocation Start, unsigned OrigLength,
llvm::StringRef Str) {
// If removal succeeded or warning disabled return with no warning.
@@ -248,9 +240,7 @@ namespace {
}
// Syntactic Rewriting.
- void RewritePrologue(SourceLocation Loc);
void RewriteInclude();
- void RewriteTabs();
void RewriteForwardClassDecl(ObjCClassDecl *Dcl);
void RewritePropertyImplDecl(ObjCPropertyImplDecl *PID,
ObjCImplementationDecl *IMD,
@@ -275,7 +265,6 @@ namespace {
void RewriteTypeOfDecl(VarDecl *VD);
void RewriteObjCQualifiedInterfaceTypes(Expr *E);
bool needToScanForQualifiers(QualType T);
- bool isSuperReceiver(Expr *recExpr);
QualType getSuperStructType();
QualType getConstantStringStructType();
QualType convertFunctionTypeOfBlocks(const FunctionType *FT);
@@ -305,8 +294,6 @@ namespace {
void RewriteSyncReturnStmts(Stmt *S, std::string buf);
Stmt *RewriteObjCTryStmt(ObjCAtTryStmt *S);
Stmt *RewriteObjCSynchronizedStmt(ObjCAtSynchronizedStmt *S);
- Stmt *RewriteObjCCatchStmt(ObjCAtCatchStmt *S);
- Stmt *RewriteObjCFinallyStmt(ObjCAtFinallyStmt *S);
Stmt *RewriteObjCThrowStmt(ObjCAtThrowStmt *S);
Stmt *RewriteObjCForCollectionStmt(ObjCForCollectionStmt *S,
SourceLocation OrigEnd);
@@ -371,7 +358,6 @@ namespace {
void InsertBlockLiteralsWithinMethod(ObjCMethodDecl *MD);
// Block specific rewrite rules.
- void RewriteBlockCall(CallExpr *Exp);
void RewriteBlockPointerDecl(NamedDecl *VD);
void RewriteByRefVar(VarDecl *VD);
std::string SynthesizeByrefCopyDestroyHelper(VarDecl *VD, int flag);
@@ -747,36 +733,6 @@ void RewriteObjC::RewriteInclude() {
}
}
-void RewriteObjC::RewriteTabs() {
- llvm::StringRef MainBuf = SM->getBufferData(MainFileID);
- const char *MainBufStart = MainBuf.begin();
- const char *MainBufEnd = MainBuf.end();
-
- // Loop over the whole file, looking for tabs.
- for (const char *BufPtr = MainBufStart; BufPtr != MainBufEnd; ++BufPtr) {
- if (*BufPtr != '\t')
- continue;
-
- // Okay, we found a tab. This tab will turn into at least one character,
- // but it depends on which 'virtual column' it is in. Compute that now.
- unsigned VCol = 0;
- while (BufPtr-VCol != MainBufStart && BufPtr[-VCol-1] != '\t' &&
- BufPtr[-VCol-1] != '\n' && BufPtr[-VCol-1] != '\r')
- ++VCol;
-
- // Okay, now that we know the virtual column, we know how many spaces to
- // insert. We assume 8-character tab-stops.
- unsigned Spaces = 8-(VCol & 7);
-
- // Get the location of the tab.
- SourceLocation TabLoc = SM->getLocForStartOfFile(MainFileID);
- TabLoc = TabLoc.getFileLocWithOffset(BufPtr-MainBufStart);
-
- // Rewrite the single tab character into a sequence of spaces.
- ReplaceText(TabLoc, 1, llvm::StringRef(" ", Spaces));
- }
-}
-
static std::string getIvarAccessString(ObjCInterfaceDecl *ClassDecl,
ObjCIvarDecl *OID) {
std::string S;
@@ -2024,14 +1980,6 @@ Stmt *RewriteObjC::RewriteObjCTryStmt(ObjCAtTryStmt *S) {
return 0;
}
-Stmt *RewriteObjC::RewriteObjCCatchStmt(ObjCAtCatchStmt *S) {
- return 0;
-}
-
-Stmt *RewriteObjC::RewriteObjCFinallyStmt(ObjCAtFinallyStmt *S) {
- return 0;
-}
-
// This can't be done with ReplaceStmt(S, ThrowExpr), since
// the throw expression is typically a message expression that's already
// been rewritten! (which implies the SourceLocation's are invalid).
@@ -2636,12 +2584,6 @@ Stmt *RewriteObjC::RewriteObjCStringLiteral(ObjCStringLiteral *Exp) {
return cast;
}
-bool RewriteObjC::isSuperReceiver(Expr *recExpr) {
- // check if we are sending a message to 'super'
- if (!CurMethodDef || !CurMethodDef->isInstanceMethod()) return false;
- return isa<ObjCSuperExpr>(recExpr);
-}
-
// struct objc_super { struct objc_object *receiver; struct objc_class *super; };
QualType RewriteObjC::getSuperStructType() {
if (!SuperStructDecl) {
@@ -4696,11 +4638,6 @@ Stmt *RewriteObjC::SynthesizeBlockCall(CallExpr *Exp, const Expr *BlockExp) {
return CE;
}
-void RewriteObjC::RewriteBlockCall(CallExpr *Exp) {
- Stmt *BlockCall = SynthesizeBlockCall(Exp, Exp->getCallee());
- ReplaceStmt(Exp, BlockCall);
-}
-
// We need to return the rewritten expression to handle cases where the
// BlockDeclRefExpr is embedded in another expression being rewritten.
// For example: