forked from OSchip/llvm-project
-Add several ObjC types to Decl::getDeclKindName(), a useful debug hook.
-Start adding support for rewriting @synthesize. llvm-svn: 60368
This commit is contained in:
parent
e912266bdb
commit
e1908e393e
|
@ -169,6 +169,7 @@ namespace {
|
|||
void RewriteInclude();
|
||||
void RewriteTabs();
|
||||
void RewriteForwardClassDecl(ObjCClassDecl *Dcl);
|
||||
void RewritePropertyImplDecl(ObjCPropertyImplDecl *PID);
|
||||
void RewriteInterfaceDecl(ObjCInterfaceDecl *Dcl);
|
||||
void RewriteImplementationDecl(NamedDecl *Dcl);
|
||||
void RewriteObjCMethodDecl(ObjCMethodDecl *MDecl, std::string &ResultStr);
|
||||
|
@ -585,6 +586,10 @@ void RewriteObjC::RewriteTabs() {
|
|||
}
|
||||
}
|
||||
|
||||
void RewriteObjC::RewritePropertyImplDecl(ObjCPropertyImplDecl *PID) {
|
||||
SourceLocation startLoc = PID->getLocStart();
|
||||
InsertText(startLoc, "// ", 3);
|
||||
}
|
||||
|
||||
void RewriteObjC::RewriteForwardClassDecl(ObjCClassDecl *ClassDecl) {
|
||||
int numDecls = ClassDecl->getNumForwardDecls();
|
||||
|
@ -864,6 +869,12 @@ void RewriteObjC::RewriteImplementationDecl(NamedDecl *OID) {
|
|||
ReplaceText(LocStart, endBuf-startBuf,
|
||||
ResultStr.c_str(), ResultStr.size());
|
||||
}
|
||||
for (ObjCCategoryImplDecl::propimpl_iterator
|
||||
I = IMD ? IMD->propimpl_begin() : CID->propimpl_begin(),
|
||||
E = IMD ? IMD->propimpl_end() : CID->propimpl_end(); I != E; ++I) {
|
||||
RewritePropertyImplDecl(*I);
|
||||
}
|
||||
|
||||
if (IMD)
|
||||
InsertText(IMD->getLocEnd(), "// ", 3);
|
||||
else
|
||||
|
|
|
@ -1311,6 +1311,8 @@ public:
|
|||
Kind PK,
|
||||
ObjCIvarDecl *ivarDecl);
|
||||
|
||||
SourceLocation getLocStart() const { return AtLoc; }
|
||||
|
||||
ObjCPropertyDecl *getPropertyDecl() const {
|
||||
return PropertyDecl;
|
||||
}
|
||||
|
|
|
@ -72,9 +72,12 @@ const char *Decl::getDeclKindName() const {
|
|||
case EnumConstant: return "EnumConstant";
|
||||
case ObjCIvar: return "ObjCIvar";
|
||||
case ObjCInterface: return "ObjCInterface";
|
||||
case ObjCImplementation: return "ObjCImplementation";
|
||||
case ObjCClass: return "ObjCClass";
|
||||
case ObjCMethod: return "ObjCMethod";
|
||||
case ObjCProtocol: return "ObjCProtocol";
|
||||
case ObjCProperty: return "ObjCProperty";
|
||||
case ObjCPropertyImpl: return "ObjCPropertyImpl";
|
||||
case ObjCForwardProtocol: return "ObjCForwardProtocol";
|
||||
case Record: return "Record";
|
||||
case CXXRecord: return "CXXRecord";
|
||||
|
|
Loading…
Reference in New Issue