~ubuntu-branches/ubuntu/saucy/golang/saucy

« back to all changes in this revision

Viewing changes to src/cmd/gc/inl.c

  • Committer: Package Import Robot
  • Author(s): Ondřej Surý, Ondřej Surý, Michael Stapelberg
  • Date: 2012-06-28 12:14:15 UTC
  • mfrom: (1.1.15)
  • Revision ID: package-import@ubuntu.com-20120628121415-w1b0076ixkarr1ml
[ Ondřej Surý ]
* Imported Upstream version 1.0.2
* Update Vcs fields to reflect new git repository location
* Kill get-orig-source, since 1.0.0, the tarballs can be downloaded
  from webpage

[ Michael Stapelberg ]
* golang-mode: use debian-pkg-add-load-path-item (Closes: #664802)
* Add manpages (Closes: #632964)
* Use updated pt.po from Pedro Ribeiro (Closes: #674958)

Show diffs side-by-side

added added

removed removed

Lines of Context:
506
506
        mkinlcall1(np, fn);
507
507
        safemode = save_safemode;
508
508
}
 
509
 
 
510
static Node*
 
511
tinlvar(Type *t)
 
512
{
 
513
        if(t->nname && !isblank(t->nname)) {
 
514
                if(!t->nname->inlvar)
 
515
                        fatal("missing inlvar for %N\n", t->nname);
 
516
                return t->nname->inlvar;
 
517
        }
 
518
        typecheck(&nblank, Erv | Easgn);
 
519
        return nblank;
 
520
}
 
521
 
509
522
// if *np is a call, and fn is a function with an inlinable body, substitute *np with an OINLCALL.
510
523
// On return ninit has the parameter assignments, the nbody is the
511
524
// inlined function body and list, rlist contain the input, output
579
592
                                fatal("method call without receiver: %+N", n);
580
593
                        if(t == T)
581
594
                                fatal("method call unknown receiver type: %+N", n);
582
 
                        if(t->nname != N && !isblank(t->nname))
583
 
                                as = nod(OAS, t->nname->inlvar, n->left->left);
584
 
                        else
585
 
                                as = nod(OAS, temp(t->type), n->left->left);
 
595
                        as = nod(OAS, tinlvar(t), n->left->left);
586
596
                } else {  // non-method call to method
587
 
                        if (!n->list)
 
597
                        if(!n->list)
588
598
                                fatal("non-method call to method without first arg: %+N", n);
589
 
                        if(t != T && t->nname != N && !isblank(t->nname))
590
 
                                as = nod(OAS, t->nname->inlvar, n->list->n);
 
599
                        if(t != T)
 
600
                                as = nod(OAS, tinlvar(t), n->list->n);
591
601
                }
592
602
 
593
603
                if(as != N) {
601
611
                // TODO check that n->list->n is a call?
602
612
                // TODO: non-method call to T.meth(f()) where f returns t, args...
603
613
                as->rlist = n->list;
604
 
                for(t = getinargx(fn->type)->type; t; t=t->down) {
605
 
                        if(t->nname && !isblank(t->nname)) {
606
 
                                if(!t->nname->inlvar)
607
 
                                        fatal("missing inlvar for %N\n", t->nname);
608
 
                                as->list = list(as->list, t->nname->inlvar);
609
 
                        } else {
610
 
                                as->list = list(as->list, temp(t->type));
611
 
                        }
612
 
                }               
 
614
                for(t = getinargx(fn->type)->type; t; t=t->down)
 
615
                        as->list = list(as->list, tinlvar(t));          
613
616
        } else {
614
617
                ll = n->list;
615
618
                if(fn->type->thistuple && n->left->op != ODOTMETH) // non method call to method
616
619
                        ll=ll->next;  // was handled above in if(thistuple)
617
620
 
618
621
                for(t = getinargx(fn->type)->type; t && ll; t=t->down) {
619
 
                        if(t->nname && !isblank(t->nname)) {
620
 
                                if(!t->nname->inlvar)
621
 
                                        fatal("missing inlvar for %N\n", t->nname);
622
 
                                as->list = list(as->list, t->nname->inlvar);
623
 
                                as->rlist = list(as->rlist, ll->n);
624
 
                        }
 
622
                        as->list = list(as->list, tinlvar(t));
 
623
                        as->rlist = list(as->rlist, ll->n);
625
624
                        ll=ll->next;
626
625
                }
627
626
                if(ll || t)