diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-02 02:00:30 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-02 02:00:30 +0000 |
commit | 61cc296de6c1f82fa84c0abb3ecd142a584838ef (patch) | |
tree | 02c829395b865054d489712aed272872decbd8f9 /lib/Rewrite/RewriteObjC.cpp | |
parent | ec1a58b201b3276966aaade8ac3ac4705aba96c2 (diff) |
Fix canonicalization of protocol-qualified types
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147421 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/RewriteObjC.cpp')
-rw-r--r-- | lib/Rewrite/RewriteObjC.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp index 19277e8ea4..5cf1b11ad9 100644 --- a/lib/Rewrite/RewriteObjC.cpp +++ b/lib/Rewrite/RewriteObjC.cpp @@ -990,7 +990,8 @@ void RewriteObjC::RewriteCategoryDecl(ObjCCategoryDecl *CatDecl) { void RewriteObjC::RewriteProtocolDecl(ObjCProtocolDecl *PDecl) { SourceLocation LocStart = PDecl->getLocStart(); - + assert(PDecl->isThisDeclarationADefinition()); + // FIXME: handle protocol headers that are declared across multiple lines. ReplaceText(LocStart, 0, "// "); @@ -5223,6 +5224,9 @@ void RewriteObjCFragileABI::RewriteObjCProtocolMetaData( if (ObjCSynthesizedProtocols.count(PDecl->getCanonicalDecl())) return; + if (ObjCProtocolDecl *Def = PDecl->getDefinition()) + PDecl = Def; + if (PDecl->instmeth_begin() != PDecl->instmeth_end()) { unsigned NumMethods = std::distance(PDecl->instmeth_begin(), PDecl->instmeth_end()); |