[cfe-commits] r49692 - in /cfe/trunk: Driver/ test/Rewriter/
Steve Naroff
snaroff at apple.com
Mon Apr 14 15:03:10 PDT 2008
Author: snaroff
Date: Mon Apr 14 17:03:09 2008
New Revision: 49692
URL: http://llvm.org/viewvc/llvm-project?rev=49692&view=rev
Log:
Rename RewriteTest->RewriteObjC.
Modified:
cfe/trunk/Driver/RewriteTest.cpp
cfe/trunk/Driver/clang.cpp
cfe/trunk/test/Rewriter/id-test-3.m
cfe/trunk/test/Rewriter/ivar-encoding-1.m
cfe/trunk/test/Rewriter/ivar-encoding-2.m
cfe/trunk/test/Rewriter/metadata-test-1.m
cfe/trunk/test/Rewriter/metadata-test-2.m
cfe/trunk/test/Rewriter/method-encoding-1.m
cfe/trunk/test/Rewriter/objc-encoding-bug-1.m
cfe/trunk/test/Rewriter/objc-ivar-receiver-1.m
cfe/trunk/test/Rewriter/objc-string-concat-1.m
cfe/trunk/test/Rewriter/objc-super-test.m
cfe/trunk/test/Rewriter/objc-synchronized-1.m
cfe/trunk/test/Rewriter/protocol-rewrite-1.m
cfe/trunk/test/Rewriter/rewrite-api-bug.m
cfe/trunk/test/Rewriter/rewrite-foreach-1.m
cfe/trunk/test/Rewriter/rewrite-foreach-2.m
cfe/trunk/test/Rewriter/rewrite-foreach-3.m
cfe/trunk/test/Rewriter/rewrite-foreach-4.m
cfe/trunk/test/Rewriter/rewrite-foreach-5.m
cfe/trunk/test/Rewriter/rewrite-foreach-6.m
cfe/trunk/test/Rewriter/rewrite-protocol-type-1.m
cfe/trunk/test/Rewriter/rewrite-try-catch.m
cfe/trunk/test/Rewriter/static-type-protocol-1.m
cfe/trunk/test/Rewriter/undecl-objc-h.m
cfe/trunk/test/Rewriter/undeclared-method-1.m
cfe/trunk/test/Rewriter/undef-field-reference-1.m
cfe/trunk/test/Rewriter/va-method.m
Modified: cfe/trunk/Driver/RewriteTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteTest.cpp?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/Driver/RewriteTest.cpp (original)
+++ cfe/trunk/Driver/RewriteTest.cpp Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-//===--- RewriteTest.cpp - Playground for the code rewriter ---------------===//
+//===--- RewriteObjC.cpp - Playground for the code rewriter ---------------===//
//
// The LLVM Compiler Infrastructure
//
@@ -24,7 +24,7 @@
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/System/Path.h"
-#include <sstream>
+#include <sstream>RewriteObjC
#include <fstream>
using namespace clang;
using llvm::utostr;
@@ -34,7 +34,7 @@
llvm::cl::desc("Silence ObjC rewriting warnings"));
namespace {
- class RewriteTest : public ASTConsumer {
+ class RewriteObjC : public ASTConsumer {
Rewriter Rewrite;
Diagnostic &Diags;
const LangOptions &LangOpts;
@@ -97,9 +97,9 @@
// Top Level Driver code.
virtual void HandleTopLevelDecl(Decl *D);
void HandleDeclInMainFile(Decl *D);
- RewriteTest(std::string inFile, std::string outFile,
+ RewriteObjC(std::string inFile, std::string outFile,
Diagnostic &D, const LangOptions &LOpts);
- ~RewriteTest();
+ ~RewriteObjC();
void ReplaceStmt(Stmt *Old, Stmt *New) {
// If replacement succeeded or warning disabled return with no warning.
@@ -235,7 +235,7 @@
return Ext == "h" || Ext == "hh" || Ext == "H";
}
-RewriteTest::RewriteTest(std::string inFile, std::string outFile,
+RewriteObjC::RewriteObjC(std::string inFile, std::string outFile,
Diagnostic &D, const LangOptions &LOpts)
: Diags(D), LangOpts(LOpts) {
IsHeader = IsHeaderFile(inFile);
@@ -249,10 +249,10 @@
const std::string& OutFile,
Diagnostic &Diags,
const LangOptions &LOpts) {
- return new RewriteTest(InFile, OutFile, Diags, LOpts);
+ return new RewriteObjC(InFile, OutFile, Diags, LOpts);
}
-void RewriteTest::Initialize(ASTContext &context) {
+void RewriteObjC::Initialize(ASTContext &context) {
Context = &context;
SM = &Context->getSourceManager();
MsgSendFunctionDecl = 0;
@@ -354,7 +354,7 @@
// Top Level Driver Code
//===----------------------------------------------------------------------===//
-void RewriteTest::HandleTopLevelDecl(Decl *D) {
+void RewriteObjC::HandleTopLevelDecl(Decl *D) {
// Two cases: either the decl could be in the main file, or it could be in a
// #included file. If the former, rewrite it now. If the later, check to see
// if we rewrote the #include/#import.
@@ -390,7 +390,7 @@
/// HandleDeclInMainFile - This is called for each top-level decl defined in the
/// main file of the input.
-void RewriteTest::HandleDeclInMainFile(Decl *D) {
+void RewriteObjC::HandleDeclInMainFile(Decl *D) {
if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
if (Stmt *Body = FD->getBody())
FD->setBody(RewriteFunctionBodyOrGlobalInitializer(Body));
@@ -417,7 +417,7 @@
// Nothing yet.
}
-RewriteTest::~RewriteTest() {
+RewriteObjC::~RewriteObjC() {
// Get the top-level buffer that this corresponds to.
// Rewrite tabs if we care.
@@ -470,7 +470,7 @@
// Syntactic (non-AST) Rewriting Code
//===----------------------------------------------------------------------===//
-void RewriteTest::RewriteInclude() {
+void RewriteObjC::RewriteInclude() {
SourceLocation LocStart = SourceLocation::getFileLoc(MainFileID, 0);
std::pair<const char*, const char*> MainBuf = SM->getBufferData(MainFileID);
const char *MainBufStart = MainBuf.first;
@@ -497,7 +497,7 @@
}
}
-void RewriteTest::RewriteTabs() {
+void RewriteObjC::RewriteTabs() {
std::pair<const char*, const char*> MainBuf = SM->getBufferData(MainFileID);
const char *MainBufStart = MainBuf.first;
const char *MainBufEnd = MainBuf.second;
@@ -528,7 +528,7 @@
}
-void RewriteTest::RewriteForwardClassDecl(ObjCClassDecl *ClassDecl) {
+void RewriteObjC::RewriteForwardClassDecl(ObjCClassDecl *ClassDecl) {
int numDecls = ClassDecl->getNumForwardDecls();
ObjCInterfaceDecl **ForwardDecls = ClassDecl->getForwardDecls();
@@ -562,7 +562,7 @@
typedefString.c_str(), typedefString.size());
}
-void RewriteTest::RewriteMethodDeclaration(ObjCMethodDecl *Method) {
+void RewriteObjC::RewriteMethodDeclaration(ObjCMethodDecl *Method) {
SourceLocation LocStart = Method->getLocStart();
SourceLocation LocEnd = Method->getLocEnd();
@@ -574,7 +574,7 @@
}
}
-void RewriteTest::RewriteProperties(unsigned nProperties, ObjCPropertyDecl **Properties)
+void RewriteObjC::RewriteProperties(unsigned nProperties, ObjCPropertyDecl **Properties)
{
for (unsigned i = 0; i < nProperties; i++) {
ObjCPropertyDecl *Property = Properties[i];
@@ -586,7 +586,7 @@
}
}
-void RewriteTest::RewriteCategoryDecl(ObjCCategoryDecl *CatDecl) {
+void RewriteObjC::RewriteCategoryDecl(ObjCCategoryDecl *CatDecl) {
SourceLocation LocStart = CatDecl->getLocStart();
// FIXME: handle category headers that are declared across multiple lines.
@@ -603,7 +603,7 @@
ReplaceText(CatDecl->getAtEndLoc(), 0, "// ", 3);
}
-void RewriteTest::RewriteProtocolDecl(ObjCProtocolDecl *PDecl) {
+void RewriteObjC::RewriteProtocolDecl(ObjCProtocolDecl *PDecl) {
std::pair<const char*, const char*> MainBuf = SM->getBufferData(MainFileID);
SourceLocation LocStart = PDecl->getLocStart();
@@ -643,7 +643,7 @@
}
}
-void RewriteTest::RewriteForwardProtocolDecl(ObjCForwardProtocolDecl *PDecl) {
+void RewriteObjC::RewriteForwardProtocolDecl(ObjCForwardProtocolDecl *PDecl) {
SourceLocation LocStart = PDecl->getLocation();
if (LocStart.isInvalid())
assert(false && "Invalid SourceLocation");
@@ -651,7 +651,7 @@
ReplaceText(LocStart, 0, "// ", 3);
}
-void RewriteTest::RewriteObjCMethodDecl(ObjCMethodDecl *OMD,
+void RewriteObjC::RewriteObjCMethodDecl(ObjCMethodDecl *OMD,
std::string &ResultStr) {
ResultStr += "\nstatic ";
if (OMD->getResultType()->isObjCQualifiedIdType())
@@ -730,7 +730,7 @@
ResultStr += ") ";
}
-void RewriteTest::RewriteImplementationDecl(NamedDecl *OID) {
+void RewriteObjC::RewriteImplementationDecl(NamedDecl *OID) {
ObjCImplementationDecl *IMD = dyn_cast<ObjCImplementationDecl>(OID);
ObjCCategoryImplDecl *CID = dyn_cast<ObjCCategoryImplDecl>(OID);
@@ -774,7 +774,7 @@
InsertText(CID->getLocEnd(), "// ", 3);
}
-void RewriteTest::RewriteInterfaceDecl(ObjCInterfaceDecl *ClassDecl) {
+void RewriteObjC::RewriteInterfaceDecl(ObjCInterfaceDecl *ClassDecl) {
std::string ResultStr;
if (!ObjCForwardDecls.count(ClassDecl)) {
// we haven't seen a forward decl - generate a typedef.
@@ -805,7 +805,7 @@
ReplaceText(ClassDecl->getAtEndLoc(), 0, "// ", 3);
}
-Stmt *RewriteTest::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV) {
+Stmt *RewriteObjC::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV) {
ObjCIvarDecl *D = IV->getDecl();
if (CurMethodDecl) {
if (const PointerType *pType = IV->getBase()->getType()->getAsPointerType()) {
@@ -855,7 +855,7 @@
// Function Body / Expression rewriting
//===----------------------------------------------------------------------===//
-Stmt *RewriteTest::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) {
+Stmt *RewriteObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) {
if (isa<SwitchStmt>(S) || isa<WhileStmt>(S) ||
isa<DoStmt>(S) || isa<ForStmt>(S))
Stmts.push_back(S);
@@ -966,7 +966,7 @@
/// &enumState,
/// (id *)items, (unsigned int)16)
///
-void RewriteTest::SynthCountByEnumWithState(std::string &buf) {
+void RewriteObjC::SynthCountByEnumWithState(std::string &buf) {
buf += "((unsigned int (*) (id, SEL, struct __objcFastEnumerationState *, "
"id *, unsigned int))(void *)objc_msgSend)";
buf += "\n\t\t";
@@ -980,7 +980,7 @@
/// RewriteBreakStmt - Rewrite for a break-stmt inside an ObjC2's foreach
/// statement to exit to its outer synthesized loop.
///
-Stmt *RewriteTest::RewriteBreakStmt(BreakStmt *S) {
+Stmt *RewriteObjC::RewriteBreakStmt(BreakStmt *S) {
if (Stmts.empty() || !isa<ObjCForCollectionStmt>(Stmts.back()))
return S;
// replace break with goto __break_label
@@ -997,7 +997,7 @@
/// RewriteContinueStmt - Rewrite for a continue-stmt inside an ObjC2's foreach
/// statement to continue with its inner synthesized loop.
///
-Stmt *RewriteTest::RewriteContinueStmt(ContinueStmt *S) {
+Stmt *RewriteObjC::RewriteContinueStmt(ContinueStmt *S) {
if (Stmts.empty() || !isa<ObjCForCollectionStmt>(Stmts.back()))
return S;
// replace continue with goto __continue_label
@@ -1043,7 +1043,7 @@
/// elem = nil;
/// }
///
-Stmt *RewriteTest::RewriteObjCForCollectionStmt(ObjCForCollectionStmt *S,
+Stmt *RewriteObjC::RewriteObjCForCollectionStmt(ObjCForCollectionStmt *S,
SourceLocation OrigEnd) {
assert(!Stmts.empty() && "ObjCForCollectionStmt - Statement stack empty");
assert(isa<ObjCForCollectionStmt>(Stmts.back()) &&
@@ -1181,7 +1181,7 @@
/// objc_sync_enter(expr);
/// @try stmt @finally { objc_sync_exit(expr); }
///
-Stmt *RewriteTest::RewriteObjCSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
+Stmt *RewriteObjC::RewriteObjCSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
// Get the start location and compute the semi location.
SourceLocation startLoc = S->getLocStart();
const char *startBuf = SM->getCharacterData(startLoc);
@@ -1223,7 +1223,7 @@
return 0;
}
-Stmt *RewriteTest::RewriteObjCTryStmt(ObjCAtTryStmt *S) {
+Stmt *RewriteObjC::RewriteObjCTryStmt(ObjCAtTryStmt *S) {
// Get the start location and compute the semi location.
SourceLocation startLoc = S->getLocStart();
const char *startBuf = SM->getCharacterData(startLoc);
@@ -1369,18 +1369,18 @@
return 0;
}
-Stmt *RewriteTest::RewriteObjCCatchStmt(ObjCAtCatchStmt *S) {
+Stmt *RewriteObjC::RewriteObjCCatchStmt(ObjCAtCatchStmt *S) {
return 0;
}
-Stmt *RewriteTest::RewriteObjCFinallyStmt(ObjCAtFinallyStmt *S) {
+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).
-Stmt *RewriteTest::RewriteObjCThrowStmt(ObjCAtThrowStmt *S) {
+Stmt *RewriteObjC::RewriteObjCThrowStmt(ObjCAtThrowStmt *S) {
// Get the start location and compute the semi location.
SourceLocation startLoc = S->getLocStart();
const char *startBuf = SM->getCharacterData(startLoc);
@@ -1402,7 +1402,7 @@
return 0;
}
-Stmt *RewriteTest::RewriteAtEncode(ObjCEncodeExpr *Exp) {
+Stmt *RewriteObjC::RewriteAtEncode(ObjCEncodeExpr *Exp) {
// Create a new string expression.
QualType StrType = Context->getPointerType(Context->CharTy);
std::string StrEncoding;
@@ -1418,7 +1418,7 @@
return Replacement;
}
-Stmt *RewriteTest::RewriteAtSelector(ObjCSelectorExpr *Exp) {
+Stmt *RewriteObjC::RewriteAtSelector(ObjCSelectorExpr *Exp) {
assert(SelGetUidFunctionDecl && "Can't find sel_registerName() decl");
// Create a call to sel_registerName("selName").
llvm::SmallVector<Expr*, 8> SelExprs;
@@ -1434,7 +1434,7 @@
return SelExp;
}
-CallExpr *RewriteTest::SynthesizeCallToFunctionDecl(
+CallExpr *RewriteObjC::SynthesizeCallToFunctionDecl(
FunctionDecl *FD, Expr **args, unsigned nargs) {
// Get the type, we will need to reference it in a couple spots.
QualType msgSendType = FD->getType();
@@ -1480,7 +1480,7 @@
assert(angle == 0 && "scanToNextArgument - bad protocol type syntax");
}
-bool RewriteTest::needToScanForQualifiers(QualType T) {
+bool RewriteObjC::needToScanForQualifiers(QualType T) {
if (T == Context->getObjCIdType())
return true;
@@ -1496,7 +1496,7 @@
return false;
}
-void RewriteTest::RewriteObjCQualifiedInterfaceTypes(Decl *Dcl) {
+void RewriteObjC::RewriteObjCQualifiedInterfaceTypes(Decl *Dcl) {
SourceLocation Loc;
QualType Type;
const FunctionTypeProto *proto = 0;
@@ -1569,7 +1569,7 @@
}
// SynthSelGetUidFunctionDecl - SEL sel_registerName(const char *str);
-void RewriteTest::SynthSelGetUidFunctionDecl() {
+void RewriteObjC::SynthSelGetUidFunctionDecl() {
IdentifierInfo *SelGetUidIdent = &Context->Idents.get("sel_registerName");
llvm::SmallVector<QualType, 16> ArgTys;
ArgTys.push_back(Context->getPointerType(
@@ -1584,7 +1584,7 @@
}
// SynthGetProtocolFunctionDecl - Protocol objc_getProtocol(const char *proto);
-void RewriteTest::SynthGetProtocolFunctionDecl() {
+void RewriteObjC::SynthGetProtocolFunctionDecl() {
IdentifierInfo *SelGetProtoIdent = &Context->Idents.get("objc_getProtocol");
llvm::SmallVector<QualType, 16> ArgTys;
ArgTys.push_back(Context->getPointerType(
@@ -1598,7 +1598,7 @@
FunctionDecl::Extern, false, 0);
}
-void RewriteTest::RewriteFunctionDecl(FunctionDecl *FD) {
+void RewriteObjC::RewriteFunctionDecl(FunctionDecl *FD) {
// declared in <objc/objc.h>
if (strcmp(FD->getName(), "sel_registerName") == 0) {
SelGetUidFunctionDecl = FD;
@@ -1608,7 +1608,7 @@
}
// SynthSuperContructorFunctionDecl - id objc_super(id obj, id super);
-void RewriteTest::SynthSuperContructorFunctionDecl() {
+void RewriteObjC::SynthSuperContructorFunctionDecl() {
if (SuperContructorFunctionDecl)
return;
IdentifierInfo *msgSendIdent = &Context->Idents.get("objc_super");
@@ -1627,7 +1627,7 @@
}
// SynthMsgSendFunctionDecl - id objc_msgSend(id self, SEL op, ...);
-void RewriteTest::SynthMsgSendFunctionDecl() {
+void RewriteObjC::SynthMsgSendFunctionDecl() {
IdentifierInfo *msgSendIdent = &Context->Idents.get("objc_msgSend");
llvm::SmallVector<QualType, 16> ArgTys;
QualType argT = Context->getObjCIdType();
@@ -1646,7 +1646,7 @@
}
// SynthMsgSendSuperFunctionDecl - id objc_msgSendSuper(struct objc_super *, SEL op, ...);
-void RewriteTest::SynthMsgSendSuperFunctionDecl() {
+void RewriteObjC::SynthMsgSendSuperFunctionDecl() {
IdentifierInfo *msgSendIdent = &Context->Idents.get("objc_msgSendSuper");
llvm::SmallVector<QualType, 16> ArgTys;
RecordDecl *RD = RecordDecl::Create(*Context, Decl::Struct, NULL,
@@ -1668,7 +1668,7 @@
}
// SynthMsgSendStretFunctionDecl - id objc_msgSend_stret(id self, SEL op, ...);
-void RewriteTest::SynthMsgSendStretFunctionDecl() {
+void RewriteObjC::SynthMsgSendStretFunctionDecl() {
IdentifierInfo *msgSendIdent = &Context->Idents.get("objc_msgSend_stret");
llvm::SmallVector<QualType, 16> ArgTys;
QualType argT = Context->getObjCIdType();
@@ -1688,7 +1688,7 @@
// SynthMsgSendSuperStretFunctionDecl -
// id objc_msgSendSuper_stret(struct objc_super *, SEL op, ...);
-void RewriteTest::SynthMsgSendSuperStretFunctionDecl() {
+void RewriteObjC::SynthMsgSendSuperStretFunctionDecl() {
IdentifierInfo *msgSendIdent =
&Context->Idents.get("objc_msgSendSuper_stret");
llvm::SmallVector<QualType, 16> ArgTys;
@@ -1711,7 +1711,7 @@
}
// SynthMsgSendFpretFunctionDecl - id objc_msgSend_fpret(id self, SEL op, ...);
-void RewriteTest::SynthMsgSendFpretFunctionDecl() {
+void RewriteObjC::SynthMsgSendFpretFunctionDecl() {
IdentifierInfo *msgSendIdent = &Context->Idents.get("objc_msgSend_fpret");
llvm::SmallVector<QualType, 16> ArgTys;
QualType argT = Context->getObjCIdType();
@@ -1730,7 +1730,7 @@
}
// SynthGetClassFunctionDecl - id objc_getClass(const char *name);
-void RewriteTest::SynthGetClassFunctionDecl() {
+void RewriteObjC::SynthGetClassFunctionDecl() {
IdentifierInfo *getClassIdent = &Context->Idents.get("objc_getClass");
llvm::SmallVector<QualType, 16> ArgTys;
ArgTys.push_back(Context->getPointerType(
@@ -1745,7 +1745,7 @@
}
// SynthGetMetaClassFunctionDecl - id objc_getClass(const char *name);
-void RewriteTest::SynthGetMetaClassFunctionDecl() {
+void RewriteObjC::SynthGetMetaClassFunctionDecl() {
IdentifierInfo *getClassIdent = &Context->Idents.get("objc_getMetaClass");
llvm::SmallVector<QualType, 16> ArgTys;
ArgTys.push_back(Context->getPointerType(
@@ -1759,7 +1759,7 @@
FunctionDecl::Extern, false, 0);
}
-Stmt *RewriteTest::RewriteObjCStringLiteral(ObjCStringLiteral *Exp) {
+Stmt *RewriteObjC::RewriteObjCStringLiteral(ObjCStringLiteral *Exp) {
QualType strType = getConstantStringStructType();
std::string S = "__NSConstantStringImpl_";
@@ -1790,7 +1790,7 @@
return cast;
}
-ObjCInterfaceDecl *RewriteTest::isSuperReceiver(Expr *recExpr) {
+ObjCInterfaceDecl *RewriteObjC::isSuperReceiver(Expr *recExpr) {
// check if we are sending a message to 'super'
if (!CurMethodDecl || !CurMethodDecl->isInstance()) return 0;
@@ -1822,7 +1822,7 @@
}
// struct objc_super { struct objc_object *receiver; struct objc_class *super; };
-QualType RewriteTest::getSuperStructType() {
+QualType RewriteObjC::getSuperStructType() {
if (!SuperStructDecl) {
SuperStructDecl = RecordDecl::Create(*Context, Decl::Struct, NULL,
SourceLocation(),
@@ -1845,7 +1845,7 @@
return Context->getTagDeclType(SuperStructDecl);
}
-QualType RewriteTest::getConstantStringStructType() {
+QualType RewriteObjC::getConstantStringStructType() {
if (!ConstantStringDecl) {
ConstantStringDecl = RecordDecl::Create(*Context, Decl::Struct, NULL,
SourceLocation(),
@@ -1872,7 +1872,7 @@
return Context->getTagDeclType(ConstantStringDecl);
}
-Stmt *RewriteTest::SynthMessageExpr(ObjCMessageExpr *Exp) {
+Stmt *RewriteObjC::SynthMessageExpr(ObjCMessageExpr *Exp) {
if (!SelGetUidFunctionDecl)
SynthSelGetUidFunctionDecl();
if (!MsgSendFunctionDecl)
@@ -2171,7 +2171,7 @@
return ReplacingStmt;
}
-Stmt *RewriteTest::RewriteMessageExpr(ObjCMessageExpr *Exp) {
+Stmt *RewriteObjC::RewriteMessageExpr(ObjCMessageExpr *Exp) {
Stmt *ReplacingStmt = SynthMessageExpr(Exp);
// Now do the actual rewrite.
ReplaceStmt(Exp, ReplacingStmt);
@@ -2182,7 +2182,7 @@
/// RewriteObjCProtocolExpr - Rewrite a protocol expression into
/// call to objc_getProtocol("proto-name").
-Stmt *RewriteTest::RewriteObjCProtocolExpr(ObjCProtocolExpr *Exp) {
+Stmt *RewriteObjC::RewriteObjCProtocolExpr(ObjCProtocolExpr *Exp) {
if (!GetProtocolFunctionDecl)
SynthGetProtocolFunctionDecl();
// Create a call to objc_getProtocol("ProtocolName").
@@ -2203,7 +2203,7 @@
/// SynthesizeObjCInternalStruct - Rewrite one internal struct corresponding to
/// an objective-c class with ivars.
-void RewriteTest::SynthesizeObjCInternalStruct(ObjCInterfaceDecl *CDecl,
+void RewriteObjC::SynthesizeObjCInternalStruct(ObjCInterfaceDecl *CDecl,
std::string &Result) {
assert(CDecl && "Class missing in SynthesizeObjCInternalStruct");
assert(CDecl->getName() && "Name missing in SynthesizeObjCInternalStruct");
@@ -2301,7 +2301,7 @@
// RewriteObjCMethodsMetaData - Rewrite methods metadata for instance or
/// class methods.
-void RewriteTest::RewriteObjCMethodsMetaData(instmeth_iterator MethodBegin,
+void RewriteObjC::RewriteObjCMethodsMetaData(instmeth_iterator MethodBegin,
instmeth_iterator MethodEnd,
bool IsInstanceMethod,
const char *prefix,
@@ -2373,7 +2373,7 @@
}
/// RewriteObjCProtocolsMetaData - Rewrite protocols meta-data.
-void RewriteTest::RewriteObjCProtocolsMetaData(ObjCProtocolDecl **Protocols,
+void RewriteObjC::RewriteObjCProtocolsMetaData(ObjCProtocolDecl **Protocols,
int NumProtocols,
const char *prefix,
const char *ClassName,
@@ -2546,7 +2546,7 @@
/// RewriteObjCCategoryImplDecl - Rewrite metadata for each category
/// implementation.
-void RewriteTest::RewriteObjCCategoryImplDecl(ObjCCategoryImplDecl *IDecl,
+void RewriteObjC::RewriteObjCCategoryImplDecl(ObjCCategoryImplDecl *IDecl,
std::string &Result) {
ObjCInterfaceDecl *ClassDecl = IDecl->getClassInterface();
// Find category declaration for this implementation.
@@ -2641,7 +2641,7 @@
/// SynthesizeIvarOffsetComputation - This rutine synthesizes computation of
/// ivar offset.
-void RewriteTest::SynthesizeIvarOffsetComputation(ObjCImplementationDecl *IDecl,
+void RewriteObjC::SynthesizeIvarOffsetComputation(ObjCImplementationDecl *IDecl,
ObjCIvarDecl *ivar,
std::string &Result) {
Result += "offsetof(struct ";
@@ -2657,7 +2657,7 @@
// Meta Data Emission
//===----------------------------------------------------------------------===//
-void RewriteTest::RewriteObjCClassMetaData(ObjCImplementationDecl *IDecl,
+void RewriteObjC::RewriteObjCClassMetaData(ObjCImplementationDecl *IDecl,
std::string &Result) {
ObjCInterfaceDecl *CDecl = IDecl->getClassInterface();
@@ -2893,7 +2893,7 @@
/// RewriteImplementations - This routine rewrites all method implementations
/// and emits meta-data.
-void RewriteTest::RewriteImplementations(std::string &Result) {
+void RewriteObjC::RewriteImplementations(std::string &Result) {
int ClsDefCount = ClassImplementation.size();
int CatDefCount = CategoryImplementation.size();
Modified: cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/clang.cpp?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/Driver/clang.cpp (original)
+++ cfe/trunk/Driver/clang.cpp Mon Apr 14 17:03:09 2008
@@ -61,7 +61,7 @@
llvm::cl::desc("Print performance metrics and statistics"));
enum ProgActions {
- RewriteTest, // Rewriter testing stuff.
+ RewriteObjC, // ObjC->C Rewriter.
HTMLTest, // HTML displayer testing stuff.
EmitLLVM, // Emit a .ll file.
EmitBC, // Emit a .bc file.
@@ -134,7 +134,7 @@
"Build ASTs then convert to LLVM, emit .bc file"),
clEnumValN(SerializeAST, "serialize",
"Build ASTs and emit .ast file"),
- clEnumValN(RewriteTest, "rewrite-test",
+ clEnumValN(RewriteObjC, "rewrite-objc",
"Playground for the code rewriter"),
clEnumValN(HTMLTest, "html-test",
"Playground for the HTML displayer"),
@@ -1088,7 +1088,7 @@
// FIXME: Allow user to tailor where the file is written.
return CreateASTSerializer(InFile, OutputFile, Diag, LangOpts);
- case RewriteTest:
+ case RewriteObjC:
return CreateCodeRewriterTest(InFile, OutputFile, Diag, LangOpts);
}
}
Modified: cfe/trunk/test/Rewriter/id-test-3.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/id-test-3.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/id-test-3.m (original)
+++ cfe/trunk/test/Rewriter/id-test-3.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@protocol P
- (id<P>) Meth: (id<P>) Arg;
Modified: cfe/trunk/test/Rewriter/ivar-encoding-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/ivar-encoding-1.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/ivar-encoding-1.m (original)
+++ cfe/trunk/test/Rewriter/ivar-encoding-1.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@interface Intf
{
Modified: cfe/trunk/test/Rewriter/ivar-encoding-2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/ivar-encoding-2.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/ivar-encoding-2.m (original)
+++ cfe/trunk/test/Rewriter/ivar-encoding-2.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@implementation Intf
{
Modified: cfe/trunk/test/Rewriter/metadata-test-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/metadata-test-1.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/metadata-test-1.m (original)
+++ cfe/trunk/test/Rewriter/metadata-test-1.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@interface Intf
@end
Modified: cfe/trunk/test/Rewriter/metadata-test-2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/metadata-test-2.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/metadata-test-2.m (original)
+++ cfe/trunk/test/Rewriter/metadata-test-2.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
typedef struct _NSPoint {
float x;
Modified: cfe/trunk/test/Rewriter/method-encoding-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/method-encoding-1.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/method-encoding-1.m (original)
+++ cfe/trunk/test/Rewriter/method-encoding-1.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@protocol P1
- (void) MyProtoMeth : (int **) arg1 : (void*) arg2;
Modified: cfe/trunk/test/Rewriter/objc-encoding-bug-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/objc-encoding-bug-1.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/objc-encoding-bug-1.m (original)
+++ cfe/trunk/test/Rewriter/objc-encoding-bug-1.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
typedef struct NSMethodFrameArgInfo {
struct NSMethodFrameArgInfo *subInfo;
Modified: cfe/trunk/test/Rewriter/objc-ivar-receiver-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/objc-ivar-receiver-1.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/objc-ivar-receiver-1.m (original)
+++ cfe/trunk/test/Rewriter/objc-ivar-receiver-1.m Mon Apr 14 17:03:09 2008
@@ -1,5 +1,5 @@
-// RUN: clang -rewrite-test %s -o -
-// RUN: clang -rewrite-test %s -o - | grep 'newInv->_container'
+// RUN: clang -rewrite-objc %s -o -
+// RUN: clang -rewrite-objc %s -o - | grep 'newInv->_container'
@interface NSMutableArray
- (void)addObject:(id)addObject;
Modified: cfe/trunk/test/Rewriter/objc-string-concat-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/objc-string-concat-1.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/objc-string-concat-1.m (original)
+++ cfe/trunk/test/Rewriter/objc-string-concat-1.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@class NSString;
Modified: cfe/trunk/test/Rewriter/objc-super-test.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/objc-super-test.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/objc-super-test.m (original)
+++ cfe/trunk/test/Rewriter/objc-super-test.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@interface SUPER
- (int) MainMethod;
Modified: cfe/trunk/test/Rewriter/objc-synchronized-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/objc-synchronized-1.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/objc-synchronized-1.m (original)
+++ cfe/trunk/test/Rewriter/objc-synchronized-1.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
id SYNCH_EXPR();
void SYNCH_BODY();
Modified: cfe/trunk/test/Rewriter/protocol-rewrite-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/protocol-rewrite-1.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/protocol-rewrite-1.m (original)
+++ cfe/trunk/test/Rewriter/protocol-rewrite-1.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
typedef struct MyWidget {
int a;
Modified: cfe/trunk/test/Rewriter/rewrite-api-bug.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/rewrite-api-bug.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/rewrite-api-bug.m (original)
+++ cfe/trunk/test/Rewriter/rewrite-api-bug.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@interface MyDerived
- (void) instanceMethod;
Modified: cfe/trunk/test/Rewriter/rewrite-foreach-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/rewrite-foreach-1.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/rewrite-foreach-1.m (original)
+++ cfe/trunk/test/Rewriter/rewrite-foreach-1.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@protocol P @end
Modified: cfe/trunk/test/Rewriter/rewrite-foreach-2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/rewrite-foreach-2.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/rewrite-foreach-2.m (original)
+++ cfe/trunk/test/Rewriter/rewrite-foreach-2.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@protocol P @end
Modified: cfe/trunk/test/Rewriter/rewrite-foreach-3.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/rewrite-foreach-3.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/rewrite-foreach-3.m (original)
+++ cfe/trunk/test/Rewriter/rewrite-foreach-3.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@protocol P @end
Modified: cfe/trunk/test/Rewriter/rewrite-foreach-4.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/rewrite-foreach-4.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/rewrite-foreach-4.m (original)
+++ cfe/trunk/test/Rewriter/rewrite-foreach-4.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@interface MyList
- (id) allKeys;
Modified: cfe/trunk/test/Rewriter/rewrite-foreach-5.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/rewrite-foreach-5.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/rewrite-foreach-5.m (original)
+++ cfe/trunk/test/Rewriter/rewrite-foreach-5.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@interface MyList
- (id) allKeys;
Modified: cfe/trunk/test/Rewriter/rewrite-foreach-6.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/rewrite-foreach-6.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/rewrite-foreach-6.m (original)
+++ cfe/trunk/test/Rewriter/rewrite-foreach-6.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang %s -rewrite-test -o=-
+// RUN: clang %s -rewrite-objc -o=-
// rdar://5716356
// FIXME: Should be able to pipe into clang, but code is not
// yet correct for other reasons: rdar://5716940
Modified: cfe/trunk/test/Rewriter/rewrite-protocol-type-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/rewrite-protocol-type-1.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/rewrite-protocol-type-1.m (original)
+++ cfe/trunk/test/Rewriter/rewrite-protocol-type-1.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@protocol MyProto1
@end
Modified: cfe/trunk/test/Rewriter/rewrite-try-catch.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/rewrite-try-catch.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/rewrite-try-catch.m (original)
+++ cfe/trunk/test/Rewriter/rewrite-try-catch.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@interface Foo @end
@interface GARF @end
Modified: cfe/trunk/test/Rewriter/static-type-protocol-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/static-type-protocol-1.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/static-type-protocol-1.m (original)
+++ cfe/trunk/test/Rewriter/static-type-protocol-1.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@protocol Proto
- (void) ProtoDidget;
Modified: cfe/trunk/test/Rewriter/undecl-objc-h.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/undecl-objc-h.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/undecl-objc-h.m (original)
+++ cfe/trunk/test/Rewriter/undecl-objc-h.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
typedef struct S {
int * pint;
Modified: cfe/trunk/test/Rewriter/undeclared-method-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/undeclared-method-1.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/undeclared-method-1.m (original)
+++ cfe/trunk/test/Rewriter/undeclared-method-1.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@interface Derived @end
Modified: cfe/trunk/test/Rewriter/undef-field-reference-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/undef-field-reference-1.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/undef-field-reference-1.m (original)
+++ cfe/trunk/test/Rewriter/undef-field-reference-1.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
@interface MyDerived
{
Modified: cfe/trunk/test/Rewriter/va-method.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/va-method.m?rev=49692&r1=49691&r2=49692&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/va-method.m (original)
+++ cfe/trunk/test/Rewriter/va-method.m Mon Apr 14 17:03:09 2008
@@ -1,4 +1,4 @@
-// RUN: clang -rewrite-test %s -o=-
+// RUN: clang -rewrite-objc %s -o=-
#include <stdarg.h>
More information about the cfe-commits
mailing list