Implement debug info for willset/didset, and teach dispatch to be non-virtual

to didset/will set since we don't drop these in the class vtable.


Swift SVN r13056
This commit is contained in:
Chris Lattner
2014-01-28 06:33:31 +00:00
parent 7bcf701ee1
commit 290a58494e
7 changed files with 22 additions and 8 deletions

View File

@@ -800,7 +800,10 @@ public:
// FIXME: Or if it's an ObjC method. Extension methods on classes will
// hopefully become dynamically dispatched too.
if (auto *fd = dyn_cast<FuncDecl>(e->getDecl())) {
if (isa<ClassDecl>(fd->getDeclContext()) || fd->isObjC()) {
if (fd->isObjC() ||
(isa<ClassDecl>(fd->getDeclContext()) &&
// didSet and willSet methods can always be directly dispatched.
!fd->isDidSetWillSet())) {
ApplyExpr *thisCallSite = callSites.back();
callSites.pop_back();
setSelfParam(gen.emitRValue(thisCallSite->getArg()), thisCallSite);