2012-11-10 21:13:09 +00:00
|
|
|
/*
|
2013-01-01 05:08:55 +00:00
|
|
|
* Copyright (C) 2012, 2013
|
2012-11-10 21:13:09 +00:00
|
|
|
* Wolfgang Bumiller
|
|
|
|
* Dale Weiler
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
|
|
* this software and associated documentation files (the "Software"), to deal in
|
|
|
|
* the Software without restriction, including without limitation the rights to
|
|
|
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
|
|
* of the Software, and to permit persons to whom the Software is furnished to do
|
|
|
|
* so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
|
|
* copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
|
|
|
*/
|
|
|
|
#ifndef GMQCC_DEFINE_FLAG
|
|
|
|
# define GMQCC_DEFINE_FLAG(x)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* codegen flags */
|
|
|
|
#ifdef GMQCC_TYPE_FLAGS
|
|
|
|
GMQCC_DEFINE_FLAG(DARKPLACES_STRING_TABLE_BUG)
|
|
|
|
GMQCC_DEFINE_FLAG(ADJUST_VECTOR_FIELDS)
|
2012-11-18 12:33:53 +00:00
|
|
|
GMQCC_DEFINE_FLAG(FTEPP)
|
2012-12-24 00:21:55 +00:00
|
|
|
GMQCC_DEFINE_FLAG(FTEPP_PREDEFS)
|
2012-11-19 21:27:58 +00:00
|
|
|
GMQCC_DEFINE_FLAG(RELAXED_SWITCH)
|
2012-11-21 15:08:08 +00:00
|
|
|
GMQCC_DEFINE_FLAG(SHORT_LOGIC)
|
2012-11-21 18:40:11 +00:00
|
|
|
GMQCC_DEFINE_FLAG(PERL_LOGIC)
|
2012-11-25 17:25:01 +00:00
|
|
|
GMQCC_DEFINE_FLAG(TRANSLATABLE_STRINGS)
|
2012-11-25 18:35:00 +00:00
|
|
|
GMQCC_DEFINE_FLAG(INITIALIZED_NONCONSTANTS)
|
2012-11-25 22:27:48 +00:00
|
|
|
GMQCC_DEFINE_FLAG(ASSIGN_FUNCTION_TYPES)
|
2012-11-30 17:19:26 +00:00
|
|
|
GMQCC_DEFINE_FLAG(LNO)
|
2012-12-01 12:42:16 +00:00
|
|
|
GMQCC_DEFINE_FLAG(CORRECT_TERNARY)
|
2012-12-19 21:15:38 +00:00
|
|
|
GMQCC_DEFINE_FLAG(SINGLE_VECTOR_DEFS)
|
2012-12-20 17:59:05 +00:00
|
|
|
GMQCC_DEFINE_FLAG(CORRECT_LOGIC)
|
|
|
|
GMQCC_DEFINE_FLAG(TRUE_EMPTY_STRINGS)
|
|
|
|
GMQCC_DEFINE_FLAG(FALSE_EMPTY_STRINGS)
|
2012-12-22 21:34:57 +00:00
|
|
|
GMQCC_DEFINE_FLAG(UTF8)
|
2012-12-27 11:46:36 +00:00
|
|
|
GMQCC_DEFINE_FLAG(BAIL_ON_WERROR)
|
2012-12-27 22:43:20 +00:00
|
|
|
GMQCC_DEFINE_FLAG(LOOP_LABELS)
|
2012-12-28 17:16:19 +00:00
|
|
|
GMQCC_DEFINE_FLAG(UNTYPED_NIL)
|
2012-12-28 17:22:09 +00:00
|
|
|
GMQCC_DEFINE_FLAG(PERMISSIVE)
|
2013-01-12 15:28:04 +00:00
|
|
|
GMQCC_DEFINE_FLAG(VARIADIC_ARGS)
|
2013-01-14 10:15:06 +00:00
|
|
|
GMQCC_DEFINE_FLAG(LEGACY_VECTOR_MATHS)
|
2012-11-10 21:13:09 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* warning flags */
|
|
|
|
#ifdef GMQCC_TYPE_WARNS
|
2013-01-09 19:39:17 +00:00
|
|
|
GMQCC_DEFINE_FLAG(UNINITIALIZED_GLOBAL)
|
2012-11-10 21:13:09 +00:00
|
|
|
GMQCC_DEFINE_FLAG(DEBUG)
|
|
|
|
GMQCC_DEFINE_FLAG(UNUSED_VARIABLE)
|
|
|
|
GMQCC_DEFINE_FLAG(USED_UNINITIALIZED)
|
|
|
|
GMQCC_DEFINE_FLAG(UNKNOWN_CONTROL_SEQUENCE)
|
|
|
|
GMQCC_DEFINE_FLAG(EXTENSIONS)
|
|
|
|
GMQCC_DEFINE_FLAG(FIELD_REDECLARED)
|
|
|
|
GMQCC_DEFINE_FLAG(MISSING_RETURN_VALUES)
|
2012-12-31 11:29:25 +00:00
|
|
|
GMQCC_DEFINE_FLAG(INVALID_PARAMETER_COUNT)
|
2012-11-10 21:13:09 +00:00
|
|
|
GMQCC_DEFINE_FLAG(LOCAL_SHADOWS)
|
|
|
|
GMQCC_DEFINE_FLAG(LOCAL_CONSTANTS)
|
|
|
|
GMQCC_DEFINE_FLAG(VOID_VARIABLES)
|
|
|
|
GMQCC_DEFINE_FLAG(IMPLICIT_FUNCTION_POINTER)
|
|
|
|
GMQCC_DEFINE_FLAG(VARIADIC_FUNCTION)
|
|
|
|
GMQCC_DEFINE_FLAG(FRAME_MACROS)
|
|
|
|
GMQCC_DEFINE_FLAG(EFFECTLESS_STATEMENT)
|
|
|
|
GMQCC_DEFINE_FLAG(END_SYS_FIELDS)
|
|
|
|
GMQCC_DEFINE_FLAG(ASSIGN_FUNCTION_TYPES)
|
2013-01-30 01:32:10 +00:00
|
|
|
GMQCC_DEFINE_FLAG(CPP)
|
2012-11-18 10:54:11 +00:00
|
|
|
GMQCC_DEFINE_FLAG(MULTIFILE_IF)
|
2012-11-23 21:22:22 +00:00
|
|
|
GMQCC_DEFINE_FLAG(DOUBLE_DECLARATION)
|
2012-11-25 14:56:13 +00:00
|
|
|
GMQCC_DEFINE_FLAG(CONST_VAR)
|
2012-11-25 21:11:21 +00:00
|
|
|
GMQCC_DEFINE_FLAG(MULTIBYTE_CHARACTER)
|
2012-12-01 11:35:46 +00:00
|
|
|
GMQCC_DEFINE_FLAG(TERNARY_PRECEDENCE)
|
2012-12-17 16:14:04 +00:00
|
|
|
GMQCC_DEFINE_FLAG(UNKNOWN_PRAGMAS)
|
2012-12-20 15:29:32 +00:00
|
|
|
GMQCC_DEFINE_FLAG(UNREACHABLE_CODE)
|
2012-12-22 17:16:41 +00:00
|
|
|
GMQCC_DEFINE_FLAG(UNKNOWN_ATTRIBUTE)
|
2012-12-28 17:22:09 +00:00
|
|
|
GMQCC_DEFINE_FLAG(RESERVED_NAMES)
|
2012-12-28 18:07:43 +00:00
|
|
|
GMQCC_DEFINE_FLAG(UNINITIALIZED_CONSTANT)
|
2012-12-29 16:36:27 +00:00
|
|
|
GMQCC_DEFINE_FLAG(DIFFERENT_QUALIFIERS)
|
|
|
|
GMQCC_DEFINE_FLAG(DIFFERENT_ATTRIBUTES)
|
2012-12-30 06:43:07 +00:00
|
|
|
GMQCC_DEFINE_FLAG(DEPRECATED)
|
2012-12-31 10:11:46 +00:00
|
|
|
GMQCC_DEFINE_FLAG(PARENTHESIS)
|
2012-11-10 21:13:09 +00:00
|
|
|
#endif
|
|
|
|
|
2012-11-30 10:05:58 +00:00
|
|
|
#ifdef GMQCC_TYPE_OPTIMIZATIONS
|
2012-12-24 00:21:55 +00:00
|
|
|
GMQCC_DEFINE_FLAG(PEEPHOLE, 1)
|
2013-01-08 20:23:38 +00:00
|
|
|
GMQCC_DEFINE_FLAG(LOCAL_TEMPS, 3)
|
2012-12-26 22:18:45 +00:00
|
|
|
GMQCC_DEFINE_FLAG(GLOBAL_TEMPS, 3)
|
2012-12-24 00:21:55 +00:00
|
|
|
GMQCC_DEFINE_FLAG(TAIL_RECURSION, 1)
|
|
|
|
GMQCC_DEFINE_FLAG(TAIL_CALLS, 2)
|
|
|
|
GMQCC_DEFINE_FLAG(OVERLAP_LOCALS, 3)
|
2012-12-23 21:58:46 +00:00
|
|
|
GMQCC_DEFINE_FLAG(STRIP_CONSTANT_NAMES, 1)
|
2012-12-25 19:38:05 +00:00
|
|
|
GMQCC_DEFINE_FLAG(OVERLAP_STRINGS, 2)
|
2013-01-25 15:25:59 +00:00
|
|
|
GMQCC_DEFINE_FLAG(CALL_STORES, 3)
|
2012-12-26 09:24:33 +00:00
|
|
|
GMQCC_DEFINE_FLAG(VOID_RETURN, 1)
|
2012-12-29 14:05:04 +00:00
|
|
|
GMQCC_DEFINE_FLAG(VECTOR_COMPONENTS, 1)
|
2012-11-30 10:05:58 +00:00
|
|
|
#endif
|
|
|
|
|
2012-11-10 21:13:09 +00:00
|
|
|
/* some cleanup so we don't have to */
|
|
|
|
#undef GMQCC_TYPE_FLAGS
|
|
|
|
#undef GMQCC_TYPE_WARNS
|
2013-01-13 16:37:09 +00:00
|
|
|
#undef GMQCC_TYPE_OPTIMIZATIONS
|
2012-11-10 21:13:09 +00:00
|
|
|
#undef GMQCC_DEFINE_FLAG
|