}
}
+<<<<<<< local
+ // TODO(dvyukov): ideally this should be:
+ // racefuncenter(getreturnaddress())
+ // because it's much more costly to obtain from runtime library.
+ nd = mkcall("racefuncenter", T, nil);
+ fn->enter = concat(list1(nd), fn->enter);
+=======
// nodpc is the PC of the caller as extracted by
// getcallerpc. We use -widthptr(FP) for x86.
// BUG: this will not work on arm.
nodpc->xoffset = -widthptr;
nd = mkcall("racefuncenter", T, nil, nodpc);
fn->enter = list(fn->enter, nd);
+>>>>>>> other
nd = mkcall("racefuncexit", T, nil);
- fn->exit = list(fn->exit, nd); // works fine if (!fn->exit)
+ fn->exit = list(fn->exit, nd);
racewalklist(curfn->nbody, nil);
if(debug['W']) {
snprint(s, sizeof(s), "after racewalk %S", curfn->nname->sym);
dumplist(s, curfn->nbody);
+ snprint(s, sizeof(s), "after walk %S", curfn->nname->sym);
+ dumplist(s, curfn->nbody);
+ snprint(s, sizeof(s), "enter %S", curfn->nname->sym);
+ dumplist(s, curfn->enter);
}
}
case OSWITCH:
if(n->ntest->op == OTYPESW)
- // don't bother, we have static typization
+ // TODO(dvyukov): the expression can contain calls or reads.
return;
racewalknode(&n->ntest, &n->ninit, 0, 0);
racewalklist(n->nbody, nil);
if(n->op == ONAME) {
if(n->sym != S) {
if(n->sym->name != nil) {
- if(strncmp(n->sym->name, "_", sizeof("_")-1) == 0)
+ if(strcmp(n->sym->name, "_") == 0)
return 0;
if(strncmp(n->sym->name, "autotmp_", sizeof("autotmp_")-1) == 0)
return 0;
if(t->etype == TSTRUCT) {
res = 0;
for(t1=t->type; t1; t1=t1->down) {
- if(t1->sym && strncmp(t1->sym->name, "_", sizeof("_")-1)) {
+ if(t1->sym && strcmp(t1->sym->name, "_")) {
n = treecopy(n);
f = nod(OXDOT, n, newname(t1->sym));
if(callinstr(f, init, wr, 0)) {