1178479Sjb/*
2178479Sjb * CDDL HEADER START
3178479Sjb *
4178479Sjb * The contents of this file are subject to the terms of the
5178479Sjb * Common Development and Distribution License, Version 1.0 only
6178479Sjb * (the "License").  You may not use this file except in compliance
7178479Sjb * with the License.
8178479Sjb *
9178479Sjb * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10178479Sjb * or http://www.opensolaris.org/os/licensing.
11178479Sjb * See the License for the specific language governing permissions
12178479Sjb * and limitations under the License.
13178479Sjb *
14178479Sjb * When distributing Covered Code, include this CDDL HEADER in each
15178479Sjb * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16178479Sjb * If applicable, add the following below this CDDL HEADER, with the
17178479Sjb * fields enclosed by brackets "[]" replaced with your own identifying
18178479Sjb * information: Portions Copyright [yyyy] [name of copyright owner]
19178479Sjb *
20178479Sjb * CDDL HEADER END
21178479Sjb */
22178479Sjb/*
23178479Sjb * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24178479Sjb * Use is subject to license terms.
25178479Sjb */
26178479Sjb
27248708Spfg /*
28248708Spfg  * Copyright (c) 2011, Joyent, Inc. All rights reserved.
29250812Smarkj  * Copyright (c) 2012 by Delphix. All rights reserved.
30248708Spfg  */
31248708Spfg
32178479Sjb#ifndef	_DT_ERRTAGS_H
33178479Sjb#define	_DT_ERRTAGS_H
34178479Sjb
35178479Sjb#ifdef	__cplusplus
36178479Sjbextern "C" {
37178479Sjb#endif
38178479Sjb
39178479Sjb/*
40178479Sjb * This enum definition is used to define a set of error tags associated with
41178479Sjb * the D compiler's various error conditions.  The shell script mkerrtags.sh is
42178479Sjb * used to parse this file and create a corresponding dt_errtags.c source file.
43178479Sjb * If you do something other than add a new error tag here, you may need to
44178479Sjb * update the mkerrtags shell script as it is based upon simple regexps.
45178479Sjb */
46178479Sjbtypedef enum {
47178479Sjb	D_UNKNOWN,			/* unknown D compiler error */
48178479Sjb	D_SYNTAX,			/* syntax error in input stream */
49178479Sjb	D_EMPTY,			/* empty translation unit */
50178479Sjb	D_TYPE_ERR,			/* type definition missing */
51178479Sjb	D_TYPE_MEMBER,			/* type member not found */
52178479Sjb	D_ASRELO,			/* relocation remains against symbol */
53178479Sjb	D_CG_EXPR,			/* tracing function called from expr */
54178479Sjb	D_CG_DYN,			/* expression returns dynamic result */
55178479Sjb	D_ATTR_MIN,			/* attributes less than amin setting */
56178479Sjb	D_ID_OFLOW,			/* identifier space overflow */
57178479Sjb	D_PDESC_ZERO,			/* probedesc matches zero probes */
58178479Sjb	D_PDESC_INVAL,			/* probedesc is not valid */
59178479Sjb	D_PRED_SCALAR,			/* predicate must be of scalar type */
60178479Sjb	D_FUNC_IDENT,			/* function designator is not ident */
61178479Sjb	D_FUNC_UNDEF,			/* function ident is not defined */
62178479Sjb	D_FUNC_IDKIND,			/* function ident is of wrong idkind */
63178479Sjb	D_OFFSETOF_TYPE,		/* offsetof arg is not sou type */
64178479Sjb	D_OFFSETOF_BITFIELD,		/* offsetof applied to field member */
65178479Sjb	D_SIZEOF_TYPE,			/* invalid sizeof type */
66178479Sjb	D_SIZEOF_BITFIELD,		/* sizeof applied to field member */
67178479Sjb	D_STRINGOF_TYPE,		/* invalid stringof type */
68178479Sjb	D_OP_IDENT,			/* operand must be an identifier */
69178479Sjb	D_OP_INT,			/* operand must be integral type */
70178479Sjb	D_OP_SCALAR,			/* operand must be scalar type */
71178479Sjb	D_OP_ARITH,			/* operand must be arithmetic type */
72178479Sjb	D_OP_WRITE,			/* operand must be writable variable */
73178479Sjb	D_OP_LVAL,			/* operand must be lvalue */
74178479Sjb	D_OP_INCOMPAT,			/* operand types are not compatible */
75178479Sjb	D_OP_VFPTR,			/* operand cannot be void or func ptr */
76178479Sjb	D_OP_ARRFUN,			/* operand cannot be array or func */
77178479Sjb	D_OP_PTR,			/* operand must be a pointer */
78178479Sjb	D_OP_SOU,			/* operand must be struct or union */
79178479Sjb	D_OP_INCOMPLETE,		/* operand is an incomplete type */
80178479Sjb	D_OP_DYN,			/* operand cannot be of dynamic type */
81178479Sjb	D_OP_ACT,			/* operand cannot be action */
82178479Sjb	D_AGG_REDEF,			/* aggregation cannot be redefined */
83178479Sjb	D_AGG_FUNC,			/* aggregating function required */
84178479Sjb	D_AGG_MDIM,			/* aggregation used as multi-dim arr */
85178479Sjb	D_ARR_BADREF,			/* access non-array using tuple */
86178479Sjb	D_ARR_LOCAL,			/* cannot define local assc array */
87178479Sjb	D_DIV_ZERO,			/* division by zero detected */
88178479Sjb	D_DEREF_NONPTR,			/* dereference non-pointer type */
89178479Sjb	D_DEREF_VOID,			/* dereference void pointer */
90178479Sjb	D_DEREF_FUNC,			/* dereference function pointer */
91178479Sjb	D_ADDROF_LVAL,			/* unary & applied to non-lvalue */
92178479Sjb	D_ADDROF_VAR,			/* unary & applied to variable */
93178479Sjb	D_ADDROF_BITFIELD,		/* unary & applied to field member */
94178479Sjb	D_XLATE_REDECL,			/* translator redeclared */
95178479Sjb	D_XLATE_NOCONV,			/* no conversion for member defined */
96178479Sjb	D_XLATE_NONE,			/* no translator for type combo */
97178479Sjb	D_XLATE_SOU,			/* dst must be struct or union type */
98178479Sjb	D_XLATE_INCOMPAT,		/* translator member type incompat */
99178479Sjb	D_XLATE_MEMB,			/* translator member is not valid */
100178479Sjb	D_CAST_INVAL,			/* invalid cast expression */
101178479Sjb	D_PRAGERR,			/* #pragma error message */
102178479Sjb	D_PRAGCTL_INVAL,		/* invalid control directive */
103178479Sjb	D_PRAGMA_INVAL,			/* invalid compiler pragma */
104178479Sjb	D_PRAGMA_UNUSED,		/* unused compiler pragma */
105178479Sjb	D_PRAGMA_MALFORM,		/* malformed #pragma argument list */
106178479Sjb	D_PRAGMA_OPTSET,		/* failed to set #pragma option */
107178479Sjb	D_PRAGMA_SCOPE,			/* #pragma identifier scope error */
108178479Sjb	D_PRAGMA_DEPEND,		/* #pragma dependency not satisfied */
109178479Sjb	D_MACRO_UNDEF,			/* macro parameter is not defined */
110178479Sjb	D_MACRO_OFLOW,			/* macro parameter integer overflow */
111178479Sjb	D_MACRO_UNUSED,			/* macro parameter is never used */
112178479Sjb	D_INT_OFLOW,			/* integer constant overflow */
113178479Sjb	D_INT_DIGIT,			/* integer digit is not valid */
114178479Sjb	D_STR_NL,			/* newline in string literal */
115178479Sjb	D_CHR_NL,			/* newline in character constant */
116178479Sjb	D_CHR_NULL,			/* empty character constant */
117178479Sjb	D_CHR_OFLOW,			/* character constant is too long */
118178479Sjb	D_IDENT_BADREF,			/* identifier expected type mismatch */
119178479Sjb	D_IDENT_UNDEF,			/* identifier is not known/defined */
120178479Sjb	D_IDENT_AMBIG,			/* identifier is ambiguous (var/enum) */
121178479Sjb	D_SYM_BADREF,			/* kernel/user symbol ref mismatch */
122178479Sjb	D_SYM_NOTYPES,			/* no CTF data available for sym ref */
123178479Sjb	D_SYM_MODEL,			/* module/program data model mismatch */
124178479Sjb	D_VAR_UNDEF,			/* reference to undefined variable */
125178479Sjb	D_VAR_UNSUP,			/* unsupported variable specification */
126178479Sjb	D_PROTO_LEN,			/* prototype length mismatch */
127178479Sjb	D_PROTO_ARG,			/* prototype argument mismatch */
128178479Sjb	D_ARGS_MULTI,			/* description matches unstable set */
129178479Sjb	D_ARGS_XLATOR,			/* no args[] translator defined */
130178479Sjb	D_ARGS_NONE,			/* no args[] available */
131178479Sjb	D_ARGS_TYPE,			/* invalid args[] type */
132178479Sjb	D_ARGS_IDX,			/* invalid args[] index */
133178479Sjb	D_REGS_IDX,			/* invalid regs[] index */
134178479Sjb	D_KEY_TYPE,			/* invalid agg or array key type */
135178479Sjb	D_PRINTF_DYN_PROTO,		/* dynamic size argument missing */
136178479Sjb	D_PRINTF_DYN_TYPE,		/* dynamic size type mismatch */
137178479Sjb	D_PRINTF_AGG_CONV,		/* improper use of %@ conversion */
138178479Sjb	D_PRINTF_ARG_PROTO,		/* conversion missing value argument */
139178479Sjb	D_PRINTF_ARG_TYPE,		/* conversion arg has wrong type */
140178479Sjb	D_PRINTF_ARG_EXTRA,		/* extra arguments specified */
141178479Sjb	D_PRINTF_ARG_FMT,		/* format string is not a constant */
142178479Sjb	D_PRINTF_FMT_EMPTY,		/* format string is empty */
143178479Sjb	D_DECL_CHARATTR,		/* bad attributes for char decl */
144178479Sjb	D_DECL_VOIDATTR,		/* bad attributes for void decl */
145178479Sjb	D_DECL_SIGNINT,			/* sign/unsign with non-integer decl */
146178479Sjb	D_DECL_LONGINT,			/* long with non-arithmetic decl */
147178479Sjb	D_DECL_IDENT,			/* old-style declaration or bad type */
148178479Sjb	D_DECL_CLASS,			/* more than one storage class given */
149178479Sjb	D_DECL_BADCLASS,		/* decl class not supported in D */
150178479Sjb	D_DECL_PARMCLASS,		/* invalid class for parameter type */
151178479Sjb	D_DECL_COMBO, 			/* bad decl specifier combination */
152178479Sjb	D_DECL_ARRSUB,			/* const int required for array size */
153178479Sjb	D_DECL_ARRNULL,			/* array decl requires dim or tuple */
154178479Sjb	D_DECL_ARRBIG,			/* array size too big */
155178479Sjb	D_DECL_IDRED,			/* decl identifier redeclared */
156178479Sjb	D_DECL_TYPERED,			/* decl type redeclared */
157178479Sjb	D_DECL_MNAME,			/* member name missing */
158178479Sjb	D_DECL_SCOPE,			/* scoping operator used in decl */
159178479Sjb	D_DECL_BFCONST,			/* bit-field requires const size expr */
160178479Sjb	D_DECL_BFSIZE,			/* bit-field size too big for type */
161178479Sjb	D_DECL_BFTYPE,			/* bit-field type is not valid */
162178479Sjb	D_DECL_ENCONST,			/* enum tag requires const size expr */
163178479Sjb	D_DECL_ENOFLOW,			/* enumerator value overflows INT_MAX */
164178479Sjb	D_DECL_USELESS,			/* useless external declaration */
165178479Sjb	D_DECL_LOCASSC,			/* attempt to decl local assc array */
166178479Sjb	D_DECL_VOIDOBJ,			/* attempt to decl void object */
167178479Sjb	D_DECL_DYNOBJ,			/* attempt to decl dynamic object */
168178479Sjb	D_DECL_INCOMPLETE,		/* declaration uses incomplete type */
169178479Sjb	D_DECL_PROTO_VARARGS,		/* varargs not allowed in prototype */
170178479Sjb	D_DECL_PROTO_TYPE,		/* type not allowed in prototype */
171178479Sjb	D_DECL_PROTO_VOID,		/* void must be sole parameter */
172178479Sjb	D_DECL_PROTO_NAME,		/* void parameter may not have a name */
173178479Sjb	D_DECL_PROTO_FORM,		/* parameter name has no formal */
174178479Sjb	D_COMM_COMM,			/* commit() after commit() */
175178479Sjb	D_COMM_DREC,			/* commit() after data action */
176178479Sjb	D_SPEC_SPEC,			/* speculate() after speculate() */
177178479Sjb	D_SPEC_COMM,			/* speculate() after commit() */
178178479Sjb	D_SPEC_DREC,			/* speculate() after data action */
179178479Sjb	D_AGG_COMM,			/* aggregating act after commit() */
180178479Sjb	D_AGG_SPEC,			/* aggregating act after speculate() */
181178479Sjb	D_AGG_NULL,			/* aggregation stmt has null effect */
182178479Sjb	D_AGG_SCALAR,			/* aggregating function needs scalar */
183178479Sjb	D_ACT_SPEC,			/* destructive action after speculate */
184178479Sjb	D_EXIT_SPEC,			/* exit() action after speculate */
185178479Sjb	D_DREC_COMM,			/* data action after commit() */
186178479Sjb	D_PRINTA_PROTO,			/* printa() prototype mismatch */
187178479Sjb	D_PRINTA_AGGARG,		/* aggregation arg type mismatch */
188178479Sjb	D_PRINTA_AGGBAD,		/* printa() aggregation not defined */
189178479Sjb	D_PRINTA_AGGKEY,		/* printa() aggregation key mismatch */
190178479Sjb	D_PRINTA_AGGPROTO,		/* printa() aggregation mismatch */
191178479Sjb	D_TRACE_VOID,			/* trace() argument has void type */
192178479Sjb	D_TRACE_DYN,			/* trace() argument has dynamic type */
193253726Spfg	D_TRACE_AGG,			/* trace() argument is an aggregation */
194248708Spfg	D_PRINT_VOID,			/* print() argument has void type */
195248708Spfg	D_PRINT_DYN,			/* print() argument has dynamic type */
196253726Spfg	D_PRINT_AGG,			/* print() argument is an aggregation */
197178479Sjb	D_TRACEMEM_ADDR,		/* tracemem() address bad type */
198178479Sjb	D_TRACEMEM_SIZE,		/* tracemem() size bad type */
199248690Spfg	D_TRACEMEM_ARGS,		/* tracemem() illegal number of args */
200248690Spfg	D_TRACEMEM_DYNSIZE,		/* tracemem() dynamic size bad type */
201178479Sjb	D_STACK_PROTO,			/* stack() prototype mismatch */
202178479Sjb	D_STACK_SIZE,			/* stack() size argument bad type */
203178479Sjb	D_USTACK_FRAMES,		/* ustack() frames arg bad type */
204178479Sjb	D_USTACK_STRSIZE,		/* ustack() strsize arg bad type */
205178479Sjb	D_USTACK_PROTO,			/* ustack() prototype mismatch */
206178479Sjb	D_LQUANT_BASETYPE,		/* lquantize() bad base type */
207178479Sjb	D_LQUANT_BASEVAL,		/* lquantize() bad base value */
208178479Sjb	D_LQUANT_LIMTYPE,		/* lquantize() bad limit type */
209178479Sjb	D_LQUANT_LIMVAL,		/* lquantize() bad limit value */
210178479Sjb	D_LQUANT_MISMATCH,		/* lquantize() limit < base */
211178479Sjb	D_LQUANT_STEPTYPE,		/* lquantize() bad step type */
212178479Sjb	D_LQUANT_STEPVAL,		/* lquantize() bad step value */
213178479Sjb	D_LQUANT_STEPLARGE,		/* lquantize() step too large */
214178479Sjb	D_LQUANT_STEPSMALL,		/* lquantize() step too small */
215178479Sjb	D_QUANT_PROTO,			/* quantize() prototype mismatch */
216178479Sjb	D_PROC_OFF,			/* byte offset exceeds function size */
217178479Sjb	D_PROC_ALIGN,			/* byte offset has invalid alignment */
218178479Sjb	D_PROC_NAME,			/* invalid process probe name */
219178479Sjb	D_PROC_GRAB,			/* failed to grab process */
220178479Sjb	D_PROC_DYN,			/* process is not dynamically linked */
221178479Sjb	D_PROC_LIB,			/* invalid process library name */
222178479Sjb	D_PROC_FUNC,			/* no such function in process */
223178479Sjb	D_PROC_CREATEFAIL,		/* pid probe creation failed */
224178479Sjb	D_PROC_NODEV,			/* fasttrap device is not installed */
225178479Sjb	D_PROC_BADPID,			/* user probe pid invalid */
226178479Sjb	D_PROC_BADPROV,			/* user probe provider invalid */
227178479Sjb	D_PROC_USDT,			/* problem initializing usdt */
228178479Sjb	D_CLEAR_PROTO,			/* clear() prototype mismatch */
229178479Sjb	D_CLEAR_AGGARG,			/* aggregation arg type mismatch */
230178479Sjb	D_CLEAR_AGGBAD,			/* clear() aggregation not defined */
231178479Sjb	D_NORMALIZE_PROTO,		/* normalize() prototype mismatch */
232178479Sjb	D_NORMALIZE_SCALAR,		/* normalize() value must be scalar */
233178479Sjb	D_NORMALIZE_AGGARG,		/* aggregation arg type mismatch */
234178479Sjb	D_NORMALIZE_AGGBAD,		/* normalize() aggregation not def. */
235178479Sjb	D_TRUNC_PROTO,			/* trunc() prototype mismatch */
236178479Sjb	D_TRUNC_SCALAR,			/* trunc() value must be scalar */
237178479Sjb	D_TRUNC_AGGARG,			/* aggregation arg type mismatch */
238178479Sjb	D_TRUNC_AGGBAD,			/* trunc() aggregation not def. */
239178479Sjb	D_PROV_BADNAME,			/* invalid provider name */
240178479Sjb	D_PROV_INCOMPAT,		/* provider/probe interface mismatch */
241178479Sjb	D_PROV_PRDUP,			/* duplicate probe declaration */
242178479Sjb	D_PROV_PRARGLEN,		/* probe argument list too long */
243178479Sjb	D_PROV_PRXLATOR,		/* probe argument translator missing */
244178479Sjb	D_FREOPEN_INVALID,		/* frename() filename is invalid */
245178479Sjb	D_LQUANT_MATCHBASE,		/* lquantize() mismatch on base */
246178479Sjb	D_LQUANT_MATCHLIM,		/* lquantize() mismatch on limit */
247178560Sjb	D_LQUANT_MATCHSTEP,		/* lquantize() mismatch on step */
248237624Spfg	D_LLQUANT_FACTORTYPE,		/* llquantize() bad magnitude type */
249237624Spfg	D_LLQUANT_FACTORVAL,		/* llquantize() bad magnitude value */
250237624Spfg	D_LLQUANT_FACTORMATCH,		/* llquantize() mismatch on magnitude */
251237624Spfg	D_LLQUANT_LOWTYPE,		/* llquantize() bad low mag type */
252237624Spfg	D_LLQUANT_LOWVAL,		/* llquantize() bad low mag value */
253237624Spfg	D_LLQUANT_LOWMATCH,		/* llquantize() mismatch on low mag */
254237624Spfg	D_LLQUANT_HIGHTYPE,		/* llquantize() bad high mag type */
255237624Spfg	D_LLQUANT_HIGHVAL,		/* llquantize() bad high mag value */
256237624Spfg	D_LLQUANT_HIGHMATCH,		/* llquantize() mismatch on high mag */
257237624Spfg	D_LLQUANT_NSTEPTYPE,		/* llquantize() bad # steps type */
258237624Spfg	D_LLQUANT_NSTEPVAL,		/* llquantize() bad # steps value */
259237624Spfg	D_LLQUANT_NSTEPMATCH,		/* llquantize() mismatch on # steps */
260237624Spfg	D_LLQUANT_MAGRANGE,		/* llquantize() bad magnitude range */
261237624Spfg	D_LLQUANT_FACTORNSTEPS,		/* llquantize() # steps < factor */
262237624Spfg	D_LLQUANT_FACTOREVEN,		/* llquantize() bad # steps/factor */
263237624Spfg	D_LLQUANT_FACTORSMALL,		/* llquantize() magnitude too small */
264237624Spfg	D_LLQUANT_MAGTOOBIG,		/* llquantize() high mag too large */
265250812Smarkj	D_NOREG,			/* no available internal registers */
266178560Sjb	D_PRINTM_ADDR,			/* printm() memref bad type */
267178560Sjb	D_PRINTM_SIZE,			/* printm() size bad type */
268178560Sjb	D_PRINTT_ADDR,			/* printt() typeref bad type */
269178560Sjb	D_PRINTT_SIZE			/* printt() size bad type */
270178479Sjb} dt_errtag_t;
271178479Sjb
272178479Sjbextern const char *dt_errtag(dt_errtag_t);
273178479Sjb
274178479Sjb#ifdef	__cplusplus
275178479Sjb}
276178479Sjb#endif
277178479Sjb
278178479Sjb#endif	/* _DT_ERRTAGS_H */
279