bootstrapping

This commit is contained in:
Vitor Santos Costa
2018-01-22 13:53:17 +00:00
parent fdf7bb516f
commit 9fce1e9ba2
23 changed files with 1479 additions and 3330 deletions

View File

@@ -3513,14 +3513,20 @@ yamop *Yap_cclause(volatile Term inp_clause, Int NOfArgs, Term mod,
LOCAL_ErrorMessage = "clause head should be atom or compound term";
return (0);
} else {
loop:
/* find out which predicate we are compiling for */
if (IsAtomTerm(head)) {
Atom ap = AtomOfTerm(head);
cglobs.cint.CurrentPred = RepPredProp(PredPropByAtom(ap, mod));
} else {
Functor f = FunctorOfTerm(head);
if (f == FunctorModule) {
mod = ArgOfTerm(1,head);
head = ArgOfTerm(2,head);
goto loop;
}
cglobs.cint.CurrentPred =
RepPredProp(PredPropByFunc(FunctorOfTerm(head), mod));
RepPredProp(PredPropByFunc(f, mod));
}
/* insert extra instructions to count calls */
PELOCK(52, cglobs.cint.CurrentPred);