From 35d488e972a9dd75ce3867c000405f128b79c615 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Sun, 15 Jan 2023 12:14:05 +0000 Subject: reorganise things a bit to align further with the actual names/structure --- includes/compiler/CBrowse.h | 6 +- includes/compiler/CCompiler.h | 2 +- includes/compiler/CParser.h | 149 +++++++++++++++++++++--------------------- includes/compiler/CPrep.h | 6 +- includes/compiler/common.h | 44 ++++++------- includes/cw_common.h | 4 +- includes/plugin.h | 4 +- 7 files changed, 107 insertions(+), 108 deletions(-) (limited to 'includes') diff --git a/includes/compiler/CBrowse.h b/includes/compiler/CBrowse.h index cbca85d..388888d 100644 --- a/includes/compiler/CBrowse.h +++ b/includes/compiler/CBrowse.h @@ -7,9 +7,9 @@ extern Boolean gUseTokenStreamSource; extern Boolean gForceSourceLoc; extern Boolean gUseNameTable; -extern void CBrowse_Setup(CParams *params); -extern void CBrowse_Finish(CParams *params); -extern void CBrowse_Cleanup(CParams *params); +extern void CBrowse_Setup(CompilerLinkerParamBlk *params); +extern void CBrowse_Finish(CompilerLinkerParamBlk *params); +extern void CBrowse_Cleanup(CompilerLinkerParamBlk *params); extern void CBrowse_BeginClass(DeclInfo *di, GList *gl); extern void CBrowse_AddClassMemberVar(ObjMemberVar *ivar, SInt32 startOffset, SInt32 endOffset); extern void CBrowse_AddClassMemberFunction(Object *object, SInt32 startOffset, SInt32 endOffset); diff --git a/includes/compiler/CCompiler.h b/includes/compiler/CCompiler.h index 92b483c..daa1020 100644 --- a/includes/compiler/CCompiler.h +++ b/includes/compiler/CCompiler.h @@ -6,7 +6,7 @@ extern Boolean systemHandles; extern Boolean crippled; extern SInt32 license_cookie; -extern CParams cparams; +extern CompilerLinkerParamBlk cparams; extern CWPLUGIN_ENTRY(MWC_main)(CWPluginContext context); extern void PrintProgressFunction(const char *str); diff --git a/includes/compiler/CParser.h b/includes/compiler/CParser.h index 7312e33..65d046a 100644 --- a/includes/compiler/CParser.h +++ b/includes/compiler/CParser.h @@ -53,82 +53,81 @@ enum { }; -// not sure how many of these are char and how many are unsigned char or Boolean -typedef struct COpts { - Boolean little_endian; +typedef struct CompilerLinkerOptions { + Boolean littleendian; Boolean codegen_dynamic; Boolean codegen_pic; Boolean no_common; Boolean no_implicit_templates; Boolean absolutepath; // determines the path written to debug info char x06; // linker/objgen related - short cpu; - char schedule_cpu; - char schedule_mode; // may be an enum?? + short processor; + char scheduling; + char schedule_factor; SInt32 debuglisting; Boolean profile; Boolean traceback; Boolean disable_registers; Boolean fp_contract; Boolean no_register_save_helpers; - Boolean ppc_unroll_speculative; - short ppc_unroll_instructions_limit; - short ppc_unroll_factor_limit; + Boolean unroll_speculative; + short unroll_instr_limit; + short unroll_factor_limit; Boolean altivec_model; UInt8 altivec_vrsave; - UInt8 code_alignment; + UInt8 function_align; UInt8 x1D; - UInt8 x1E; // some register used in TOC_use_isel + UInt8 gen_isel; UInt8 gen_fsel; - Boolean ppc_opt_bclr_bcctr; + Boolean opt_bcc_lr_ctr; Boolean use_lmw_stmw; char report_heap_info; Boolean misaligned_mem_access; Boolean switch_tables; - char prepare_compress; - char some_alignment; // used in CMach_AllocationAlignment + Boolean prepare_compress; + char min_struct_alignment; // used in CMach_AllocationAlignment Boolean asmsemicolcomment; Boolean asmpoundcomment; StringPtr oldprefixname; short inlinelevel; - int inline_max_size; - int inline_max_total_size; + int inlinemaxsize; + int inlinemaxtotalsize; Boolean inline_bottom_up; Boolean cplusplus; Boolean ecplusplus; Boolean objective_c; Boolean objc_strict; - Boolean ARM_conform; - Boolean ARM_scoping; - Boolean require_prototypes; + Boolean ARMconform; + Boolean ARMscoping; + Boolean checkprotos; Boolean trigraphs; - Boolean only_std_keywords; + Boolean onlystdkeywords; Boolean enumsalwaysint; - Boolean ANSI_strict; + Boolean ANSIstrict; Boolean mpwc_relax; Boolean mpwc_newline; Boolean ignore_oldstyle; Boolean cpp_extensions; Boolean pointercast_lvalue; - Boolean useRTTI; + Boolean RTTI; Boolean delete_exception; - char _4B; + Boolean test_dummy; Boolean oldalignment; - Boolean unsignedchars; + Boolean unsigned_char; Boolean multibyteaware; - Boolean autoinline; + Boolean auto_inline; Boolean defer_codegen; Boolean direct_to_som; Boolean som_env_check; - Boolean som_call_opt; + Boolean som_call_optimize; Boolean booltruefalse; - char old_enum_mangler; + Boolean old_enum_mangler; Boolean longlong; Boolean longlong_enums; - char no_tfuncinline; - Boolean _59; + Boolean no_tfuncinline; + Boolean always_vdispatch; Boolean flat_include; - char syspath_once; + Boolean syspath_once; Boolean always_import; Boolean simple_class_byval; Boolean wchar_type; @@ -136,16 +135,16 @@ typedef struct COpts { Boolean vbase_abi_v2; Boolean def_inherited; Boolean template_patch; - char template_friends; + Boolean template_friends; Boolean faster_pch_gen; Boolean array_new_delete; Boolean dollar_identifiers; - char def_inline_tfuncs; + Boolean def_inline_tfuncs; Boolean arg_dep_lookup; Boolean simple_prepdump; Boolean line_prepdump; Boolean fullpath_prepdump; - char old_mtemplparser; + Boolean old_mtemplparser; Boolean suppress_init_code; Boolean reverse_bitfields; Boolean c9x; @@ -153,20 +152,20 @@ typedef struct COpts { Boolean no_static_dtors; Boolean longlong_prepeval; Boolean const_strings; - char dumpir; + Boolean dumpir; Boolean experimental; Boolean gcc_extensions; - char stdc_fp_contract; - char stdc_fenv_access; - char stdc_cx_limitedr; + Boolean stdc_fp_contract; + Boolean stdc_fenv_access; + Boolean stdc_cx_limitedr; Boolean old_argmatch; Boolean optEH; Boolean optEH2; Boolean new_mangler; - char microsoft; + Boolean microsoft_EH; Boolean warningerrors; Boolean pedantic; - Boolean check_header_flags; + Boolean checkprecompflags; Boolean supress_warnings; Boolean warn_illpragma; Boolean warn_emptydecl; @@ -183,51 +182,51 @@ typedef struct COpts { Boolean warn_no_side_effect; Boolean warn_resultnotused; Boolean warn_ptr_int_conv; - char align_mode; - Boolean align_array_members; + char structalignment; + Boolean alignarraymembers; Boolean dont_reuse_strings; - Boolean pool_strings; + Boolean poolstrings; Boolean explicit_zero_data; Boolean readonly_strings; Boolean exceptions; - char _99; - Boolean dont_inline; - Boolean always_inline; + Boolean dddummy; + Boolean dontinline; + Boolean alwaysinline; Boolean peephole; - Boolean global_optimizer; - char side_effects; - Boolean internal; - Boolean import; - Boolean export; - Boolean lib_export; + Boolean globaloptimizer; + Boolean sideeffects; + Boolean cfm_internal; + Boolean cfm_import; + Boolean cfm_export; + Boolean cfm_lib_export; Boolean nosyminline; - char force_active; + Boolean force_active; char optimizationlevel; - Boolean optimize_for_size; + Boolean optimizesize; Boolean optimizewithasm; Boolean crippled; - Boolean opt_common_subs; - Boolean opt_loop_invariants; - Boolean opt_propagation; - Boolean opt_dead_assignments; - Boolean opt_strength_reduction; - Boolean opt_strength_reduction_strict; - Boolean opt_dead_code; - Boolean opt_lifetimes; - char _B1; // unused? - Boolean opt_unroll_loops; - char opt_vectorize_loops; - Boolean _B4; // amount of IRO passes? + Boolean commonsubs; + Boolean loopinvariants; + Boolean propagation; + Boolean deadstore; + Boolean strengthreduction; + Boolean strengthreductionstrict; + Boolean deadcode; + Boolean lifetimes; + Boolean logopts; + Boolean unrolling; + Boolean vectorizeloops; + Boolean multiplepasses; Boolean opt_pointer_analysis; - unsigned char opt_pointer_analysis_mode; - char loop_unroll_count; - char loop_unroll_size_threshold; - Boolean isGeneratingDebugInfo; - CWDataType pchCreator; - CWDataType pchType; - CWDataType text; - HashNameNode *forcedSegment; // when set by #pragma segment -} COpts; + UInt8 opt_pointer_analysis_mode; + char unrollfactor; + char unrollinstrfactor; + Boolean filesyminfo; + CWDataType appltype; + CWDataType headtype; + CWDataType texttype; + HashNameNode *cursegmentname; // when set by #pragma segment +} CompilerLinkerOptions; typedef struct ParserTryBlock { struct ParserTryBlock *next; @@ -290,7 +289,7 @@ extern Object *Xthrw_func; extern Object *Xicth_func; extern Object *Xecth_func; extern Object *Xunex_func; -extern COpts copts; +extern CompilerLinkerOptions copts; extern struct GList name_mangle_list; extern HashNameNode *no_name_node; extern HashNameNode *temp_argument_name; diff --git a/includes/compiler/CPrep.h b/includes/compiler/CPrep.h index 02d5a76..5fc972c 100644 --- a/includes/compiler/CPrep.h +++ b/includes/compiler/CPrep.h @@ -25,7 +25,7 @@ typedef struct TokenStack { } TokenStack; //#define OPT_OFFSET(optname) ((short) (((char *) (&copts.optname)) - ((char *) &copts))) -#define OPT_OFFSET(optname) ((UInt16) ( &((COpts *)0)->optname )) +#define OPT_OFFSET(optname) ((UInt16) ( &((CompilerLinkerOptions *)0)->optname )) enum { OPT_OFFSET_MASK = 0x1FFF, OPT_FLAG_2000 = 0x2000, @@ -33,7 +33,7 @@ enum { OPT_FLAG_8000 = 0x8000 }; -extern CParams *cparamblkptr; +extern CompilerLinkerParamBlk *cparamblkptr; extern short tk; extern CInt64 tkintconst; extern Float tkfloatconst; @@ -112,7 +112,7 @@ extern SInt32 CPrep_GetFileOffsetInfo(FileOffsetInfo *foi); extern void CPrep_GetFileOffsetInfo2(FileOffsetInfo *foi, SInt32 *pLine, HashNameNode **pName); extern void CPrep_ResetFileInfo(FileOffsetInfo *foi); extern void CPrep_GetPrepPos(CPrepFileInfo **file, SInt32 *ppos); -extern UInt8 C_Compiler(CParams *param); +extern UInt8 C_Compiler(CompilerLinkerParamBlk *param); extern void poptokenseq(void); extern void foundnl(void); extern void newline(void); diff --git a/includes/compiler/common.h b/includes/compiler/common.h index 0b8aaa7..156e5c4 100644 --- a/includes/compiler/common.h +++ b/includes/compiler/common.h @@ -112,7 +112,7 @@ typedef struct BClassList BClassList; typedef struct CI_FuncData CI_FuncData; typedef struct CLabel CLabel; typedef struct ClassList ClassList; -typedef struct CParams CParams; +typedef struct CompilerLinkerParamBlk CompilerLinkerParamBlk; typedef struct CPrepFileInfo CPrepFileInfo; typedef struct CScopeSave CScopeSave; typedef struct DeclE DeclE; @@ -296,30 +296,30 @@ typedef enum RegClass { #ifdef __MWERKS__ #pragma options align=mac68k #endif -struct CParams { +struct CompilerLinkerParamBlk { CWPluginContext context; - CWObjectData objectdata; - Handle objectDataHandle; - Handle browseDataHandle; - SInt32 pluginRequest; - SInt32 apiVersion; - FSSpec projectFile; - SInt32 projectFileCount; - SInt32 mainFileNumber; - FSSpec mainFileSpec; - const char *mainFileText; - SInt32 mainFileTextLength; - Boolean isPrecompiling; - Boolean isAutoPrecompiling; - Boolean isPreprocessing; - Boolean isGeneratingDebugInfo; - Boolean isCachingPrecompiledHeaders; - CWBrowseOptions browseOptions; - Boolean field276; - SInt16 mainFileID; + CWObjectData object; + Handle objectdata; + Handle browsedata; + SInt32 request; + SInt32 version; + FSSpec targetfile; + SInt32 numfiles; + SInt32 whichfile; + FSSpec sourcefile; + const char *sourcetext; + SInt32 sourcetextsize; + Boolean precompile; + Boolean autoprecompile; + Boolean preprocess; + Boolean SYMinfo; + Boolean caching_includes; + CWBrowseOptions browseoptions; + Boolean recordbrowseinfo; + SInt16 browserfileID; CWDataType targetOS; CWDataType targetCPU; - char *targetName; + char *idetargetname; }; #define FITS_IN_SHORT(value) ( (value) == ((short) (value)) ) diff --git a/includes/cw_common.h b/includes/cw_common.h index eb016f1..0be94bb 100644 --- a/includes/cw_common.h +++ b/includes/cw_common.h @@ -32,8 +32,8 @@ typedef struct BasePluginCallbacks { typedef struct CompilerLinkerPluginCallbacks { CWPLUGIN_ENTRY (*GetTargetList)(const struct CWTargetList **targetList); CWPLUGIN_ENTRY (*GetDefaultMappingList)(const CWExtMapList **mappings); - CWPLUGIN_ENTRY (*Unmangle)(); - CWPLUGIN_ENTRY (*BrSymbolEntryPoint)(); + CWPLUGIN_ENTRY (*Unmangle)(CWUnmangleInfo *unmangleInfo); + CWPLUGIN_ENTRY (*BrSymbolEntryPoint)(CWCompilerBrSymbolInfo *symbolInfo); CWPLUGIN_ENTRY (*GetObjectFlags)(const CWObjectFlags **objectFlags); CWPLUGIN_ENTRY (*WriteObjectFile)(const FSSpec *srcfss, const FSSpec *outfss, OSType creator, OSType type, Handle data); } CompilerLinkerPluginCallbacks; diff --git a/includes/plugin.h b/includes/plugin.h index 3341c82..6fad976 100644 --- a/includes/plugin.h +++ b/includes/plugin.h @@ -203,7 +203,7 @@ struct CWParserCallbacks { #ifdef __cplusplus extern "C" { #endif -CW_CALLBACK CWCheckoutLicense(CWPluginContext context, const char *a, const char *b, SInt32 c, void *d, SInt32 *cookiePtr); +CW_CALLBACK CWCheckoutLicense(CWPluginContext context, const char *featureName, const char *licenseVersion, SInt32 flags, void *reserved, SInt32 *cookie); CW_CALLBACK CWCheckinLicense(CWPluginContext context, SInt32 cookie); CW_CALLBACK CWOSErrorMessage(CWPluginContext context, const char *msg, OSErr errorcode); @@ -214,7 +214,7 @@ CW_CALLBACK CWSecretDetachHandle(CWPluginContext context, CWMemHandle memHandle, CW_CALLBACK CWSecretPeekHandle(CWPluginContext context, CWMemHandle memHandle, Handle *handle); CW_CALLBACK CWSecretGetNamedPreferences(CWPluginContext context, const char *prefsname, Handle *prefsdata); -CW_CALLBACK CWParserGetBuildDate(CWPluginContext context, const char **buildDate, const char **buildTime); +CW_CALLBACK CWParserGetBuildDate(CWPluginContext context, const char **bdate, const char **btime); CW_CALLBACK CWParserGetCommandLine(CWPluginContext context, CWCommandLineArgs **args); CW_CALLBACK CWParserGetTargetInfo(CWPluginContext context, CWDataType *cpu, CWDataType *os); CW_CALLBACK CWParserGetToolInfo(CWPluginContext context, const ToolVersionInfo **toolVersionInfo); -- cgit v1.2.3