From 70bde4d38f8c14c7fe1473da1142a7283183c908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Fri, 29 Jun 2012 22:44:08 +0100 Subject: [PATCH] inline extern patch by Denys Duchier --- H/Regs.h | 14 +- H/Tags_24bits.h | 24 ++-- H/Tags_32LowTag.h | 26 ++-- H/Tags_32Ops.h | 41 +++--- H/Tags_32bits.h | 26 ++-- H/Tags_64bits.h | 26 ++-- H/TermExt.h | 77 +++++----- H/Yap.h | 1 + H/YapCompoundTerm.h | 18 +-- H/YapHeap.h | 5 + H/YapTags.h | 40 +++--- H/Yatom.h | 14 +- H/absmi.h | 6 + H/amiops.h | 14 +- H/clause.h | 3 +- H/eval.h | 6 +- H/inline-only.h | 10 ++ H/sshift.h | 193 +++++++++++++------------- H/yapio.h | 7 +- Makefile.in | 3 +- library/dialect/bprolog/fli/bprolog.h | 9 +- packages/prism/src/c/core/bpx.h | 24 ++-- 22 files changed, 318 insertions(+), 269 deletions(-) create mode 100644 H/inline-only.h diff --git a/H/Regs.h b/H/Regs.h index dc26d33c6..111a43440 100644 --- a/H/Regs.h +++ b/H/Regs.h @@ -73,12 +73,14 @@ #endif #endif -EXTERN void restore_machine_regs(void); -EXTERN void save_machine_regs(void); -EXTERN void restore_H(void); -EXTERN void save_H(void); -EXTERN void restore_B(void); -EXTERN void save_B(void); +#include "inline-only.h" + +inline EXTERN void restore_machine_regs(void) INLINE_ONLY; +inline EXTERN void save_machine_regs(void) INLINE_ONLY; +inline EXTERN void restore_H(void) INLINE_ONLY; +inline EXTERN void save_H(void) INLINE_ONLY; +inline EXTERN void restore_B(void) INLINE_ONLY; +inline EXTERN void save_B(void) INLINE_ONLY; #define CACHE_REGS #define INIT_REGS diff --git a/H/Tags_24bits.h b/H/Tags_24bits.h index 00412db3c..be184b331 100644 --- a/H/Tags_24bits.h +++ b/H/Tags_24bits.h @@ -65,8 +65,8 @@ /* bits that should not be used by anyone but us */ #define YAP_PROTECTED_MASK 0x00000000L - -inline EXTERN int IsVarTerm (Term); +#include "inline-only.h" +inline EXTERN int IsVarTerm (Term) INLINE_ONLY; inline EXTERN int IsVarTerm (Term t) @@ -76,7 +76,7 @@ IsVarTerm (Term t) -inline EXTERN int IsNonVarTerm (Term); +inline EXTERN int IsNonVarTerm (Term) INLINE_ONLY; inline EXTERN int IsNonVarTerm (Term t) @@ -86,7 +86,7 @@ IsNonVarTerm (Term t) -inline EXTERN Term *RepPair (Term); +inline EXTERN Term *RepPair (Term) INLINE_ONLY; inline EXTERN Term * RepPair (Term t) @@ -96,7 +96,7 @@ RepPair (Term t) -inline EXTERN Term AbsPair (Term *); +inline EXTERN Term AbsPair (Term *) INLINE_ONLY; inline EXTERN Term AbsPair (Term * p) @@ -106,7 +106,7 @@ AbsPair (Term * p) -inline EXTERN Int IsPairTerm (Term); +inline EXTERN Int IsPairTerm (Term) INLINE_ONLY; inline EXTERN Int IsPairTerm (Term t) @@ -116,7 +116,7 @@ IsPairTerm (Term t) -inline EXTERN Term *RepAppl (Term); +inline EXTERN Term *RepAppl (Term) INLINE_ONLY; inline EXTERN Term * RepAppl (Term t) @@ -126,7 +126,7 @@ RepAppl (Term t) -inline EXTERN Term AbsAppl (Term *); +inline EXTERN Term AbsAppl (Term *) INLINE_ONLY; inline EXTERN Term AbsAppl (Term * p) @@ -136,7 +136,7 @@ AbsAppl (Term * p) -inline EXTERN Int IsApplTerm (Term); +inline EXTERN Int IsApplTerm (Term) INLINE_ONLY; inline EXTERN Int IsApplTerm (Term t) @@ -146,7 +146,7 @@ IsApplTerm (Term t) -inline EXTERN Int IsAtomOrIntTerm (Term); +inline EXTERN Int IsAtomOrIntTerm (Term) INLINE_ONLY; inline EXTERN Int IsAtomOrIntTerm (Term t) @@ -157,7 +157,7 @@ IsAtomOrIntTerm (Term t) -inline EXTERN Term AdjustPtr (Term t, Term off); +inline EXTERN Term AdjustPtr (Term t, Term off) INLINE_ONLY; inline EXTERN Term AdjustPtr (Term t, Term off) @@ -167,7 +167,7 @@ AdjustPtr (Term t, Term off) -inline EXTERN Term AdjustIDBPtr (Term t, Term off); +inline EXTERN Term AdjustIDBPtr (Term t, Term off) INLINE_ONLY; inline EXTERN Term AdjustIDBPtr (Term t, Term off) diff --git a/H/Tags_32LowTag.h b/H/Tags_32LowTag.h index b5ca8c28d..609989293 100644 --- a/H/Tags_32LowTag.h +++ b/H/Tags_32LowTag.h @@ -76,8 +76,8 @@ /* bits that should not be used by anyone but us */ #define YAP_PROTECTED_MASK 0xc0000000L - -inline EXTERN int IsVarTerm (Term); +#include "inline-only.h" +inline EXTERN int IsVarTerm (Term) INLINE_ONLY; inline EXTERN int IsVarTerm (Term t) @@ -87,7 +87,7 @@ IsVarTerm (Term t) -inline EXTERN int IsNonVarTerm (Term); +inline EXTERN int IsNonVarTerm (Term) INLINE_ONLY; inline EXTERN int IsNonVarTerm (Term t) @@ -97,7 +97,7 @@ IsNonVarTerm (Term t) -inline EXTERN Term *RepPair (Term); +inline EXTERN Term *RepPair (Term) INLINE_ONLY; inline EXTERN Term * RepPair (Term t) @@ -107,7 +107,7 @@ RepPair (Term t) -inline EXTERN Term AbsPair (Term *); +inline EXTERN Term AbsPair (Term *) INLINE_ONLY; inline EXTERN Term AbsPair (Term * p) @@ -117,7 +117,7 @@ AbsPair (Term * p) -inline EXTERN Int IsPairTerm (Term); +inline EXTERN Int IsPairTerm (Term) INLINE_ONLY; inline EXTERN Int IsPairTerm (Term t) @@ -127,7 +127,7 @@ IsPairTerm (Term t) -inline EXTERN Term *RepAppl (Term); +inline EXTERN Term *RepAppl (Term) INLINE_ONLY; inline EXTERN Term * RepAppl (Term t) @@ -137,7 +137,7 @@ RepAppl (Term t) -inline EXTERN Term AbsAppl (Term *); +inline EXTERN Term AbsAppl (Term *) INLINE_ONLY; inline EXTERN Term AbsAppl (Term * p) @@ -147,7 +147,7 @@ AbsAppl (Term * p) -inline EXTERN Int IsApplTerm (Term); +inline EXTERN Int IsApplTerm (Term) INLINE_ONLY; inline EXTERN Int IsApplTerm (Term t) @@ -157,7 +157,7 @@ IsApplTerm (Term t) -inline EXTERN Int IsAtomOrIntTerm (Term); +inline EXTERN Int IsAtomOrIntTerm (Term) INLINE_ONLY; inline EXTERN Int IsAtomOrIntTerm (Term t) @@ -168,7 +168,7 @@ IsAtomOrIntTerm (Term t) -inline EXTERN Term AdjustPtr (Term t, Term off); +inline EXTERN Term AdjustPtr (Term t, Term off) INLINE_ONLY; inline EXTERN Term AdjustPtr (Term t, Term off) @@ -178,7 +178,7 @@ AdjustPtr (Term t, Term off) -inline EXTERN Term AdjustIDBPtr (Term t, Term off); +inline EXTERN Term AdjustIDBPtr (Term t, Term off) INLINE_ONLY; inline EXTERN Term AdjustIDBPtr (Term t, Term off) @@ -189,7 +189,7 @@ AdjustIDBPtr (Term t, Term off) -inline EXTERN Int IntOfTerm (Term); +inline EXTERN Int IntOfTerm (Term) INLINE_ONLY; inline EXTERN Int IntOfTerm (Term t) diff --git a/H/Tags_32Ops.h b/H/Tags_32Ops.h index b879c1e89..96b877d19 100644 --- a/H/Tags_32Ops.h +++ b/H/Tags_32Ops.h @@ -101,7 +101,8 @@ are now 1 in compound terms and structures. /* never forget to surround arguments to a macro by brackets */ -inline EXTERN int IsVarTerm (Term); +#include "inline-only.h" +inline EXTERN int IsVarTerm (Term) INLINE_ONLY; inline EXTERN int IsVarTerm (Term t) @@ -111,7 +112,7 @@ IsVarTerm (Term t) -inline EXTERN int IsNonVarTerm (Term); +inline EXTERN int IsNonVarTerm (Term) INLINE_ONLY; inline EXTERN int IsNonVarTerm (Term t) @@ -122,7 +123,7 @@ IsNonVarTerm (Term t) #if UNIQUE_TAG_FOR_PAIRS -inline EXTERN Term *RepPair (Term); +inline EXTERN Term *RepPair (Term) INLINE_ONLY; inline EXTERN Term * RepPair (Term t) @@ -132,7 +133,7 @@ RepPair (Term t) -inline EXTERN Term AbsPair (Term *); +inline EXTERN Term AbsPair (Term *) INLINE_ONLY; inline EXTERN Term AbsPair (Term * p) @@ -142,7 +143,7 @@ AbsPair (Term * p) -inline EXTERN Int IsPairTerm (Term); +inline EXTERN Int IsPairTerm (Term) INLINE_ONLY; inline EXTERN Int IsPairTerm (Term t) @@ -152,7 +153,7 @@ IsPairTerm (Term t) -inline EXTERN Term *RepAppl (Term); +inline EXTERN Term *RepAppl (Term) INLINE_ONLY; inline EXTERN Term * RepAppl (Term t) @@ -162,7 +163,7 @@ RepAppl (Term t) -inline EXTERN Term AbsAppl (Term *); +inline EXTERN Term AbsAppl (Term *) INLINE_ONLY; inline EXTERN Term AbsAppl (Term * p) @@ -172,7 +173,7 @@ AbsAppl (Term * p) -inline EXTERN Int IsApplTerm (Term); +inline EXTERN Int IsApplTerm (Term) INLINE_ONLY; inline EXTERN Int IsApplTerm (Term t) @@ -183,7 +184,7 @@ IsApplTerm (Term t) #else -inline EXTERN Term *RepPair (Term); +inline EXTERN Term *RepPair (Term) INLINE_ONLY; inline EXTERN Term * RepPair (Term t) @@ -193,7 +194,7 @@ RepPair (Term t) -inline EXTERN Term AbsPair (Term *); +inline EXTERN Term AbsPair (Term *) INLINE_ONLY; inline EXTERN Term AbsPair (Term * p) @@ -203,7 +204,7 @@ AbsPair (Term * p) -inline EXTERN Int IsPairTerm (Term); +inline EXTERN Int IsPairTerm (Term) INLINE_ONLY; inline EXTERN Int IsPairTerm (Term t) @@ -213,7 +214,7 @@ IsPairTerm (Term t) -inline EXTERN Term *RepAppl (Term); +inline EXTERN Term *RepAppl (Term) INLINE_ONLY; inline EXTERN Term * RepAppl (Term t) @@ -223,7 +224,7 @@ RepAppl (Term t) -inline EXTERN Term AbsAppl (Term *); +inline EXTERN Term AbsAppl (Term *) INLINE_ONLY; inline EXTERN Term AbsAppl (Term * p) @@ -233,7 +234,7 @@ AbsAppl (Term * p) -inline EXTERN Int IsApplTerm (Term); +inline EXTERN Int IsApplTerm (Term) INLINE_ONLY; inline EXTERN Int IsApplTerm (Term t) @@ -244,7 +245,7 @@ IsApplTerm (Term t) #endif -inline EXTERN Int IsAtomOrIntTerm (Term); +inline EXTERN Int IsAtomOrIntTerm (Term) INLINE_ONLY; inline EXTERN Int IsAtomOrIntTerm (Term t) @@ -255,7 +256,7 @@ IsAtomOrIntTerm (Term t) -inline EXTERN Int IntOfTerm (Term); +inline EXTERN Int IntOfTerm (Term) INLINE_ONLY; inline EXTERN Int IntOfTerm (Term t) @@ -267,7 +268,7 @@ IntOfTerm (Term t) #if UNIQUE_TAG_FOR_PAIRS -inline EXTERN Term AdjustPtr (Term t, Term off); +inline EXTERN Term AdjustPtr (Term t, Term off) INLINE_ONLY; inline EXTERN Term AdjustPtr (Term t, Term off) @@ -281,7 +282,7 @@ AdjustPtr (Term t, Term off) -inline EXTERN Term AdjustIDBPtr (Term t, Term off); +inline EXTERN Term AdjustIDBPtr (Term t, Term off) INLINE_ONLY; inline EXTERN Term AdjustIDBPtr (Term t, Term off) @@ -292,7 +293,7 @@ AdjustIDBPtr (Term t, Term off) #else -inline EXTERN Term AdjustPtr (Term t, Term off); +inline EXTERN Term AdjustPtr (Term t, Term off) INLINE_ONLY; inline EXTERN Term AdjustPtr (Term t, Term off) @@ -306,7 +307,7 @@ AdjustPtr (Term t, Term off) -inline EXTERN Term AdjustIDBPtr (Term t, Term off); +inline EXTERN Term AdjustIDBPtr (Term t, Term off) INLINE_ONLY; inline EXTERN Term AdjustIDBPtr (Term t, Term off) diff --git a/H/Tags_32bits.h b/H/Tags_32bits.h index decb45a08..049e954a2 100644 --- a/H/Tags_32bits.h +++ b/H/Tags_32bits.h @@ -68,8 +68,8 @@ property list #define BitOn(Bit,V) (Bit & Unsigned(V)) #define CHKTAG(t,Tag) ((Unsigned(t)&TagBits)==Tag) - -inline EXTERN int IsVarTerm (Term); +#include "inline-only.h" +inline EXTERN int IsVarTerm (Term) INLINE_ONLY; inline EXTERN int IsVarTerm (Term t) @@ -79,7 +79,7 @@ IsVarTerm (Term t) -inline EXTERN int IsNonVarTerm (Term); +inline EXTERN int IsNonVarTerm (Term) INLINE_ONLY; inline EXTERN int IsNonVarTerm (Term t) @@ -89,7 +89,7 @@ IsNonVarTerm (Term t) -inline EXTERN Term *RepPair (Term); +inline EXTERN Term *RepPair (Term) INLINE_ONLY; inline EXTERN Term * RepPair (Term t) @@ -99,7 +99,7 @@ RepPair (Term t) -inline EXTERN Term AbsPair (Term *); +inline EXTERN Term AbsPair (Term *) INLINE_ONLY; inline EXTERN Term AbsPair (Term * p) @@ -109,7 +109,7 @@ AbsPair (Term * p) -inline EXTERN Int IsPairTerm (Term); +inline EXTERN Int IsPairTerm (Term) INLINE_ONLY; inline EXTERN Int IsPairTerm (Term t) @@ -119,7 +119,7 @@ IsPairTerm (Term t) -inline EXTERN Term *RepAppl (Term); +inline EXTERN Term *RepAppl (Term) INLINE_ONLY; inline EXTERN Term * RepAppl (Term t) @@ -129,7 +129,7 @@ RepAppl (Term t) -inline EXTERN Term AbsAppl (Term *); +inline EXTERN Term AbsAppl (Term *) INLINE_ONLY; inline EXTERN Term AbsAppl (Term * p) @@ -139,7 +139,7 @@ AbsAppl (Term * p) -inline EXTERN Int IsApplTerm (Term); +inline EXTERN Int IsApplTerm (Term) INLINE_ONLY; inline EXTERN Int IsApplTerm (Term t) @@ -149,7 +149,7 @@ IsApplTerm (Term t) -inline EXTERN int IsAtomOrIntTerm (Term); +inline EXTERN int IsAtomOrIntTerm (Term) INLINE_ONLY; inline EXTERN int IsAtomOrIntTerm (Term t) @@ -160,7 +160,7 @@ IsAtomOrIntTerm (Term t) -inline EXTERN Term AdjustPtr (Term t, Term off); +inline EXTERN Term AdjustPtr (Term t, Term off) INLINE_ONLY; inline EXTERN Term AdjustPtr (Term t, Term off) @@ -170,7 +170,7 @@ AdjustPtr (Term t, Term off) -inline EXTERN Term AdjustIDBPtr (Term t, Term off); +inline EXTERN Term AdjustIDBPtr (Term t, Term off) INLINE_ONLY; inline EXTERN Term AdjustIDBPtr (Term t, Term off) @@ -181,7 +181,7 @@ AdjustIDBPtr (Term t, Term off) -inline EXTERN Int IntOfTerm (Term); +inline EXTERN Int IntOfTerm (Term) INLINE_ONLY; inline EXTERN Int IntOfTerm (Term t) diff --git a/H/Tags_64bits.h b/H/Tags_64bits.h index ee61f691f..1ad6ace4d 100644 --- a/H/Tags_64bits.h +++ b/H/Tags_64bits.h @@ -72,8 +72,8 @@ property list #define NONTAGGED(TAG,V) NonTagPart(Unsigned(V)<<3) /* SQRT(8) */ #define CHKTAG(t,Tag) ((Unsigned(t)&TagBits)==Tag) - -inline EXTERN int IsVarTerm (Term); +#include "inline-only.h" +inline EXTERN int IsVarTerm (Term) INLINE_ONLY; inline EXTERN int IsVarTerm (Term t) @@ -83,7 +83,7 @@ IsVarTerm (Term t) -inline EXTERN int IsNonVarTerm (Term); +inline EXTERN int IsNonVarTerm (Term) INLINE_ONLY; inline EXTERN int IsNonVarTerm (Term t) @@ -93,7 +93,7 @@ IsNonVarTerm (Term t) -inline EXTERN Term *RepPair (Term); +inline EXTERN Term *RepPair (Term) INLINE_ONLY; inline EXTERN Term * RepPair (Term t) @@ -103,7 +103,7 @@ RepPair (Term t) -inline EXTERN Term AbsPair (Term *); +inline EXTERN Term AbsPair (Term *) INLINE_ONLY; inline EXTERN Term AbsPair (Term * p) @@ -113,7 +113,7 @@ AbsPair (Term * p) -inline EXTERN Int IsPairTerm (Term); +inline EXTERN Int IsPairTerm (Term) INLINE_ONLY; inline EXTERN Int IsPairTerm (Term t) @@ -123,7 +123,7 @@ IsPairTerm (Term t) -inline EXTERN Term *RepAppl (Term); +inline EXTERN Term *RepAppl (Term) INLINE_ONLY; inline EXTERN Term * RepAppl (Term t) @@ -133,7 +133,7 @@ RepAppl (Term t) -inline EXTERN Term AbsAppl (Term *); +inline EXTERN Term AbsAppl (Term *) INLINE_ONLY; inline EXTERN Term AbsAppl (Term * p) @@ -143,7 +143,7 @@ AbsAppl (Term * p) -inline EXTERN Int IsApplTerm (Term); +inline EXTERN Int IsApplTerm (Term) INLINE_ONLY; inline EXTERN Int IsApplTerm (Term t) @@ -153,7 +153,7 @@ IsApplTerm (Term t) -inline EXTERN Int IsAtomOrIntTerm (Term); +inline EXTERN Int IsAtomOrIntTerm (Term) INLINE_ONLY; inline EXTERN Int IsAtomOrIntTerm (Term t) @@ -164,7 +164,7 @@ IsAtomOrIntTerm (Term t) -inline EXTERN Term AdjustPtr (Term t, Term off); +inline EXTERN Term AdjustPtr (Term t, Term off) INLINE_ONLY; inline EXTERN Term AdjustPtr (Term t, Term off) @@ -174,7 +174,7 @@ AdjustPtr (Term t, Term off) -inline EXTERN Term AdjustIDBPtr (Term t, Term off); +inline EXTERN Term AdjustIDBPtr (Term t, Term off) INLINE_ONLY; inline EXTERN Term AdjustIDBPtr (Term t, Term off) @@ -185,7 +185,7 @@ AdjustIDBPtr (Term t, Term off) -inline EXTERN Int IntOfTerm (Term); +inline EXTERN Int IntOfTerm (Term) INLINE_ONLY; inline EXTERN Int IntOfTerm (Term t) diff --git a/H/TermExt.h b/H/TermExt.h index 1109e6e8a..ddd04af26 100755 --- a/H/TermExt.h +++ b/H/TermExt.h @@ -58,8 +58,9 @@ blob_type; #define FunctorDouble ((Functor)(double_e)) #define EndSpecials (double_e+sizeof(Functor *)) +#include "inline-only.h" -inline EXTERN int IsAttVar (CELL *pt); +inline EXTERN int IsAttVar (CELL *pt) INLINE_ONLY; inline EXTERN int IsAttVar (CELL *pt) @@ -73,7 +74,7 @@ IsAttVar (CELL *pt) #endif } -inline EXTERN int GlobalIsAttVar (CELL *pt); +inline EXTERN int GlobalIsAttVar (CELL *pt) INLINE_ONLY; inline EXTERN int GlobalIsAttVar (CELL *pt) @@ -98,7 +99,7 @@ typedef enum } big_blob_type; -inline EXTERN blob_type BlobOfFunctor (Functor f); +inline EXTERN blob_type BlobOfFunctor (Functor f) INLINE_ONLY; inline EXTERN blob_type BlobOfFunctor (Functor f) @@ -177,12 +178,12 @@ special_functors; #endif /* YAP_H */ -inline EXTERN Float CpFloatUnaligned(CELL *ptr); +inline EXTERN Float CpFloatUnaligned(CELL *ptr) INLINE_ONLY; #if SIZEOF_DOUBLE == SIZEOF_LONG_INT -inline EXTERN Term MkFloatTerm (Float); +inline EXTERN Term MkFloatTerm (Float) INLINE_ONLY; inline EXTERN Term MkFloatTerm (Float dbl) @@ -194,7 +195,7 @@ MkFloatTerm (Float dbl) } -inline EXTERN Float FloatOfTerm (Term t); +inline EXTERN Float FloatOfTerm (Term t) INLINE_ONLY; inline EXTERN Float FloatOfTerm (Term t) @@ -216,7 +217,7 @@ CpFloatUnaligned(CELL *ptr) #if SIZEOF_DOUBLE == 2*SIZEOF_LONG_INT -inline EXTERN void AlignGlobalForDouble( USES_REGS1 ); +inline EXTERN void AlignGlobalForDouble( USES_REGS1 ) INLINE_ONLY; #define DOUBLE_ALIGNED(ADDR) ((CELL)(ADDR) & 0x4) @@ -244,7 +245,7 @@ CpFloatUnaligned (CELL * ptr) #endif -inline EXTERN Term MkFloatTerm (Float); +inline EXTERN Term MkFloatTerm (Float) INLINE_ONLY; inline EXTERN Term MkFloatTerm (Float dbl) @@ -257,7 +258,7 @@ MkFloatTerm (Float dbl) } -inline EXTERN Float FloatOfTerm (Term t); +inline EXTERN Float FloatOfTerm (Term t) INLINE_ONLY; inline EXTERN Float FloatOfTerm (Term t) @@ -289,7 +290,7 @@ char *Yap_BlobStringOfTermAndLength(Term, size_t *); -inline EXTERN int IsFloatTerm (Term); +inline EXTERN int IsFloatTerm (Term) INLINE_ONLY; inline EXTERN int IsFloatTerm (Term t) @@ -302,7 +303,7 @@ IsFloatTerm (Term t) /* extern Functor FunctorLongInt; */ -inline EXTERN Term MkLongIntTerm (Int); +inline EXTERN Term MkLongIntTerm (Int) INLINE_ONLY; inline EXTERN Term MkLongIntTerm (Int i) @@ -316,7 +317,7 @@ MkLongIntTerm (Int i) } -inline EXTERN Int LongIntOfTerm (Term t); +inline EXTERN Int LongIntOfTerm (Term t) INLINE_ONLY; inline EXTERN Int LongIntOfTerm (Term t) @@ -326,7 +327,7 @@ LongIntOfTerm (Term t) -inline EXTERN int IsLongIntTerm (Term); +inline EXTERN int IsLongIntTerm (Term) INLINE_ONLY; inline EXTERN int IsLongIntTerm (Term t) @@ -358,7 +359,7 @@ typedef struct { #endif -inline EXTERN int IsBigIntTerm (Term); +inline EXTERN int IsBigIntTerm (Term) INLINE_ONLY; inline EXTERN int IsBigIntTerm (Term t) @@ -374,7 +375,7 @@ MP_INT *STD_PROTO (Yap_BigIntOfTerm, (Term)); Term STD_PROTO (Yap_MkBigRatTerm, (MP_RAT *)); MP_RAT *STD_PROTO (Yap_BigRatOfTerm, (Term)); -inline EXTERN void MPZ_SET (mpz_t, MP_INT *); +inline EXTERN void MPZ_SET (mpz_t, MP_INT *) INLINE_ONLY; inline EXTERN void MPZ_SET (mpz_t dest, MP_INT *src) @@ -384,7 +385,7 @@ MPZ_SET (mpz_t dest, MP_INT *src) dest->_mp_d = src->_mp_d; } -inline EXTERN int IsLargeIntTerm (Term); +inline EXTERN int IsLargeIntTerm (Term) INLINE_ONLY; inline EXTERN int IsLargeIntTerm (Term t) @@ -395,7 +396,7 @@ IsLargeIntTerm (Term t) } -inline EXTERN UInt Yap_SizeOfBigInt (Term); +inline EXTERN UInt Yap_SizeOfBigInt (Term) INLINE_ONLY; inline EXTERN UInt Yap_SizeOfBigInt (Term t) @@ -411,7 +412,7 @@ Yap_SizeOfBigInt (Term t) -inline EXTERN int IsLargeIntTerm (Term); +inline EXTERN int IsLargeIntTerm (Term) INLINE_ONLY; inline EXTERN int IsLargeIntTerm (Term t) @@ -427,7 +428,7 @@ typedef struct string_struct { UInt len; } blob_string_t; -inline EXTERN int IsBlobStringTerm (Term); +inline EXTERN int IsBlobStringTerm (Term) INLINE_ONLY; inline EXTERN int IsBlobStringTerm (Term t) @@ -437,7 +438,7 @@ IsBlobStringTerm (Term t) (RepAppl(t)[1] & BLOB_STRING) == BLOB_STRING); } -inline EXTERN int IsWideBlobStringTerm (Term); +inline EXTERN int IsWideBlobStringTerm (Term) INLINE_ONLY; inline EXTERN int IsWideBlobStringTerm (Term t) @@ -449,7 +450,7 @@ IsWideBlobStringTerm (Term t) /* extern Functor FunctorLongInt; */ -inline EXTERN int IsLargeNumTerm (Term); +inline EXTERN int IsLargeNumTerm (Term) INLINE_ONLY; inline EXTERN int IsLargeNumTerm (Term t) @@ -459,7 +460,7 @@ IsLargeNumTerm (Term t) && (FunctorOfTerm (t) >= FunctorLongInt))); } -inline EXTERN int IsExternalBlobTerm (Term, CELL); +inline EXTERN int IsExternalBlobTerm (Term, CELL) INLINE_ONLY; inline EXTERN int IsExternalBlobTerm (Term t, CELL tag) @@ -469,7 +470,7 @@ IsExternalBlobTerm (Term t, CELL tag) RepAppl(t)[1] == tag); } -inline EXTERN void *ExternalBlobFromTerm (Term); +inline EXTERN void *ExternalBlobFromTerm (Term) INLINE_ONLY; inline EXTERN void * ExternalBlobFromTerm (Term t) @@ -481,7 +482,7 @@ ExternalBlobFromTerm (Term t) -inline EXTERN int IsNumTerm (Term); +inline EXTERN int IsNumTerm (Term) INLINE_ONLY; inline EXTERN int IsNumTerm (Term t) @@ -492,7 +493,7 @@ IsNumTerm (Term t) -inline EXTERN Int IsAtomicTerm (Term); +inline EXTERN Int IsAtomicTerm (Term) INLINE_ONLY; inline EXTERN Int IsAtomicTerm (Term t) @@ -503,7 +504,7 @@ IsAtomicTerm (Term t) -inline EXTERN Int IsExtensionFunctor (Functor); +inline EXTERN Int IsExtensionFunctor (Functor) INLINE_ONLY; inline EXTERN Int IsExtensionFunctor (Functor f) @@ -513,7 +514,7 @@ IsExtensionFunctor (Functor f) -inline EXTERN Int IsBlobFunctor (Functor); +inline EXTERN Int IsBlobFunctor (Functor) INLINE_ONLY; inline EXTERN Int IsBlobFunctor (Functor f) @@ -523,7 +524,7 @@ IsBlobFunctor (Functor f) -inline EXTERN Int IsPrimitiveTerm (Term); +inline EXTERN Int IsPrimitiveTerm (Term) INLINE_ONLY; inline EXTERN Int IsPrimitiveTerm (Term t) @@ -535,7 +536,7 @@ IsPrimitiveTerm (Term t) #ifdef TERM_EXTENSIONS -inline EXTERN Int IsAttachFunc (Functor); +inline EXTERN Int IsAttachFunc (Functor) INLINE_ONLY; inline EXTERN Int IsAttachFunc (Functor f) @@ -546,7 +547,7 @@ IsAttachFunc (Functor f) -inline EXTERN Int IsAttachedTerm (Term); +inline EXTERN Int IsAttachedTerm (Term) INLINE_ONLY; inline EXTERN Int IsAttachedTerm (Term t) @@ -554,7 +555,7 @@ IsAttachedTerm (Term t) return (Int) ((IsVarTerm (t) && IsAttVar(VarOfTerm(t)))); } -inline EXTERN Int GlobalIsAttachedTerm (Term); +inline EXTERN Int GlobalIsAttachedTerm (Term) INLINE_ONLY; inline EXTERN Int GlobalIsAttachedTerm (Term t) @@ -562,7 +563,7 @@ GlobalIsAttachedTerm (Term t) return (Int) ((IsVarTerm (t) && GlobalIsAttVar(VarOfTerm(t)))); } -inline EXTERN Int SafeIsAttachedTerm (Term); +inline EXTERN Int SafeIsAttachedTerm (Term) INLINE_ONLY; inline EXTERN Int SafeIsAttachedTerm (Term t) @@ -573,7 +574,7 @@ SafeIsAttachedTerm (Term t) -inline EXTERN exts ExtFromCell (CELL *); +inline EXTERN exts ExtFromCell (CELL *) INLINE_ONLY; inline EXTERN exts ExtFromCell (CELL * pt) @@ -586,7 +587,7 @@ ExtFromCell (CELL * pt) #else -inline EXTERN Int IsAttachFunc (Functor); +inline EXTERN Int IsAttachFunc (Functor) INLINE_ONLY; inline EXTERN Int IsAttachFunc (Functor f) @@ -597,7 +598,7 @@ IsAttachFunc (Functor f) -inline EXTERN Int IsAttachedTerm (Term); +inline EXTERN Int IsAttachedTerm (Term) INLINE_ONLY; inline EXTERN Int IsAttachedTerm (Term t) @@ -610,7 +611,7 @@ IsAttachedTerm (Term t) #endif -inline EXTERN Int Yap_BlobTag(Term t); +inline EXTERN Int Yap_BlobTag(Term t) INLINE_ONLY; inline EXTERN Int Yap_BlobTag(Term t) { @@ -620,7 +621,7 @@ inline EXTERN Int Yap_BlobTag(Term t) } -inline EXTERN void *Yap_BlobInfo(Term t); +inline EXTERN void *Yap_BlobInfo(Term t) INLINE_ONLY; inline EXTERN void *Yap_BlobInfo(Term t) { @@ -633,7 +634,7 @@ inline EXTERN void *Yap_BlobInfo(Term t) #ifdef YAP_H -inline EXTERN int STD_PROTO (unify_extension, (Functor, CELL, CELL *, CELL)); +inline EXTERN int STD_PROTO (unify_extension, (Functor, CELL, CELL *, CELL)) INLINE_ONLY; EXTERN int STD_PROTO (unify_extension, (Functor, CELL, CELL *, CELL)); diff --git a/H/Yap.h b/H/Yap.h index 4005904a7..a90c5f1e2 100755 --- a/H/Yap.h +++ b/H/Yap.h @@ -38,6 +38,7 @@ #endif /* THREADS && (YAPOR_COW || YAPOR_SBA || YAPOR_COPY) */ #include "config.h" +#include "inline-only.h" #if defined(YAPOR) || defined(TABLING) #include "opt.config.h" #endif /* YAPOR || TABLING */ diff --git a/H/YapCompoundTerm.h b/H/YapCompoundTerm.h index e8b1d3be1..43dd18b60 100644 --- a/H/YapCompoundTerm.h +++ b/H/YapCompoundTerm.h @@ -21,9 +21,11 @@ #define YAPCOMPOUNDTERM_H 1 +#include "inline-only.h" + EXTERN Int Yap_unify(Term a,Term b); -EXTERN inline Term Deref(Term a); +EXTERN inline Term Deref(Term a) INLINE_ONLY; EXTERN inline Term Deref(Term a) { @@ -35,7 +37,7 @@ EXTERN inline Term Deref(Term a) return(a); } -EXTERN inline Term Derefa(CELL *b); +EXTERN inline Term Derefa(CELL *b) INLINE_ONLY; EXTERN inline Term Derefa(CELL *b) @@ -53,7 +55,7 @@ Derefa(CELL *b) } } -inline EXTERN Term ArgOfTerm (int i, Term t); +inline EXTERN Term ArgOfTerm (int i, Term t) INLINE_ONLY; inline EXTERN Term ArgOfTerm (int i, Term t) @@ -63,7 +65,7 @@ ArgOfTerm (int i, Term t) -inline EXTERN Term HeadOfTerm (Term); +inline EXTERN Term HeadOfTerm (Term) INLINE_ONLY; inline EXTERN Term HeadOfTerm (Term t) @@ -73,7 +75,7 @@ HeadOfTerm (Term t) -inline EXTERN Term TailOfTerm (Term); +inline EXTERN Term TailOfTerm (Term) INLINE_ONLY; inline EXTERN Term TailOfTerm (Term t) @@ -84,7 +86,7 @@ TailOfTerm (Term t) -inline EXTERN Term ArgOfTermCell (int i, Term t); +inline EXTERN Term ArgOfTermCell (int i, Term t) INLINE_ONLY; inline EXTERN Term ArgOfTermCell (int i, Term t) @@ -94,7 +96,7 @@ ArgOfTermCell (int i, Term t) -inline EXTERN Term HeadOfTermCell (Term); +inline EXTERN Term HeadOfTermCell (Term) INLINE_ONLY; inline EXTERN Term HeadOfTermCell (Term t) @@ -104,7 +106,7 @@ HeadOfTermCell (Term t) -inline EXTERN Term TailOfTermCell (Term); +inline EXTERN Term TailOfTermCell (Term) INLINE_ONLY; inline EXTERN Term TailOfTermCell (Term t) diff --git a/H/YapHeap.h b/H/YapHeap.h index c4b5001f0..01220e560 100644 --- a/H/YapHeap.h +++ b/H/YapHeap.h @@ -221,6 +221,11 @@ UInt STD_PROTO(Yap_givemallinfo, (void)); ADDR STD_PROTO(Yap_ExpandPreAllocCodeSpace, (UInt, void *, int)); #define Yap_ReleasePreAllocCodeSpace(x) ADDR STD_PROTO(Yap_InitPreAllocCodeSpace, (void)); + +#include "inline-only.h" +EXTERN inline ADDR +Yap_PreAllocCodeSpace(void) INLINE_ONLY; + EXTERN inline ADDR Yap_PreAllocCodeSpace(void) { diff --git a/H/YapTags.h b/H/YapTags.h index f43d1e4e4..317b74617 100644 --- a/H/YapTags.h +++ b/H/YapTags.h @@ -17,6 +17,8 @@ #define EXTERN extern #endif +#include "inline-only.h" + #ifndef SHORT_ADDRESSES # define LONG_ADDRESSES 1 #else @@ -152,7 +154,7 @@ applies to unbound variables *************************************************************************************************/ -inline EXTERN Term *VarOfTerm (Term t); +inline EXTERN Term *VarOfTerm (Term t) INLINE_ONLY; inline EXTERN Term * VarOfTerm (Term t) @@ -163,7 +165,7 @@ VarOfTerm (Term t) #ifdef YAPOR_SBA -inline EXTERN Term MkVarTerm__ ( USES_REGS1 ); +inline EXTERN Term MkVarTerm__ ( USES_REGS1 ) INLINE_ONLY; inline EXTERN Term MkVarTerm__ ( USES_REGS1 ) @@ -173,7 +175,7 @@ MkVarTerm__ ( USES_REGS1 ) -inline EXTERN int IsUnboundVar (Term *); +inline EXTERN int IsUnboundVar (Term *) INLINE_ONLY; inline EXTERN int IsUnboundVar (Term * t) @@ -184,7 +186,7 @@ IsUnboundVar (Term * t) #else -inline EXTERN Term MkVarTerm__ ( USES_REGS1 ); +inline EXTERN Term MkVarTerm__ ( USES_REGS1 ) INLINE_ONLY; inline EXTERN Term MkVarTerm__ ( USES_REGS1 ) @@ -193,7 +195,7 @@ MkVarTerm__ ( USES_REGS1 ) } -inline EXTERN int IsUnboundVar (Term *); +inline EXTERN int IsUnboundVar (Term *) INLINE_ONLY; inline EXTERN int IsUnboundVar (Term * t) @@ -204,7 +206,7 @@ IsUnboundVar (Term * t) #endif -inline EXTERN CELL *PtrOfTerm (Term); +inline EXTERN CELL *PtrOfTerm (Term) INLINE_ONLY; inline EXTERN CELL * PtrOfTerm (Term t) @@ -215,7 +217,7 @@ PtrOfTerm (Term t) -inline EXTERN Functor FunctorOfTerm (Term); +inline EXTERN Functor FunctorOfTerm (Term) INLINE_ONLY; inline EXTERN Functor FunctorOfTerm (Term t) @@ -226,7 +228,7 @@ FunctorOfTerm (Term t) #if USE_LOW32_TAGS -inline EXTERN Term MkAtomTerm (Atom); +inline EXTERN Term MkAtomTerm (Atom) INLINE_ONLY; inline EXTERN Term MkAtomTerm (Atom a) @@ -236,7 +238,7 @@ MkAtomTerm (Atom a) -inline EXTERN Atom AtomOfTerm (Term t); +inline EXTERN Atom AtomOfTerm (Term t) INLINE_ONLY; inline EXTERN Atom AtomOfTerm (Term t) @@ -247,7 +249,7 @@ AtomOfTerm (Term t) #else -inline EXTERN Term MkAtomTerm (Atom); +inline EXTERN Term MkAtomTerm (Atom) INLINE_ONLY; inline EXTERN Term MkAtomTerm (Atom a) @@ -257,7 +259,7 @@ MkAtomTerm (Atom a) -inline EXTERN Atom AtomOfTerm (Term t); +inline EXTERN Atom AtomOfTerm (Term t) INLINE_ONLY; inline EXTERN Atom AtomOfTerm (Term t) @@ -268,7 +270,7 @@ AtomOfTerm (Term t) #endif -inline EXTERN int IsAtomTerm (Term); +inline EXTERN int IsAtomTerm (Term) INLINE_ONLY; inline EXTERN int IsAtomTerm (Term t) @@ -279,7 +281,7 @@ IsAtomTerm (Term t) -inline EXTERN Term MkIntTerm (Int); +inline EXTERN Term MkIntTerm (Int) INLINE_ONLY; inline EXTERN Term MkIntTerm (Int n) @@ -293,7 +295,7 @@ MkIntTerm (Int n) overflow problems are possible */ -inline EXTERN Term MkIntConstant (Int); +inline EXTERN Term MkIntConstant (Int) INLINE_ONLY; inline EXTERN Term MkIntConstant (Int n) @@ -303,7 +305,7 @@ MkIntConstant (Int n) -inline EXTERN int IsIntTerm (Term); +inline EXTERN int IsIntTerm (Term) INLINE_ONLY; inline EXTERN int IsIntTerm (Term t) @@ -312,7 +314,7 @@ IsIntTerm (Term t) } -EXTERN inline Term MkPairTerm__(Term head, Term tail USES_REGS ); +EXTERN inline Term MkPairTerm__(Term head, Term tail USES_REGS ) INLINE_ONLY; EXTERN inline Term MkPairTerm__ (Term head, Term tail USES_REGS) @@ -362,7 +364,7 @@ MkPairTerm__ (Term head, Term tail USES_REGS) #define IsAccessFunc(func) ((func) == FunctorAccess) #ifdef YAP_H -inline EXTERN Term MkIntegerTerm (Int); +inline EXTERN Term MkIntegerTerm (Int) INLINE_ONLY; inline EXTERN Term MkIntegerTerm (Int n) @@ -372,7 +374,7 @@ MkIntegerTerm (Int n) #endif -inline EXTERN int IsIntegerTerm (Term); +inline EXTERN int IsIntegerTerm (Term) INLINE_ONLY; inline EXTERN int IsIntegerTerm (Term t) @@ -380,7 +382,7 @@ IsIntegerTerm (Term t) return (int) (IsIntTerm (t) || IsLongIntTerm (t)); } -inline EXTERN Int IntegerOfTerm (Term); +inline EXTERN Int IntegerOfTerm (Term) INLINE_ONLY; inline EXTERN Int IntegerOfTerm (Term t) diff --git a/H/Yatom.h b/H/Yatom.h index 3956b823c..bf1ab891b 100644 --- a/H/Yatom.h +++ b/H/Yatom.h @@ -1472,7 +1472,7 @@ typedef enum #define PredHashInitialSize ((UInt)1039) #define PredHashIncrement ((UInt)7919) -EXTERN inline UInt STD_PROTO(PRED_HASH, (FunctorEntry *, Term, UInt)); +EXTERN inline UInt STD_PROTO(PRED_HASH, (FunctorEntry *, Term, UInt)) INLINE_ONLY; EXTERN inline UInt PRED_HASH(FunctorEntry *fe, Term cur_mod, UInt size) @@ -1480,16 +1480,16 @@ PRED_HASH(FunctorEntry *fe, Term cur_mod, UInt size) return (((CELL)fe+cur_mod)>>2) % size; } -EXTERN inline Prop STD_PROTO(GetPredPropByFuncAndModHavingLock, (FunctorEntry *, Term)); -EXTERN inline Prop STD_PROTO(PredPropByFuncAndMod, (FunctorEntry *, Term)); -EXTERN inline Prop STD_PROTO(PredPropByAtomAndMod, (Atom, Term)); -EXTERN inline Prop STD_PROTO(GetPredPropByFuncHavingLock, (FunctorEntry *, Term)); +EXTERN inline Prop STD_PROTO(GetPredPropByFuncAndModHavingLock, (FunctorEntry *, Term)) INLINE_ONLY; +EXTERN inline Prop STD_PROTO(PredPropByFuncAndMod, (FunctorEntry *, Term)) INLINE_ONLY; +EXTERN inline Prop STD_PROTO(PredPropByAtomAndMod, (Atom, Term)) INLINE_ONLY; +EXTERN inline Prop STD_PROTO(GetPredPropByFuncHavingLock, (FunctorEntry *, Term)) INLINE_ONLY; #ifdef THREADS Prop STD_PROTO(Yap_NewThreadPred, (struct pred_entry * CACHE_TYPE)); Prop STD_PROTO(Yap_NewPredPropByFunctor, (Functor, Term)); -EXTERN inline struct pred_entry *STD_PROTO(Yap_GetThreadPred, (struct pred_entry * CACHE_TYPE)); +EXTERN inline struct pred_entry *STD_PROTO(Yap_GetThreadPred, (struct pred_entry * CACHE_TYPE)) INLINE_ONLY; EXTERN inline struct pred_entry * Yap_GetThreadPred(struct pred_entry *ap USES_REGS) @@ -1697,7 +1697,7 @@ PredPropByAtomAndMod (Atom at, Term cur_mod) #define UNLOCKPE(I,Z) UNLOCK((Z)->PELock) #endif -EXTERN inline void STD_PROTO(AddPropToAtom, (AtomEntry *, PropEntry *p)); +EXTERN inline void STD_PROTO(AddPropToAtom, (AtomEntry *, PropEntry *p)) INLINE_ONLY; EXTERN inline void AddPropToAtom(AtomEntry *ae, PropEntry *p) diff --git a/H/absmi.h b/H/absmi.h index bce8777a9..371a71360 100644 --- a/H/absmi.h +++ b/H/absmi.h @@ -177,6 +177,9 @@ register struct yami* P1REG asm ("bp"); /* can't use yamop before Yap.h */ /* regp is a global variable */ +inline EXTERN void +init_absmi_regs(REGSTORE * absmi_regs) INLINE_ONLY; + inline EXTERN void init_absmi_regs(REGSTORE * absmi_regs) { @@ -184,6 +187,9 @@ init_absmi_regs(REGSTORE * absmi_regs) memcpy(absmi_regs, Yap_regp, sizeof(REGSTORE)); } +inline EXTERN void +restore_absmi_regs(REGSTORE * old_regs) INLINE_ONLY; + inline EXTERN void restore_absmi_regs(REGSTORE * old_regs) { diff --git a/H/amiops.h b/H/amiops.h index 0b14c43e5..ebef5870e 100644 --- a/H/amiops.h +++ b/H/amiops.h @@ -20,6 +20,8 @@ static char SccsId[] = "%W% %G%"; #endif /* SCCS */ +#include "inline-only.h" + #define IsArrayReference(a) ((a)->array_access_func == FunctorArrayAccess) @@ -100,6 +102,9 @@ A contains the address of the variable that is to be trailed #if SIZEOF_DOUBLE == 2*SIZEOF_LONG_INT +EXTERN inline void +AlignGlobalForDouble( USES_REGS1 ) INLINE_ONLY; + EXTERN inline void AlignGlobalForDouble( USES_REGS1 ) { @@ -280,7 +285,7 @@ Unification Routines *************************************************************/ -inline EXTERN void STD_PROTO(reset_trail,(tr_fr_ptr)); +inline EXTERN void STD_PROTO(reset_trail,(tr_fr_ptr)) INLINE_ONLY; inline EXTERN void reset_trail(tr_fr_ptr TR0) { @@ -312,7 +317,7 @@ reset_trail(tr_fr_ptr TR0) { } } -inline EXTERN void reset_attvars(CELL *dvarsmin, CELL *dvarsmax); +inline EXTERN void reset_attvars(CELL *dvarsmin, CELL *dvarsmax) INLINE_ONLY; inline EXTERN void reset_attvars(CELL *dvarsmin, CELL *dvarsmax) { @@ -330,7 +335,7 @@ reset_attvars(CELL *dvarsmin, CELL *dvarsmax) { } } -inline EXTERN void close_attvar_chain(CELL *dvarsmin, CELL *dvarsmax); +inline EXTERN void close_attvar_chain(CELL *dvarsmin, CELL *dvarsmax) INLINE_ONLY; inline EXTERN void close_attvar_chain(CELL *dvarsmin, CELL *dvarsmax) { @@ -349,6 +354,9 @@ close_attvar_chain(CELL *dvarsmin, CELL *dvarsmax) { } } +EXTERN inline +Int Yap_unify(Term t0, Term t1) INLINE_ONLY; + EXTERN inline Int Yap_unify(Term t0, Term t1) { diff --git a/H/clause.h b/H/clause.h index 8c02130bd..7acd28858 100644 --- a/H/clause.h +++ b/H/clause.h @@ -83,7 +83,8 @@ typedef struct logic_upd_clause { yamop ClCode[MIN_ARRAY]; } LogUpdClause; -inline EXTERN int VALID_TIMESTAMP(UInt, struct logic_upd_clause *); +#include "inline-only.h" +inline EXTERN int VALID_TIMESTAMP(UInt, struct logic_upd_clause *) INLINE_ONLY; inline EXTERN int VALID_TIMESTAMP(UInt timestamp, struct logic_upd_clause *cl) diff --git a/H/eval.h b/H/eval.h index 7894042f1..6cb2e487a 100644 --- a/H/eval.h +++ b/H/eval.h @@ -176,6 +176,10 @@ Term STD_PROTO(Yap_eval_binary,(Int,Term,Term)); Term STD_PROTO(Yap_InnerEval,(Term)); Int STD_PROTO(Yap_ArithError,(yap_error_number,Term,char *msg, ...)); +#include "inline-only.h" +inline EXTERN Term +Yap_Eval(Term t) INLINE_ONLY; + inline EXTERN Term Yap_Eval(Term t) { @@ -312,7 +316,7 @@ int STD_PROTO(Yap_term_to_existing_big,(Term, MP_INT *)); int STD_PROTO(Yap_term_to_existing_rat,(Term, MP_RAT *)); #endif -inline EXTERN Term Yap_Mk64IntegerTerm(YAP_LONG_LONG); +inline EXTERN Term Yap_Mk64IntegerTerm(YAP_LONG_LONG) INLINE_ONLY; inline EXTERN Term Yap_Mk64IntegerTerm(YAP_LONG_LONG i) diff --git a/H/inline-only.h b/H/inline-only.h new file mode 100644 index 000000000..5e5c77847 --- /dev/null +++ b/H/inline-only.h @@ -0,0 +1,10 @@ +#ifndef _YAP_INLINE_ONLY_H_ +#define _YAP_INLINE_ONLY_H_ + +#ifdef __GNUC__ +#define INLINE_ONLY __attribute__((gnu_inline,always_inline)) +#else +#define INLINE_ONLY +#endif + +#endif diff --git a/H/sshift.h b/H/sshift.h index 8cc18eccc..bd5c57835 100644 --- a/H/sshift.h +++ b/H/sshift.h @@ -117,7 +117,8 @@ #define IsOldVarTableTrailPtr(P) IsOldVarTableTrailPtr__(P PASS_REGS) #define IsOldTokenTrailPtr(P) IsOldTokenTrailPtr__(P PASS_REGS) -inline EXTERN int IsHeapP__ (CELL * CACHE_TYPE); +#include "inline-only.h" +inline EXTERN int IsHeapP__ (CELL * CACHE_TYPE) INLINE_ONLY; inline EXTERN int IsHeapP__ (CELL * ptr USES_REGS) @@ -134,7 +135,7 @@ IsHeapP__ (CELL * ptr USES_REGS) /* Adjusting cells and pointers to cells */ -inline EXTERN CELL *PtoGloAdjust__ (CELL * CACHE_TYPE); +inline EXTERN CELL *PtoGloAdjust__ (CELL * CACHE_TYPE) INLINE_ONLY; inline EXTERN CELL * PtoGloAdjust__ (CELL * ptr USES_REGS) @@ -151,7 +152,7 @@ PtoGloAdjust__ (CELL * ptr USES_REGS) -inline EXTERN CELL *PtoDelayAdjust__ (CELL * CACHE_TYPE); +inline EXTERN CELL *PtoDelayAdjust__ (CELL * CACHE_TYPE) INLINE_ONLY; inline EXTERN CELL * PtoDelayAdjust__ (CELL * ptr USES_REGS) @@ -162,7 +163,7 @@ PtoDelayAdjust__ (CELL * ptr USES_REGS) return (CELL *) (((CELL *) (CharP (ptr) + LOCAL_GDiff0))); } -inline EXTERN CELL *PtoBaseAdjust__ (CELL * CACHE_TYPE); +inline EXTERN CELL *PtoBaseAdjust__ (CELL * CACHE_TYPE) INLINE_ONLY; inline EXTERN CELL * PtoBaseAdjust__ (CELL * ptr USES_REGS) @@ -172,7 +173,7 @@ PtoBaseAdjust__ (CELL * ptr USES_REGS) -inline EXTERN tr_fr_ptr PtoTRAdjust__ (tr_fr_ptr CACHE_TYPE); +inline EXTERN tr_fr_ptr PtoTRAdjust__ (tr_fr_ptr CACHE_TYPE) INLINE_ONLY; inline EXTERN tr_fr_ptr PtoTRAdjust__ (tr_fr_ptr ptr USES_REGS) @@ -182,7 +183,7 @@ PtoTRAdjust__ (tr_fr_ptr ptr USES_REGS) -inline EXTERN CELL *CellPtoTRAdjust__ (CELL * CACHE_TYPE); +inline EXTERN CELL *CellPtoTRAdjust__ (CELL * CACHE_TYPE) INLINE_ONLY; inline EXTERN CELL * CellPtoTRAdjust__ (CELL * ptr USES_REGS) @@ -192,7 +193,7 @@ CellPtoTRAdjust__ (CELL * ptr USES_REGS) -inline EXTERN CELL *PtoLocAdjust__ (CELL * CACHE_TYPE); +inline EXTERN CELL *PtoLocAdjust__ (CELL * CACHE_TYPE) INLINE_ONLY; inline EXTERN CELL * PtoLocAdjust__ (CELL * ptr USES_REGS) @@ -201,7 +202,7 @@ PtoLocAdjust__ (CELL * ptr USES_REGS) } -inline EXTERN struct cut_c_str *CutCAdjust__ (struct cut_c_str * CACHE_TYPE); +inline EXTERN struct cut_c_str *CutCAdjust__ (struct cut_c_str * CACHE_TYPE) INLINE_ONLY; inline EXTERN struct cut_c_str * CutCAdjust__ (struct cut_c_str * ptr USES_REGS) @@ -211,7 +212,7 @@ CutCAdjust__ (struct cut_c_str * ptr USES_REGS) -inline EXTERN choiceptr ChoicePtrAdjust__ (choiceptr CACHE_TYPE); +inline EXTERN choiceptr ChoicePtrAdjust__ (choiceptr CACHE_TYPE) INLINE_ONLY; inline EXTERN choiceptr ChoicePtrAdjust__ (choiceptr ptr USES_REGS) @@ -222,7 +223,7 @@ ChoicePtrAdjust__ (choiceptr ptr USES_REGS) #ifdef TABLING -inline EXTERN choiceptr ConsumerChoicePtrAdjust__ (choiceptr CACHE_TYPE); +inline EXTERN choiceptr ConsumerChoicePtrAdjust__ (choiceptr CACHE_TYPE) INLINE_ONLY; inline EXTERN choiceptr ConsumerChoicePtrAdjust__ (choiceptr ptr USES_REGS) @@ -232,7 +233,7 @@ ConsumerChoicePtrAdjust__ (choiceptr ptr USES_REGS) -inline EXTERN choiceptr GeneratorChoicePtrAdjust__ (choiceptr CACHE_TYPE); +inline EXTERN choiceptr GeneratorChoicePtrAdjust__ (choiceptr CACHE_TYPE) INLINE_ONLY; inline EXTERN choiceptr GeneratorChoicePtrAdjust__ (choiceptr ptr USES_REGS) @@ -244,7 +245,7 @@ GeneratorChoicePtrAdjust__ (choiceptr ptr USES_REGS) #endif /* TABLING */ -inline EXTERN CELL GlobalAdjust__ (CELL CACHE_TYPE); +inline EXTERN CELL GlobalAdjust__ (CELL CACHE_TYPE) INLINE_ONLY; inline EXTERN CELL GlobalAdjust__ (CELL val USES_REGS) @@ -261,7 +262,7 @@ GlobalAdjust__ (CELL val USES_REGS) -inline EXTERN CELL DelayAdjust__ (CELL CACHE_TYPE); +inline EXTERN CELL DelayAdjust__ (CELL CACHE_TYPE) INLINE_ONLY; inline EXTERN CELL DelayAdjust__ (CELL val USES_REGS) @@ -273,7 +274,7 @@ DelayAdjust__ (CELL val USES_REGS) } -inline EXTERN ADDR GlobalAddrAdjust__ (ADDR CACHE_TYPE); +inline EXTERN ADDR GlobalAddrAdjust__ (ADDR CACHE_TYPE) INLINE_ONLY; inline EXTERN ADDR GlobalAddrAdjust__ (ADDR ptr USES_REGS) @@ -291,7 +292,7 @@ GlobalAddrAdjust__ (ADDR ptr USES_REGS) -inline EXTERN ADDR DelayAddrAdjust__ (ADDR CACHE_TYPE); +inline EXTERN ADDR DelayAddrAdjust__ (ADDR CACHE_TYPE) INLINE_ONLY; inline EXTERN ADDR DelayAddrAdjust__ (ADDR ptr USES_REGS) @@ -303,7 +304,7 @@ DelayAddrAdjust__ (ADDR ptr USES_REGS) } -inline EXTERN ADDR BaseAddrAdjust__ (ADDR CACHE_TYPE); +inline EXTERN ADDR BaseAddrAdjust__ (ADDR CACHE_TYPE) INLINE_ONLY; inline EXTERN ADDR BaseAddrAdjust__ (ADDR ptr USES_REGS) @@ -313,7 +314,7 @@ BaseAddrAdjust__ (ADDR ptr USES_REGS) -inline EXTERN CELL LocalAdjust__ (CELL CACHE_TYPE); +inline EXTERN CELL LocalAdjust__ (CELL CACHE_TYPE) INLINE_ONLY; inline EXTERN CELL LocalAdjust__ (CELL val USES_REGS) @@ -323,7 +324,7 @@ LocalAdjust__ (CELL val USES_REGS) -inline EXTERN ADDR LocalAddrAdjust__ (ADDR CACHE_TYPE); +inline EXTERN ADDR LocalAddrAdjust__ (ADDR CACHE_TYPE) INLINE_ONLY; inline EXTERN ADDR LocalAddrAdjust__ (ADDR ptr USES_REGS) @@ -333,7 +334,7 @@ LocalAddrAdjust__ (ADDR ptr USES_REGS) -inline EXTERN CELL TrailAdjust__ (CELL CACHE_TYPE); +inline EXTERN CELL TrailAdjust__ (CELL CACHE_TYPE) INLINE_ONLY; inline EXTERN CELL TrailAdjust__ (CELL val USES_REGS) @@ -343,7 +344,7 @@ TrailAdjust__ (CELL val USES_REGS) -inline EXTERN ADDR TrailAddrAdjust__ (ADDR CACHE_TYPE); +inline EXTERN ADDR TrailAddrAdjust__ (ADDR CACHE_TYPE) INLINE_ONLY; inline EXTERN ADDR TrailAddrAdjust__ (ADDR ptr USES_REGS) @@ -353,7 +354,7 @@ TrailAddrAdjust__ (ADDR ptr USES_REGS) -inline EXTERN TokEntry *TokEntryAdjust__ (TokEntry * CACHE_TYPE); +inline EXTERN TokEntry *TokEntryAdjust__ (TokEntry * CACHE_TYPE) INLINE_ONLY; inline EXTERN TokEntry * TokEntryAdjust__ (TokEntry * ptr USES_REGS) @@ -363,7 +364,7 @@ TokEntryAdjust__ (TokEntry * ptr USES_REGS) -inline EXTERN VarEntry *VarEntryAdjust__ (VarEntry * CACHE_TYPE); +inline EXTERN VarEntry *VarEntryAdjust__ (VarEntry * CACHE_TYPE) INLINE_ONLY; inline EXTERN VarEntry * VarEntryAdjust__ (VarEntry * ptr USES_REGS) @@ -374,7 +375,7 @@ VarEntryAdjust__ (VarEntry * ptr USES_REGS) /* heap data structures */ -inline EXTERN Functor FuncAdjust__ (Functor CACHE_TYPE); +inline EXTERN Functor FuncAdjust__ (Functor CACHE_TYPE) INLINE_ONLY; inline EXTERN Functor FuncAdjust__ (Functor f USES_REGS) @@ -384,7 +385,7 @@ FuncAdjust__ (Functor f USES_REGS) return f; } -inline EXTERN CELL *CellPtoHeapAdjust__ (CELL * CACHE_TYPE); +inline EXTERN CELL *CellPtoHeapAdjust__ (CELL * CACHE_TYPE) INLINE_ONLY; inline EXTERN CELL * CellPtoHeapAdjust__ (CELL * ptr USES_REGS) @@ -394,7 +395,7 @@ CellPtoHeapAdjust__ (CELL * ptr USES_REGS) return (CELL *) (((CELL *) (CharP (ptr) + LOCAL_HDiff))); } -inline EXTERN HoldEntry *HoldEntryAdjust__ (HoldEntry * CACHE_TYPE); +inline EXTERN HoldEntry *HoldEntryAdjust__ (HoldEntry * CACHE_TYPE) INLINE_ONLY; inline EXTERN HoldEntry * HoldEntryAdjust__ (HoldEntry * ptr USES_REGS) @@ -402,7 +403,7 @@ HoldEntryAdjust__ (HoldEntry * ptr USES_REGS) return (HoldEntry *) (((HoldEntry *) (CharP (ptr) + LOCAL_HDiff))); } -inline EXTERN struct record_list *DBRecordAdjust__ (struct record_list * CACHE_TYPE); +inline EXTERN struct record_list *DBRecordAdjust__ (struct record_list * CACHE_TYPE) INLINE_ONLY; inline EXTERN struct record_list * DBRecordAdjust__ (struct record_list * ptr USES_REGS) @@ -415,7 +416,7 @@ DBRecordAdjust__ (struct record_list * ptr USES_REGS) #if USE_OFFSETS -inline EXTERN Atom AtomAdjust__ (Atom CACHE_TYPE); +inline EXTERN Atom AtomAdjust__ (Atom CACHE_TYPE) INLINE_ONLY; inline EXTERN Atom AtomAdjust__ (Atom at USES_REGS) @@ -423,7 +424,7 @@ AtomAdjust__ (Atom at USES_REGS) return (Atom) ((at)); } -inline EXTERN Atom NoAGCAtomAdjust__ (Atom CACHE_TYPE); +inline EXTERN Atom NoAGCAtomAdjust__ (Atom CACHE_TYPE) INLINE_ONLY; inline EXTERN Atom NoAGCAtomAdjust__ (Atom at USES_REGS) @@ -433,7 +434,7 @@ NoAGCAtomAdjust__ (Atom at USES_REGS) -inline EXTERN Prop PropAdjust__ (Prop CACHE_TYPE); +inline EXTERN Prop PropAdjust__ (Prop CACHE_TYPE) INLINE_ONLY; inline EXTERN Prop PropAdjust__ (Prop p USES_REGS) @@ -443,7 +444,7 @@ PropAdjust__ (Prop p USES_REGS) #else -inline EXTERN Atom AtomAdjust__ (Atom CACHE_TYPE); +inline EXTERN Atom AtomAdjust__ (Atom CACHE_TYPE) INLINE_ONLY; inline EXTERN Atom AtomAdjust__ (Atom at USES_REGS) @@ -451,7 +452,7 @@ AtomAdjust__ (Atom at USES_REGS) return (Atom) ((at == NULL ? (at) : (Atom) (CharP (at) + LOCAL_HDiff))); } -inline EXTERN Atom NoAGCAtomAdjust__ (Atom CACHE_TYPE); +inline EXTERN Atom NoAGCAtomAdjust__ (Atom CACHE_TYPE) INLINE_ONLY; inline EXTERN Atom NoAGCAtomAdjust__ (Atom at USES_REGS) @@ -461,7 +462,7 @@ NoAGCAtomAdjust__ (Atom at USES_REGS) -inline EXTERN Prop PropAdjust__ (Prop CACHE_TYPE); +inline EXTERN Prop PropAdjust__ (Prop CACHE_TYPE) INLINE_ONLY; inline EXTERN Prop PropAdjust__ (Prop p USES_REGS) @@ -472,7 +473,7 @@ PropAdjust__ (Prop p USES_REGS) #endif -inline EXTERN struct PL_blob_t *BlobTypeAdjust__ (struct PL_blob_t *CACHE_TYPE); +inline EXTERN struct PL_blob_t *BlobTypeAdjust__ (struct PL_blob_t *CACHE_TYPE) INLINE_ONLY; inline EXTERN struct PL_blob_t * BlobTypeAdjust__ (struct PL_blob_t *at USES_REGS) @@ -480,7 +481,7 @@ BlobTypeAdjust__ (struct PL_blob_t *at USES_REGS) return (struct PL_blob_t *) ((at == NULL ? (at) : (struct PL_blob_t *) (CharP (at) + LOCAL_HDiff))); } -inline EXTERN PredEntry *PredEntryAdjust__ (PredEntry * CACHE_TYPE); +inline EXTERN PredEntry *PredEntryAdjust__ (PredEntry * CACHE_TYPE) INLINE_ONLY; inline EXTERN PredEntry * PredEntryAdjust__ (PredEntry *p USES_REGS) @@ -488,7 +489,7 @@ PredEntryAdjust__ (PredEntry *p USES_REGS) return (PredEntry *) ((p == NULL ? (p) : (PredEntry *) (CharP (p) + LOCAL_HDiff))); } -inline EXTERN struct mod_entry *ModEntryPtrAdjust__ (struct mod_entry * CACHE_TYPE); +inline EXTERN struct mod_entry *ModEntryPtrAdjust__ (struct mod_entry * CACHE_TYPE) INLINE_ONLY; inline EXTERN struct mod_entry * ModEntryPtrAdjust__ (struct mod_entry *p USES_REGS) @@ -496,7 +497,7 @@ ModEntryPtrAdjust__ (struct mod_entry *p USES_REGS) return (struct mod_entry *) ((p == NULL ? (p) : (struct mod_entry *) (CharP (p) + LOCAL_HDiff))); } -inline EXTERN COUNT ConstantAdjust__ (COUNT CACHE_TYPE); +inline EXTERN COUNT ConstantAdjust__ (COUNT CACHE_TYPE) INLINE_ONLY; inline EXTERN COUNT ConstantAdjust__ (COUNT val USES_REGS) @@ -504,7 +505,7 @@ ConstantAdjust__ (COUNT val USES_REGS) return val; } -inline EXTERN Int ArityAdjust__ (Int CACHE_TYPE); +inline EXTERN Int ArityAdjust__ (Int CACHE_TYPE) INLINE_ONLY; inline EXTERN Int ArityAdjust__ (Int val USES_REGS) @@ -512,7 +513,7 @@ ArityAdjust__ (Int val USES_REGS) return val; } -inline EXTERN OPCODE OpcodeAdjust__ (OPCODE CACHE_TYPE); +inline EXTERN OPCODE OpcodeAdjust__ (OPCODE CACHE_TYPE) INLINE_ONLY; inline EXTERN OPCODE OpcodeAdjust__ (OPCODE val USES_REGS) @@ -528,7 +529,7 @@ OpcodeAdjust__ (OPCODE val USES_REGS) #define ExternalFunctionAdjust(D) (D); -inline EXTERN Term AtomTermAdjust__ (Term CACHE_TYPE); +inline EXTERN Term AtomTermAdjust__ (Term CACHE_TYPE) INLINE_ONLY; inline EXTERN Term AtomTermAdjust__ (Term at USES_REGS) @@ -538,7 +539,7 @@ AtomTermAdjust__ (Term at USES_REGS) return (Term)(CharP(at) + LOCAL_HDiff); } -inline EXTERN Term ModuleAdjust__ (Term CACHE_TYPE); +inline EXTERN Term ModuleAdjust__ (Term CACHE_TYPE) INLINE_ONLY; inline EXTERN Term ModuleAdjust__ (Term t USES_REGS) @@ -546,7 +547,7 @@ ModuleAdjust__ (Term t USES_REGS) return AtomTermAdjust(t); } -inline EXTERN Term CodeVarAdjust__ (Term CACHE_TYPE); +inline EXTERN Term CodeVarAdjust__ (Term CACHE_TYPE) INLINE_ONLY; inline EXTERN Term CodeVarAdjust__ (Term var USES_REGS) @@ -559,7 +560,7 @@ CodeVarAdjust__ (Term var USES_REGS) #if TAGS_FAST_OPS -inline EXTERN Term BlobTermInCodeAdjust__ (Term CACHE_TYPE); +inline EXTERN Term BlobTermInCodeAdjust__ (Term CACHE_TYPE) INLINE_ONLY; inline EXTERN Term BlobTermInCodeAdjust__ (Term t USES_REGS) @@ -568,7 +569,7 @@ BlobTermInCodeAdjust__ (Term t USES_REGS) } -inline EXTERN Term CodeComposedTermAdjust__ (Term CACHE_TYPE); +inline EXTERN Term CodeComposedTermAdjust__ (Term CACHE_TYPE) INLINE_ONLY; inline EXTERN Term CodeComposedTermAdjust__ (Term t USES_REGS) @@ -579,7 +580,7 @@ CodeComposedTermAdjust__ (Term t USES_REGS) #else -inline EXTERN Term BlobTermInCodeAdjust__ (Term CACHE_TYPE); +inline EXTERN Term BlobTermInCodeAdjust__ (Term CACHE_TYPE) INLINE_ONLY; inline EXTERN Term BlobTermInCodeAdjust__ (Term t USES_REGS) @@ -587,7 +588,7 @@ BlobTermInCodeAdjust__ (Term t USES_REGS) return (Term) (CharP(t) + LOCAL_HDiff); } -inline EXTERN Term CodeComposedTermAdjust__ (Term CACHE_TYPE); +inline EXTERN Term CodeComposedTermAdjust__ (Term CACHE_TYPE) INLINE_ONLY; inline EXTERN Term CodeComposedTermAdjust__ (Term t USES_REGS) @@ -598,7 +599,7 @@ CodeComposedTermAdjust__ (Term t USES_REGS) #endif -inline EXTERN AtomEntry *AtomEntryAdjust__ (AtomEntry * CACHE_TYPE); +inline EXTERN AtomEntry *AtomEntryAdjust__ (AtomEntry * CACHE_TYPE) INLINE_ONLY; inline EXTERN AtomEntry * AtomEntryAdjust__ (AtomEntry * at USES_REGS) @@ -606,7 +607,7 @@ AtomEntryAdjust__ (AtomEntry * at USES_REGS) return (AtomEntry *) ((AtomEntry *) (CharP (at) + LOCAL_HDiff)); } -inline EXTERN GlobalEntry *GlobalEntryAdjust__ (GlobalEntry * CACHE_TYPE); +inline EXTERN GlobalEntry *GlobalEntryAdjust__ (GlobalEntry * CACHE_TYPE) INLINE_ONLY; inline EXTERN GlobalEntry * GlobalEntryAdjust__ (GlobalEntry * at USES_REGS) @@ -616,7 +617,7 @@ GlobalEntryAdjust__ (GlobalEntry * at USES_REGS) -inline EXTERN union CONSULT_OBJ *ConsultObjAdjust__ (union CONSULT_OBJ * CACHE_TYPE); +inline EXTERN union CONSULT_OBJ *ConsultObjAdjust__ (union CONSULT_OBJ * CACHE_TYPE) INLINE_ONLY; inline EXTERN union CONSULT_OBJ * ConsultObjAdjust__ (union CONSULT_OBJ *co USES_REGS) @@ -626,7 +627,7 @@ ConsultObjAdjust__ (union CONSULT_OBJ *co USES_REGS) -inline EXTERN DBRef DBRefAdjust__ (DBRef CACHE_TYPE); +inline EXTERN DBRef DBRefAdjust__ (DBRef CACHE_TYPE) INLINE_ONLY; inline EXTERN DBRef DBRefAdjust__ (DBRef dbr USES_REGS) @@ -636,7 +637,7 @@ DBRefAdjust__ (DBRef dbr USES_REGS) -inline EXTERN DBRef *DBRefPAdjust__ (DBRef * CACHE_TYPE); +inline EXTERN DBRef *DBRefPAdjust__ (DBRef * CACHE_TYPE) INLINE_ONLY; inline EXTERN DBRef * DBRefPAdjust__ (DBRef * dbrp USES_REGS) @@ -646,7 +647,7 @@ DBRefPAdjust__ (DBRef * dbrp USES_REGS) -inline EXTERN DBTerm *DBTermAdjust__ (DBTerm * CACHE_TYPE); +inline EXTERN DBTerm *DBTermAdjust__ (DBTerm * CACHE_TYPE) INLINE_ONLY; inline EXTERN DBTerm * DBTermAdjust__ (DBTerm * dbtp USES_REGS) @@ -656,7 +657,7 @@ DBTermAdjust__ (DBTerm * dbtp USES_REGS) -inline EXTERN struct static_index *SIndexAdjust__ (struct static_index * CACHE_TYPE); +inline EXTERN struct static_index *SIndexAdjust__ (struct static_index * CACHE_TYPE) INLINE_ONLY; inline EXTERN struct static_index * SIndexAdjust__ (struct static_index *si USES_REGS) @@ -668,7 +669,7 @@ SIndexAdjust__ (struct static_index *si USES_REGS) inline EXTERN struct logic_upd_index *LUIndexAdjust__ (struct logic_upd_index - * CACHE_TYPE); + * CACHE_TYPE) INLINE_ONLY; inline EXTERN struct logic_upd_index * LUIndexAdjust__ (struct logic_upd_index *lui USES_REGS) @@ -679,7 +680,7 @@ LUIndexAdjust__ (struct logic_upd_index *lui USES_REGS) -inline EXTERN Term CodeAdjust__ (Term CACHE_TYPE); +inline EXTERN Term CodeAdjust__ (Term CACHE_TYPE) INLINE_ONLY; inline EXTERN Term CodeAdjust__ (Term dbr USES_REGS) @@ -689,7 +690,7 @@ CodeAdjust__ (Term dbr USES_REGS) -inline EXTERN ADDR AddrAdjust__ (ADDR CACHE_TYPE); +inline EXTERN ADDR AddrAdjust__ (ADDR CACHE_TYPE) INLINE_ONLY; inline EXTERN ADDR AddrAdjust__ (ADDR addr USES_REGS) @@ -699,7 +700,7 @@ AddrAdjust__ (ADDR addr USES_REGS) -inline EXTERN CODEADDR CodeAddrAdjust__ (CODEADDR CACHE_TYPE); +inline EXTERN CODEADDR CodeAddrAdjust__ (CODEADDR CACHE_TYPE) INLINE_ONLY; inline EXTERN CODEADDR CodeAddrAdjust__ (CODEADDR addr USES_REGS) @@ -708,7 +709,7 @@ CodeAddrAdjust__ (CODEADDR addr USES_REGS) } -inline EXTERN char * CodeCharPAdjust__ (char * CACHE_TYPE); +inline EXTERN char * CodeCharPAdjust__ (char * CACHE_TYPE) INLINE_ONLY; inline EXTERN char * CodeCharPAdjust__ (char * addr USES_REGS) @@ -718,7 +719,7 @@ CodeCharPAdjust__ (char * addr USES_REGS) return addr + LOCAL_HDiff; } -inline EXTERN void * CodeVoidPAdjust__ (void * CACHE_TYPE); +inline EXTERN void * CodeVoidPAdjust__ (void * CACHE_TYPE) INLINE_ONLY; inline EXTERN void * CodeVoidPAdjust__ (void * addr USES_REGS) @@ -728,7 +729,7 @@ CodeVoidPAdjust__ (void * addr USES_REGS) return addr + LOCAL_HDiff; } -inline EXTERN struct halt_hook *HaltHookAdjust__ (struct halt_hook * CACHE_TYPE); +inline EXTERN struct halt_hook *HaltHookAdjust__ (struct halt_hook * CACHE_TYPE) INLINE_ONLY; inline EXTERN struct halt_hook * HaltHookAdjust__ (struct halt_hook * addr USES_REGS) @@ -738,7 +739,7 @@ HaltHookAdjust__ (struct halt_hook * addr USES_REGS) return (struct halt_hook *) (CharP (addr) + LOCAL_HDiff); } -inline EXTERN BlockHeader *BlockAdjust__ (BlockHeader * CACHE_TYPE); +inline EXTERN BlockHeader *BlockAdjust__ (BlockHeader * CACHE_TYPE) INLINE_ONLY; inline EXTERN BlockHeader * BlockAdjust__ (BlockHeader * addr USES_REGS) @@ -746,7 +747,7 @@ BlockAdjust__ (BlockHeader * addr USES_REGS) return (BlockHeader *) ((BlockHeader *) (CharP (addr) + LOCAL_HDiff)); } -inline EXTERN yamop *PtoOpAdjust__ (yamop * CACHE_TYPE); +inline EXTERN yamop *PtoOpAdjust__ (yamop * CACHE_TYPE) INLINE_ONLY; inline EXTERN yamop * PtoOpAdjust__ (yamop * ptr USES_REGS) @@ -756,7 +757,7 @@ PtoOpAdjust__ (yamop * ptr USES_REGS) return ptr; } -inline EXTERN struct operator_entry *OpListAdjust__ (struct operator_entry * CACHE_TYPE); +inline EXTERN struct operator_entry *OpListAdjust__ (struct operator_entry * CACHE_TYPE) INLINE_ONLY; inline EXTERN struct operator_entry * OpListAdjust__ (struct operator_entry * ptr USES_REGS) @@ -767,7 +768,7 @@ OpListAdjust__ (struct operator_entry * ptr USES_REGS) } -inline EXTERN struct logic_upd_clause *PtoLUClauseAdjust__ (struct logic_upd_clause * CACHE_TYPE); +inline EXTERN struct logic_upd_clause *PtoLUClauseAdjust__ (struct logic_upd_clause * CACHE_TYPE) INLINE_ONLY; inline EXTERN struct logic_upd_clause * PtoLUClauseAdjust__ (struct logic_upd_clause * ptr USES_REGS) @@ -775,7 +776,7 @@ PtoLUClauseAdjust__ (struct logic_upd_clause * ptr USES_REGS) return (struct logic_upd_clause *) (CharP (ptr) + LOCAL_HDiff); } -inline EXTERN struct logic_upd_index *PtoLUIndexAdjust__ (struct logic_upd_index * CACHE_TYPE); +inline EXTERN struct logic_upd_index *PtoLUIndexAdjust__ (struct logic_upd_index * CACHE_TYPE) INLINE_ONLY; inline EXTERN struct logic_upd_index * PtoLUIndexAdjust__ (struct logic_upd_index * ptr USES_REGS) @@ -785,7 +786,7 @@ PtoLUIndexAdjust__ (struct logic_upd_index * ptr USES_REGS) -inline EXTERN CELL *PtoHeapCellAdjust__ (CELL * CACHE_TYPE); +inline EXTERN CELL *PtoHeapCellAdjust__ (CELL * CACHE_TYPE) INLINE_ONLY; inline EXTERN CELL * PtoHeapCellAdjust__ (CELL * ptr USES_REGS) @@ -793,7 +794,7 @@ PtoHeapCellAdjust__ (CELL * ptr USES_REGS) return (CELL *) (((CELL *) (CharP (ptr) + LOCAL_HDiff))); } -inline EXTERN AtomHashEntry *PtoAtomHashEntryAdjust__ (AtomHashEntry * CACHE_TYPE); +inline EXTERN AtomHashEntry *PtoAtomHashEntryAdjust__ (AtomHashEntry * CACHE_TYPE) INLINE_ONLY; inline EXTERN AtomHashEntry * PtoAtomHashEntryAdjust__ (AtomHashEntry * ptr USES_REGS) @@ -801,7 +802,7 @@ PtoAtomHashEntryAdjust__ (AtomHashEntry * ptr USES_REGS) return (AtomHashEntry *) (((AtomHashEntry *) (CharP (ptr) + LOCAL_HDiff))); } -inline EXTERN Term TermToGlobalAdjust__ (Term CACHE_TYPE); +inline EXTERN Term TermToGlobalAdjust__ (Term CACHE_TYPE) INLINE_ONLY; inline EXTERN Term TermToGlobalAdjust__ (Term t USES_REGS) @@ -811,7 +812,7 @@ TermToGlobalAdjust__ (Term t USES_REGS) return AbsAppl(PtoGloAdjust(RepAppl(t))); } -inline EXTERN Term TermToGlobalOrAtomAdjust__ (Term CACHE_TYPE); +inline EXTERN Term TermToGlobalOrAtomAdjust__ (Term CACHE_TYPE) INLINE_ONLY; inline EXTERN Term TermToGlobalOrAtomAdjust__ (Term t USES_REGS) @@ -827,7 +828,7 @@ TermToGlobalOrAtomAdjust__ (Term t USES_REGS) return t; } -inline EXTERN opentry *OpRTableAdjust__ (opentry * CACHE_TYPE); +inline EXTERN opentry *OpRTableAdjust__ (opentry * CACHE_TYPE) INLINE_ONLY; inline EXTERN opentry * OpRTableAdjust__ (opentry * ptr USES_REGS) @@ -835,7 +836,7 @@ OpRTableAdjust__ (opentry * ptr USES_REGS) return (opentry *) (((opentry *) (CharP (ptr) + LOCAL_HDiff))); } -inline EXTERN OpEntry *OpEntryAdjust__ (OpEntry * CACHE_TYPE); +inline EXTERN OpEntry *OpEntryAdjust__ (OpEntry * CACHE_TYPE) INLINE_ONLY; inline EXTERN OpEntry * OpEntryAdjust__ (OpEntry * ptr USES_REGS) @@ -843,7 +844,7 @@ OpEntryAdjust__ (OpEntry * ptr USES_REGS) return (OpEntry *) (((OpEntry *) (CharP (ptr) + LOCAL_HDiff))); } -inline EXTERN PredEntry *PtoPredAdjust__ (PredEntry * CACHE_TYPE); +inline EXTERN PredEntry *PtoPredAdjust__ (PredEntry * CACHE_TYPE) INLINE_ONLY; inline EXTERN PredEntry * PtoPredAdjust__ (PredEntry * ptr USES_REGS) @@ -851,7 +852,7 @@ PtoPredAdjust__ (PredEntry * ptr USES_REGS) return (PredEntry *) (((PredEntry *) (CharP (ptr) + LOCAL_HDiff))); } -inline EXTERN PredEntry **PtoPtoPredAdjust__ (PredEntry ** CACHE_TYPE); +inline EXTERN PredEntry **PtoPtoPredAdjust__ (PredEntry ** CACHE_TYPE) INLINE_ONLY; inline EXTERN PredEntry ** PtoPtoPredAdjust__ (PredEntry **ptr USES_REGS) @@ -863,7 +864,7 @@ PtoPtoPredAdjust__ (PredEntry **ptr USES_REGS) -inline EXTERN ArrayEntry *PtoArrayEAdjust__ (ArrayEntry * CACHE_TYPE); +inline EXTERN ArrayEntry *PtoArrayEAdjust__ (ArrayEntry * CACHE_TYPE) INLINE_ONLY; inline EXTERN ArrayEntry * PtoArrayEAdjust__ (ArrayEntry * ptr USES_REGS) @@ -874,7 +875,7 @@ PtoArrayEAdjust__ (ArrayEntry * ptr USES_REGS) } -inline EXTERN GlobalEntry *PtoGlobalEAdjust__ (GlobalEntry * CACHE_TYPE); +inline EXTERN GlobalEntry *PtoGlobalEAdjust__ (GlobalEntry * CACHE_TYPE) INLINE_ONLY; inline EXTERN GlobalEntry * PtoGlobalEAdjust__ (GlobalEntry * ptr USES_REGS) @@ -885,7 +886,7 @@ PtoGlobalEAdjust__ (GlobalEntry * ptr USES_REGS) } -inline EXTERN StaticArrayEntry *PtoArraySAdjust__ (StaticArrayEntry * CACHE_TYPE); +inline EXTERN StaticArrayEntry *PtoArraySAdjust__ (StaticArrayEntry * CACHE_TYPE) INLINE_ONLY; inline EXTERN StaticArrayEntry * PtoArraySAdjust__ (StaticArrayEntry * ptr USES_REGS) @@ -897,7 +898,7 @@ PtoArraySAdjust__ (StaticArrayEntry * ptr USES_REGS) -inline EXTERN struct logic_upd_clause *PtoLUCAdjust__ (struct logic_upd_clause* CACHE_TYPE); +inline EXTERN struct logic_upd_clause *PtoLUCAdjust__ (struct logic_upd_clause* CACHE_TYPE) INLINE_ONLY; inline EXTERN struct logic_upd_clause * PtoLUCAdjust__ (struct logic_upd_clause *ptr USES_REGS) @@ -908,7 +909,7 @@ PtoLUCAdjust__ (struct logic_upd_clause *ptr USES_REGS) -inline EXTERN struct static_clause *PtoStCAdjust__ (struct static_clause * CACHE_TYPE); +inline EXTERN struct static_clause *PtoStCAdjust__ (struct static_clause * CACHE_TYPE) INLINE_ONLY; inline EXTERN struct static_clause * PtoStCAdjust__ (struct static_clause *ptr USES_REGS) @@ -918,7 +919,7 @@ PtoStCAdjust__ (struct static_clause *ptr USES_REGS) } -inline EXTERN struct dbterm_list *PtoDBTLAdjust__ (struct dbterm_list * CACHE_TYPE); +inline EXTERN struct dbterm_list *PtoDBTLAdjust__ (struct dbterm_list * CACHE_TYPE) INLINE_ONLY; inline EXTERN struct dbterm_list * PtoDBTLAdjust__ (struct dbterm_list * addr USES_REGS) @@ -929,7 +930,7 @@ PtoDBTLAdjust__ (struct dbterm_list * addr USES_REGS) #if PRECOMPUTE_REGADDRESS -inline EXTERN wamreg XAdjust__ (wamreg CACHE_TYPE); +inline EXTERN wamreg XAdjust__ (wamreg CACHE_TYPE) INLINE_ONLY; inline EXTERN wamreg XAdjust__ (wamreg reg USES_REGS) @@ -940,7 +941,7 @@ XAdjust__ (wamreg reg USES_REGS) #else -inline EXTERN wamreg XAdjust__ (wamreg CACHE_TYPE); +inline EXTERN wamreg XAdjust__ (wamreg CACHE_TYPE) INLINE_ONLY; inline EXTERN wamreg XAdjust__ (wamreg reg USES_REGS) @@ -951,7 +952,7 @@ XAdjust__ (wamreg reg USES_REGS) #endif -inline EXTERN yslot YAdjust__ (yslot CACHE_TYPE); +inline EXTERN yslot YAdjust__ (yslot CACHE_TYPE) INLINE_ONLY; inline EXTERN yslot YAdjust__ (yslot reg USES_REGS) @@ -961,7 +962,7 @@ YAdjust__ (yslot reg USES_REGS) -inline EXTERN int IsOldLocal__ (CELL CACHE_TYPE); +inline EXTERN int IsOldLocal__ (CELL CACHE_TYPE) INLINE_ONLY; inline EXTERN int IsOldLocal__ (CELL reg USES_REGS) @@ -971,7 +972,7 @@ IsOldLocal__ (CELL reg USES_REGS) -inline EXTERN int IsOldLocalPtr__ (CELL * CACHE_TYPE); +inline EXTERN int IsOldLocalPtr__ (CELL * CACHE_TYPE) INLINE_ONLY; inline EXTERN int IsOldLocalPtr__ (CELL * ptr USES_REGS) @@ -983,7 +984,7 @@ IsOldLocalPtr__ (CELL * ptr USES_REGS) /* require because the trail might contain dangling pointers */ -inline EXTERN int IsOldLocalInTR__ (CELL CACHE_TYPE); +inline EXTERN int IsOldLocalInTR__ (CELL CACHE_TYPE) INLINE_ONLY; inline EXTERN int IsOldLocalInTR__ (CELL reg USES_REGS) @@ -993,7 +994,7 @@ IsOldLocalInTR__ (CELL reg USES_REGS) -inline EXTERN int IsOldLocalInTRPtr__ (CELL * CACHE_TYPE); +inline EXTERN int IsOldLocalInTRPtr__ (CELL * CACHE_TYPE) INLINE_ONLY; inline EXTERN int IsOldLocalInTRPtr__ (CELL * ptr USES_REGS) @@ -1004,7 +1005,7 @@ IsOldLocalInTRPtr__ (CELL * ptr USES_REGS) -inline EXTERN int IsOldH__ (CELL CACHE_TYPE); +inline EXTERN int IsOldH__ (CELL CACHE_TYPE) INLINE_ONLY; inline EXTERN int IsOldH__ (CELL reg USES_REGS) @@ -1016,7 +1017,7 @@ IsOldH__ (CELL reg USES_REGS) -inline EXTERN int IsOldGlobal__ (CELL CACHE_TYPE); +inline EXTERN int IsOldGlobal__ (CELL CACHE_TYPE) INLINE_ONLY; inline EXTERN int IsOldGlobal__ (CELL reg USES_REGS) @@ -1025,7 +1026,7 @@ IsOldGlobal__ (CELL reg USES_REGS) } -inline EXTERN int IsOldDelay__ (CELL CACHE_TYPE); +inline EXTERN int IsOldDelay__ (CELL CACHE_TYPE) INLINE_ONLY; inline EXTERN int IsOldDelay__ (CELL reg USES_REGS) @@ -1035,7 +1036,7 @@ IsOldDelay__ (CELL reg USES_REGS) -inline EXTERN int IsOldGlobalPtr__ (CELL * CACHE_TYPE); +inline EXTERN int IsOldGlobalPtr__ (CELL * CACHE_TYPE) INLINE_ONLY; inline EXTERN int IsOldGlobalPtr__ (CELL * ptr USES_REGS) @@ -1045,7 +1046,7 @@ IsOldGlobalPtr__ (CELL * ptr USES_REGS) -inline EXTERN int IsOldTrail__ (CELL CACHE_TYPE); +inline EXTERN int IsOldTrail__ (CELL CACHE_TYPE) INLINE_ONLY; inline EXTERN int IsOldTrail__ (CELL reg USES_REGS) @@ -1055,7 +1056,7 @@ IsOldTrail__ (CELL reg USES_REGS) -inline EXTERN int IsOldTrailPtr__ (CELL * CACHE_TYPE); +inline EXTERN int IsOldTrailPtr__ (CELL * CACHE_TYPE) INLINE_ONLY; inline EXTERN int IsOldTrailPtr__ (CELL * ptr USES_REGS) @@ -1065,7 +1066,7 @@ IsOldTrailPtr__ (CELL * ptr USES_REGS) -inline EXTERN int IsOldVarTableTrailPtr__ (struct VARSTRUCT * CACHE_TYPE); +inline EXTERN int IsOldVarTableTrailPtr__ (struct VARSTRUCT * CACHE_TYPE) INLINE_ONLY; inline EXTERN int IsOldVarTableTrailPtr__ (struct VARSTRUCT *ptr USES_REGS) @@ -1075,7 +1076,7 @@ IsOldVarTableTrailPtr__ (struct VARSTRUCT *ptr USES_REGS) -inline EXTERN int IsOldTokenTrailPtr__ (struct TOKEN * CACHE_TYPE); +inline EXTERN int IsOldTokenTrailPtr__ (struct TOKEN * CACHE_TYPE) INLINE_ONLY; inline EXTERN int IsOldTokenTrailPtr__ (struct TOKEN *ptr USES_REGS) @@ -1085,7 +1086,7 @@ IsOldTokenTrailPtr__ (struct TOKEN *ptr USES_REGS) -inline EXTERN int IsOldCode__ (CELL CACHE_TYPE); +inline EXTERN int IsOldCode__ (CELL CACHE_TYPE) INLINE_ONLY; inline EXTERN int IsOldCode__ (CELL reg USES_REGS) @@ -1099,7 +1100,7 @@ IsOldCode__ (CELL reg USES_REGS) -inline EXTERN int IsOldCodeCellPtr__ (CELL * CACHE_TYPE); +inline EXTERN int IsOldCodeCellPtr__ (CELL * CACHE_TYPE) INLINE_ONLY; inline EXTERN int IsOldCodeCellPtr__ (CELL * ptr USES_REGS) @@ -1109,7 +1110,7 @@ IsOldCodeCellPtr__ (CELL * ptr USES_REGS) -inline EXTERN int IsGlobal__ (CELL CACHE_TYPE); +inline EXTERN int IsGlobal__ (CELL CACHE_TYPE) INLINE_ONLY; inline EXTERN int IsGlobal__ (CELL reg USES_REGS) diff --git a/H/yapio.h b/H/yapio.h index c6126922a..7173f0542 100644 --- a/H/yapio.h +++ b/H/yapio.h @@ -230,7 +230,8 @@ typedef struct AliasDescS { #define NUMBER_OF_CHARS 256 extern char *Yap_chtype; -EXTERN inline int STD_PROTO(chtype,(Int)); +#include "inline-only.h" +EXTERN inline int STD_PROTO(chtype,(Int)) INLINE_ONLY; int STD_PROTO(Yap_wide_chtype,(Int)); EXTERN inline int @@ -323,8 +324,8 @@ int STD_PROTO(Yap_growtrail_in_parser, (tr_fr_ptr *, TokEntry **, VarEntry **) extern int errno; #endif -EXTERN inline UInt STD_PROTO(HashFunction, (unsigned char *)); -EXTERN inline UInt STD_PROTO(WideHashFunction, (wchar_t *)); +EXTERN inline UInt STD_PROTO(HashFunction, (unsigned char *)) INLINE_ONLY; +EXTERN inline UInt STD_PROTO(WideHashFunction, (wchar_t *)) INLINE_ONLY; EXTERN inline UInt HashFunction(unsigned char *CHP) diff --git a/Makefile.in b/Makefile.in index 0229b3694..d38904b3a 100755 --- a/Makefile.in +++ b/Makefile.in @@ -173,9 +173,10 @@ HEADERS = \ $(srcdir)/H/hlocals.h \ $(srcdir)/H/hstruct.h \ $(srcdir)/H/iglobals.h \ - $(srcdir)/H/ilocals.h \ $(srcdir)/H/ihstruct.h \ + $(srcdir)/H/ilocals.h \ $(srcdir)/H/index.h \ + $(srcdir)/H/inline-only.h \ $(srcdir)/H/iopreds.h \ $(srcdir)/H/iswiatoms.h \ $(srcdir)/H/qly.h \ diff --git a/library/dialect/bprolog/fli/bprolog.h b/library/dialect/bprolog/fli/bprolog.h index 0e94fb54a..1a61b491d 100644 --- a/library/dialect/bprolog/fli/bprolog.h +++ b/library/dialect/bprolog/fli/bprolog.h @@ -5,6 +5,7 @@ #include #include +#include "inline-only.h" typedef YAP_Term TERM; typedef YAP_Int BPLONG; @@ -118,10 +119,10 @@ bp_get_arity(TERM t) // TERM bp_insert_pred(char *name, int arity, int (*func)()) #define bp_insert_pred(name, arity, func) YAP_UserCPredicate(name, func, arity) -extern inline int bp_call_string(const char *goal); -extern inline int bp_call_term(TERM t); -extern inline int bp_next_solution(void); -extern inline int bp_mount_query_term(TERM goal); +extern inline int bp_call_string(const char *goal) INLINE_ONLY; +extern inline int bp_call_term(TERM t) INLINE_ONLY; +extern inline int bp_next_solution(void) INLINE_ONLY; +extern inline int bp_mount_query_term(TERM goal) INLINE_ONLY; // int bp_call_string(char *goal) extern inline int diff --git a/packages/prism/src/c/core/bpx.h b/packages/prism/src/c/core/bpx.h index e42612173..a430a46e4 100755 --- a/packages/prism/src/c/core/bpx.h +++ b/packages/prism/src/c/core/bpx.h @@ -80,17 +80,19 @@ long int XTAG(TERM t) } } -extern inline TERM ADDTAG(void * t,int tag); -extern inline int is_UNIFIABLE(TERM t1, TERM t2); -extern inline int is_IDENTICAL(TERM t1, TERM t2); -extern inline char *bp_term_2_string(TERM t); -extern inline int bp_string_2_term(const char *s, TERM to, TERM tv); -extern inline SYM_REC_PTR insert(const char *name, int size, int arity); -extern inline int compare(TERM t1, TERM t2); -extern inline void write_term(TERM t); -extern inline void numberVarTermOpt(TERM t); -extern inline TERM unnumberVarTerm(TERM t, BPLONG_PTR pt1, BPLONG_PTR pt2); -extern inline int unifyNumberedTerms(TERM t1, TERM t2); +#include "inline-only.h" + +extern inline TERM ADDTAG(void * t,int tag) INLINE_ONLY; +extern inline int is_UNIFIABLE(TERM t1, TERM t2) INLINE_ONLY; +extern inline int is_IDENTICAL(TERM t1, TERM t2) INLINE_ONLY; +extern inline char *bp_term_2_string(TERM t) INLINE_ONLY; +extern inline int bp_string_2_term(const char *s, TERM to, TERM tv) INLINE_ONLY; +extern inline SYM_REC_PTR insert(const char *name, int size, int arity) INLINE_ONLY; +extern inline int compare(TERM t1, TERM t2) INLINE_ONLY; +extern inline void write_term(TERM t) INLINE_ONLY; +extern inline void numberVarTermOpt(TERM t) INLINE_ONLY; +extern inline TERM unnumberVarTerm(TERM t, BPLONG_PTR pt1, BPLONG_PTR pt2) INLINE_ONLY; +extern inline int unifyNumberedTerms(TERM t1, TERM t2) INLINE_ONLY; int bpx_call_term(TERM t); int bpx_call_string(const char *s);