#ifndef CONTEXT_ACCESS_DIAG_H #define CONTEXT_ACCESS_DIAG_H #include "kernels.h" #include /* GCC-only diagnostic worker: each expression is evaluated once. */ void ax_access(const char *,const void *,size_t,const char *,const char *); void ax_bind(NativePropertyCache *,NativePipeCache *); void ax_begin(unsigned long long,int,int,double,const double *,int); void ax_end(const double *,int); void ax_result(int); void ax_finish(void); void ax_query(const char *,const NativeMedium *,double,double); void ax_match(const char *,NativePropertyState *); void ax_new(NativePropertyCache *,NativePropertyState *,int); unsigned ax_test(NativePropertyState *,unsigned,const char *); void ax_scalar(const char *,NativeJacobianScalars *,int,int,const double *,size_t,int,const double *); #define AX_R(x) ({ __typeof__(x) ax_v=(x); ax_access("read",&(x),sizeof(x),#x,__func__); ax_v; }) #define AX_W(x,v) do { (x)=(v); ax_access("write",&(x),sizeof(x),#x,__func__); } while(0) #define AX_OR(x,v) do { (x)|=(v); ax_access("write",&(x),sizeof(x),#x,__func__); } while(0) #define AX_INC(x) ({ __typeof__(x) ax_v=(x)++; ax_access("write",&(x),sizeof(x),#x,__func__); ax_v; }) #endif