Skip to content

Commit

Permalink
When we insert a category (or class extension) into an interface, mark
Browse files Browse the repository at this point in the history
the interface as having changed since it was originally
serialized. This ensures that we see class extensions/categories in
chained PCH files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115421 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
DougGregor committed Oct 2, 2010
1 parent fe08e40 commit 5e9888c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/clang/AST/DeclObjC.h
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,7 @@ class ObjCCategoryDecl : public ObjCContainerDecl {
void insertNextClassCategory() {
NextClassCategory = ClassInterface->getCategoryList();
ClassInterface->setCategoryList(this);
ClassInterface->setChangedSinceDeserialization(true);
}

bool IsClassExtension() const { return getIdentifier() == 0; }
Expand Down
4 changes: 4 additions & 0 deletions test/PCH/Inputs/chain-selectors1.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ void foo1() {
//(void)@selector(x);
(void)@selector(f);
}

@interface X (Blah)
- (void)blah_method;
@end
4 changes: 4 additions & 0 deletions test/PCH/Inputs/chain-selectors2.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ void foo2() {
//(void)@selector(y);
//(void)@selector(e);
}

@interface X (Blarg)
- (void)blarg_method;
@end
16 changes: 16 additions & 0 deletions test/PCH/chain-selectors.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,19 @@ void bar() {
(void)@selector(y); // expected-warning {{unimplemented selector}}
(void)@selector(e); // expected-warning {{unimplemented selector}}
}

@implementation X (Blah)
- (void)test_Blah {
[self blah_method];
}

- (void)blah_method { }
@end

@implementation X (Blarg)
- (void)test_Blarg {
[self blarg_method];
}

- (void)blarg_method { }
@end

0 comments on commit 5e9888c

Please sign in to comment.