summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-01-11 22:29:53 +0000
committerAsh Wolf <ninji@wuffs.org>2023-01-11 22:29:53 +0000
commit0bec4f557a96e1a40437cf5af20cc78a5eec8a63 (patch)
treec1e05ec804c43aa5a8f5f21b0ed02d0587d29563 /includes
parentaec1b8dddc68ecb8288ec6132932e4c7b4bca09f (diff)
downloadMWCC-0bec4f557a96e1a40437cf5af20cc78a5eec8a63.tar.gz
MWCC-0bec4f557a96e1a40437cf5af20cc78a5eec8a63.zip
getting closer
Diffstat (limited to 'includes')
-rw-r--r--includes/cmdline.h62
-rw-r--r--includes/compiler/CError.h307
-rw-r--r--includes/compiler/CInline.h4
-rw-r--r--includes/compiler/CInt64.h2
-rw-r--r--includes/compiler/CMachine.h2
-rw-r--r--includes/compiler/CObjC.h2
-rw-r--r--includes/compiler/CPrec.h4
-rw-r--r--includes/compiler/CPrep.h14
-rw-r--r--includes/compiler/CScope.h2
-rw-r--r--includes/compiler/CTemplateClass.h2
-rw-r--r--includes/compiler/CompilerTools.h30
-rw-r--r--includes/compiler/ObjGenMachO.h4
-rw-r--r--includes/compiler/Operands.h6
-rw-r--r--includes/compiler/PCode.h62
-rw-r--r--includes/compiler/PCodeInfo.h865
-rw-r--r--includes/compiler/PCodeListing.h38
-rw-r--r--includes/compiler/common.h2
-rw-r--r--includes/compiler/objects.h2
-rw-r--r--includes/compiler/templates.h6
-rw-r--r--includes/compiler/tokens.h18
-rw-r--r--includes/compiler/types.h34
-rw-r--r--includes/cos.h6
-rw-r--r--includes/macemul.h32
-rw-r--r--includes/mwcc_decomp.h26
-rw-r--r--includes/option_system.h36
-rw-r--r--includes/oslib.h4
-rw-r--r--includes/parser.h20
-rw-r--r--includes/pref_structs.h21
28 files changed, 525 insertions, 1088 deletions
diff --git a/includes/cmdline.h b/includes/cmdline.h
index 2c40cb1..6c39423 100644
--- a/includes/cmdline.h
+++ b/includes/cmdline.h
@@ -461,7 +461,7 @@ extern void SetBuildTarget(OSType cpu, OSType os);
extern void SetParserType(OSType plang);
extern void SetPluginType(OSType lang, OSType type);
extern int CmdLine_Initialize(int argc, char **argv, const char *builddate, const char *buildtime);
-extern int CmdLine_Driver();
+extern int CmdLine_Driver(void);
extern int CmdLine_Terminate(int exitcode);
/********************************/
@@ -476,20 +476,20 @@ extern void CLFatalError(const char *format, ...);
/********************************/
/* Envir/CLIO.c */
-extern void SetupDebuggingTraps();
-extern Boolean IO_Initialize();
-extern Boolean IO_Terminate();
-extern Boolean IO_HelpInitialize();
-extern Boolean IO_HelpTerminate();
+extern void SetupDebuggingTraps(void);
+extern Boolean IO_Initialize(void);
+extern Boolean IO_Terminate(void);
+extern Boolean IO_HelpInitialize(void);
+extern Boolean IO_HelpTerminate(void);
extern void FixHandleForIDE(Handle text, UInt32 size);
extern Boolean ShowHandle(Handle text, UInt32 size, Boolean decorate);
extern Boolean WriteHandleToFile(OSSpec *spec, Handle text, UInt32 size, OSType creator, OSType type);
extern Boolean WriteBinaryHandleToFile(OSSpec *spec, OSType maccreator, OSType mactype, OSHandle *text);
extern Boolean AppendHandleToFile(OSSpec *spec, Handle text, UInt32 size, OSType maccreator, OSType mactype);
-extern void InitWorking();
+extern void InitWorking(void);
extern void ShowWorking(int x);
-extern void TermWorking();
-extern Boolean CheckForUserBreak();
+extern void TermWorking(void);
+extern Boolean CheckForUserBreak(void);
extern char *IO_FormatText(char *buffer, SInt32 size, char *newline, const char *format, ...);
extern void CLPrintDispatch(int unk, SInt16 msgtype, const char *message);
extern void CLPrintType(SInt16 msgtype, const char *format, ...);
@@ -500,7 +500,7 @@ extern SInt16 CLStyledMessageDispatch(Plugin *plugin, MessageRef *ref, SInt32 er
/********************************/
/* Plugins/CLPlugins.c */
-extern const ToolVersionInfo *Plugin_GetToolVersionInfo();
+extern const ToolVersionInfo *Plugin_GetToolVersionInfo(void);
extern const char *Plugin_GetDropInName(Plugin *pl);
extern const VersionInfo *Plugin_GetVersionInfo(Plugin *pl);
extern char *Plugin_GetVersionInfoASCII(Plugin *pl);
@@ -523,8 +523,8 @@ extern Boolean Plugin_CL_GetCompilerMapping(Plugin *pl, OSType type, const char
extern Plugin *Plugin_New(const BasePluginCallbacks *cb, const CompilerLinkerPluginCallbacks *cl_cb, const ParserPluginCallbacks *pr_cb);
extern void Plugin_Free(Plugin *pl);
extern Boolean Plugin_VerifyPanels(Plugin *pl);
-extern void Plugins_Init();
-extern void Plugins_Term();
+extern void Plugins_Init(void);
+extern void Plugins_Term(void);
extern int Plugins_Add(Plugin *pl);
extern Plugin *Plugins_MatchName(Plugin *list, const char *name);
extern Plugin *Plugins_CL_MatchTarget(Plugin *list, OSType cpu, OSType os, OSType type, OSType lang);
@@ -562,8 +562,8 @@ extern void Paths_CopyRecurseFSS(FSSpec *list, Paths *paths, UInt16 count);
extern Boolean MakeFrameworkPath(char *out, const char *filename, Path *globalpath);
extern void Frameworks_AddPath(const OSPathSpec *oss);
extern int Frameworks_AddFramework(const char *name, const char *version, Boolean hidden);
-extern void Framework_GetEnvInfo();
-extern int Frameworks_GetCount();
+extern void Framework_GetEnvInfo(void);
+extern int Frameworks_GetCount(void);
extern Paths_FWInfo *Frameworks_GetInfo(int which);
// Not sure if this is the right TU for this
@@ -571,7 +571,7 @@ extern Paths FrameworkPaths;
/********************************/
/* Project/CLFiles.c */
-extern File *File_New();
+extern File *File_New(void);
extern void File_Free(File *file);
extern Boolean Files_Initialize(Files *);
extern Boolean Files_Terminate(Files *);
@@ -643,7 +643,7 @@ extern Boolean Incls_FindFileInPaths(Incls *incls, char *filename, Boolean fulls
extern Boolean Deps_Initialize(Deps *deps, Incls *incls);
extern void Deps_Terminate(Deps *deps);
extern int Deps_ChangeSpecialAccessPath(OSSpec *srcfss, Boolean initialize);
-extern Path *Deps_GetSpecialAccessPath();
+extern Path *Deps_GetSpecialAccessPath(void);
extern void Deps_AddDependency(Deps *deps, SInt32 incl, OSSpec *spec, Boolean unk, SInt16 dependencyType, Boolean *alreadyincluded);
extern void Deps_ListDependencies(Incls *incls, File *file, OSHandle *h);
@@ -651,25 +651,25 @@ extern void Deps_ListDependencies(Incls *incls, File *file, OSHandle *h);
/* CLFileOps.c */
extern int GetOutputFile(File *file, SInt16 stage);
extern int StoreObjectFile(File *file);
-extern int CompileFilesInProject();
-extern int LinkProject();
+extern int CompileFilesInProject(void);
+extern int LinkProject(void);
/********************************/
/* CLIncludeFileCache.c */
-extern void InitializeIncludeCache();
-extern void CleanupIncludeCache();
+extern void InitializeIncludeCache(void);
+extern void CleanupIncludeCache(void);
extern void CacheIncludeFile(OSSpec *spec, Handle text, Boolean precompiled);
extern Handle CachedIncludeFile(OSSpec *spec, Boolean *precompiled);
extern void FreeIncludeFile(Handle text);
/********************************/
/* CLLicenses.c */
-extern void License_Initialize();
-extern void License_Terminate();
-extern SInt32 License_Checkout();
-extern void License_Refresh();
-extern void License_Checkin();
-extern void License_AutoCheckin();
+extern void License_Initialize(void);
+extern void License_Terminate(void);
+extern SInt32 License_Checkout(/* unknown args */);
+extern void License_Refresh(/* unknown args */);
+extern void License_Checkin(/* unknown args */);
+extern void License_AutoCheckin(void);
/********************************/
/* CLLoadAndCache.c */
@@ -683,7 +683,7 @@ extern void Main_PreParse(int *argc, char ***argv);
extern void Main_PassSpecialArgs(int *argc, char ***argv);
extern int Main_Initialize(int argc, char **argv);
extern int Main_Terminate(int code);
-extern int Main_Driver();
+extern int Main_Driver(void);
/********************************/
/* CLPluginRequests.cpp */
@@ -714,8 +714,8 @@ extern Boolean SendInitOrTermRequest(Plugin *plugin, Boolean reqIsInitialize);
extern PrefPanel *PrefPanel_New(const char *name, void *initdata, SInt32 initdatasize);
extern Handle PrefPanel_GetHandle(PrefPanel *panel);
extern int PrefPanel_PutHandle(PrefPanel *panel, Handle data);
-extern void Prefs_Initialize();
-extern void Prefs_Terminate();
+extern void Prefs_Initialize(void);
+extern void Prefs_Terminate(void);
extern Boolean Prefs_AddPanel(PrefPanel *panel);
extern PrefPanel *Prefs_FindPanel(const char *name);
@@ -729,8 +729,8 @@ extern void Target_Add(Target **list, Target *targ);
/********************************/
/* CLToolExec.c */
extern void AppendArgumentList(int *argc, char ***argv, const char *str);
-extern int SetupTemporaries();
-extern int DeleteTemporaries();
+extern int SetupTemporaries(void);
+extern int DeleteTemporaries(void);
extern int ExecuteLinker(Plugin *plugin, SInt32 dropinflags, File *file, char *stdoutfile, char *stderrfile);
/********************************/
diff --git a/includes/compiler/CError.h b/includes/compiler/CError.h
index a0f1217..754bdef 100644
--- a/includes/compiler/CError.h
+++ b/includes/compiler/CError.h
@@ -8,298 +8,591 @@
#define CError_FATAL(line) do { CError_Internal(__FILE__, line); } while (0)
enum {
+ // "illegal character constant"
CErrorStr100 = 100,
+ // "illegal string constant"
CErrorStr101 = 101,
+ // "unexpected end of file"
CErrorStr102 = 102,
+ // "unterminated comment"
CErrorStr103 = 103,
+ // "undefined preprocessor directive"
CErrorStr104 = 104,
+ // "illegal token"
CErrorStr105 = 105,
+ // "string too long"
CErrorStr106 = 106,
+ // "identifier expected"
CErrorStr107 = 107,
+ // "macro '%u' redefined"
CErrorStr108 = 108,
+ // "illegal argument list"
CErrorStr109 = 109,
+ // "too many macro arguments"
CErrorStr110 = 110,
+ // "macro(s) too complex"
CErrorStr111 = 111,
+ // "unexpected end of line"
CErrorStr112 = 112,
+ // "end of line expected"
CErrorStr113 = 113,
+ // "'(' expected"
CErrorStr114 = 114,
+ // "')' expected"
CErrorStr115 = 115,
+ // "',' expected"
CErrorStr116 = 116,
+ // "preprocessor syntax error"
CErrorStr117 = 117,
+ // "preceding #if is missing"
CErrorStr118 = 118,
+ // "unterminated #if / macro"
CErrorStr119 = 119,
+ // "unexpected token"
CErrorStr120 = 120,
+ // "declaration syntax error"
CErrorStr121 = 121,
+ // "identifier '%u' redeclared"
CErrorStr122 = 122,
+ // "';' expected"
CErrorStr123 = 123,
+ // "illegal constant expression"
CErrorStr124 = 124,
+ // "']' expected"
CErrorStr125 = 125,
+ // "illegal use of 'void'"
CErrorStr126 = 126,
+ // "illegal function definition"
CErrorStr127 = 127,
+ // "illegal function return type"
CErrorStr128 = 128,
+ // "illegal array definition"
CErrorStr129 = 129,
+ // "'}' expected"
CErrorStr130 = 130,
+ // "illegal struct/union/enum/class definition"
CErrorStr131 = 131,
+ // "struct/union/enum/class tag '%u' redefined"
CErrorStr132 = 132,
+ // "struct/union/class member '%u' redefined"
CErrorStr133 = 133,
+ // "declarator expected"
CErrorStr134 = 134,
+ // "'{' expected"
CErrorStr135 = 135,
+ // "illegal use of incomplete struct/union/class '%t'"
CErrorStr136 = 136,
+ // "struct/union/class size exceeds 32K"
CErrorStr137 = 137,
+ // "illegal bitfield declaration"
CErrorStr138 = 138,
+ // "division by 0"
CErrorStr139 = 139,
+ // "undefined identifier '%u'"
CErrorStr140 = 140,
+ // "expression syntax error"
CErrorStr141 = 141,
+ // "not an lvalue"
CErrorStr142 = 142,
+ // "illegal operation"
CErrorStr143 = 143,
+ // "illegal operand"
CErrorStr144 = 144,
+ // "data type is incomplete"
CErrorStr145 = 145,
+ // "illegal type"
CErrorStr146 = 146,
+ // "too many initializers"
CErrorStr147 = 147,
+ // "pointer/array required"
CErrorStr148 = 148,
+ // "not a struct/union/class"
CErrorStr149 = 149,
+ // "'%u' is not a struct/union/class member"
CErrorStr150 = 150,
+ // "the file '%u' cannot be opened"
CErrorStr151 = 151,
+ // "illegal instruction for this processor"
CErrorStr152 = 152,
+ // "illegal operands for this processor"
CErrorStr153 = 153,
+ // "number is out of range"
CErrorStr154 = 154,
+ // "illegal addressing mode"
CErrorStr155 = 155,
+ // "illegal data size"
CErrorStr156 = 156,
+ // "illegal register list"
CErrorStr157 = 157,
+ // "branch out of range"
CErrorStr158 = 158,
+ // "undefined label '%u'"
CErrorStr159 = 159,
+ // "reference to label '%u' is out of range"
CErrorStr160 = 160,
+ // "call of non-function"
CErrorStr161 = 161,
+ // "function call does not match prototype"
CErrorStr162 = 162,
+ // "illegal use of register variable"
CErrorStr163 = 163,
+ // "illegal type cast"
CErrorStr164 = 164,
+ // "function already has a stackframe"
CErrorStr165 = 165,
+ // "function has no initialized stackframe"
CErrorStr166 = 166,
+ // "value is not stored in register"
CErrorStr167 = 167,
+ // "function nesting too complex"
CErrorStr168 = 168,
+ // "illegal use of keyword"
CErrorStr169 = 169,
+ // "':' expected"
CErrorStr170 = 170,
+ // "label '%u' redefined"
CErrorStr171 = 171,
+ // "case constant defined more than once"
CErrorStr172 = 172,
+ // "default label defined more than once"
CErrorStr173 = 173,
+ // "illegal initialization"
CErrorStr174 = 174,
+ // "illegal use of inline function"
CErrorStr175 = 175,
+ // "illegal type qualifier(s)"
CErrorStr176 = 176,
+ // "illegal storage class"
CErrorStr177 = 177,
+ // "function has no prototype"
CErrorStr178 = 178,
+ // "illegal assignment to constant"
CErrorStr179 = 179,
+ // "illegal use of precompiled header"
CErrorStr180 = 180,
+ // "illegal data in precompiled header"
CErrorStr181 = 181,
+ // "variable / argument '%u' is not used in function"
CErrorStr182 = 182,
+ // "illegal use of direct parameters"
CErrorStr183 = 183,
+ // "return value expected"
CErrorStr184 = 184,
+ // "variable '%u' is not initialized before being used"
CErrorStr185 = 185,
+ // "illegal #pragma"
CErrorStr186 = 186,
+ // "illegal access to protected/private member"
CErrorStr187 = 187,
+ // "ambiguous access to class/struct/union member"
CErrorStr188 = 188,
+ // "illegal use of 'this'"
CErrorStr189 = 189,
+ // "unimplemented C++ feature"
CErrorStr190 = 190,
+ // "illegal use of 'HandleObject'"
CErrorStr191 = 191,
+ // "illegal access qualifier"
CErrorStr192 = 192,
+ // "illegal 'operator' declaration"
CErrorStr193 = 193,
+ // "illegal use of abstract class ('%o')"
CErrorStr194 = 194,
+ // "illegal use of pure function"
CErrorStr195 = 195,
+ // "illegal '&' reference"
CErrorStr196 = 196,
+ // "illegal function overloading"
CErrorStr197 = 197,
+ // "illegal operator overloading"
CErrorStr198 = 198,
+ // "ambiguous access to overloaded function "
CErrorStr199 = 199,
+ // "illegal access/using declaration"
CErrorStr200 = 200,
+ // "illegal 'friend' declaration"
CErrorStr201 = 201,
+ // "illegal 'inline' function definition"
CErrorStr202 = 202,
+ // "class has no default constructor"
CErrorStr203 = 203,
+ // "illegal operator"
CErrorStr204 = 204,
+ // "illegal default argument(s)"
CErrorStr205 = 205,
+ // "possible unwanted ';'"
CErrorStr206 = 206,
+ // "possible unwanted assignment"
CErrorStr207 = 207,
+ // "possible unwanted compare"
CErrorStr208 = 208,
+ // "illegal implicit conversion from '%t' to\n'%t'"
CErrorStr209 = 209,
+ // "local data >32k"
CErrorStr210 = 210,
+ // "illegal jump past initializer"
CErrorStr211 = 211,
+ // "illegal ctor initializer"
CErrorStr212 = 212,
+ // "cannot construct %t's base class '%t'"
CErrorStr213 = 213,
+ // "cannot construct %t's direct member '%u'"
CErrorStr214 = 214,
+ // "#if nesting overflow"
CErrorStr215 = 215,
+ // "illegal empty declaration"
CErrorStr216 = 216,
+ // "illegal implicit enum conversion from '%t' to\n'%t'"
CErrorStr217 = 217,
+ // "illegal use of #pragma parameter"
CErrorStr218 = 218,
+ // "virtual functions cannot be pascal functions"
CErrorStr219 = 219,
+ // "illegal implicit const/volatile pointer conversion from '%t' to\n'%t'"
CErrorStr220 = 220,
+ // "illegal use of non-static member"
CErrorStr221 = 221,
+ // "illegal precompiled header version"
CErrorStr222 = 222,
+ // "illegal precompiled header compiler flags or target"
CErrorStr223 = 223,
+ // "'const' or '&' variable needs initializer"
CErrorStr224 = 224,
+ // "'%o' hides inherited virtual function '%o'"
CErrorStr225 = 225,
+ // "pascal function cannot be overloaded"
CErrorStr226 = 226,
+ // "derived function differs from virtual base function in return type only"
CErrorStr227 = 227,
+ // "non-const '&' reference initialized to temporary"
CErrorStr228 = 228,
+ // "illegal template declaration"
CErrorStr229 = 229,
+ // "'<' expected"
CErrorStr230 = 230,
+ // "'>' expected"
CErrorStr231 = 231,
+ // "illegal template argument(s)"
CErrorStr232 = 232,
+ // "cannot instantiate '%o'"
CErrorStr233 = 233,
+ // "template redefined"
CErrorStr234 = 234,
+ // "template parameter mismatch"
CErrorStr235 = 235,
+ // "cannot pass const/volatile data object to non-const/volatile member function"
CErrorStr236 = 236,
+ // "preceding '#pragma push' is missing"
CErrorStr237 = 237,
+ // "illegal explicit template instantiation"
CErrorStr238 = 238,
+ // "illegal X::X(X) copy constructor"
CErrorStr239 = 239,
+ // "function defined 'inline' after being called"
CErrorStr240 = 240,
+ // "illegal constructor/destructor declaration"
CErrorStr241 = 241,
+ // "'catch' expected"
CErrorStr242 = 242,
+ // "#include nesting overflow"
CErrorStr243 = 243,
+ // "cannot convert\n'%t' to\n'%t'"
CErrorStr244 = 244,
+ // "type mismatch\n'%t' and\n'%t'"
CErrorStr245 = 245,
+ // "class type expected"
CErrorStr246 = 246,
+ // "illegal explicit conversion from '%t' to\n'%t'"
CErrorStr247 = 247,
+ // "function call '*' does not match"
CErrorStr248 = 248,
+ // "identifier '%u' redeclared\nwas declared as: '%t'\nnow declared as: '%t'"
CErrorStr249 = 249,
+ // "cannot throw class with ambiguous base class ('%u')"
CErrorStr250 = 250,
+ // "class '%t': '%o' has more than one final overrider:\n'%o'\nand '%o'"
CErrorStr251 = 251,
+ // "exception handling option is disabled"
CErrorStr252 = 252,
+ // "cannot delete pointer to const"
CErrorStr253 = 253,
+ // "cannot destroy const object"
CErrorStr254 = 254,
+ // "const member '%u' is not initialized"
CErrorStr255 = 255,
+ // "'&' reference member '%u' is not initialized"
CErrorStr256 = 256,
+ // "RTTI option is disabled"
CErrorStr257 = 257,
+ // "constness casted away"
CErrorStr258 = 258,
+ // "illegal const/volatile '&' reference initialization"
CErrorStr259 = 259,
+ // "inconsistent linkage: 'extern' object redeclared as 'static'"
CErrorStr260 = 260,
+ // "unknown assembler instruction mnemonic"
CErrorStr261 = 261,
+ // "local data > 224 bytes"
CErrorStr262 = 262,
+ // "'%u' could not be assigned to a register"
CErrorStr263 = 263,
+ // "illegal exception specification"
CErrorStr264 = 264,
+ // "exception specification list mismatch"
CErrorStr265 = 265,
+ // "the parameter(s) of the '%n' function must be immediate value(s)"
CErrorStr266 = 266,
+ // "SOM classes can only inherit from other SOM based classes"
CErrorStr267 = 267,
+ // "SOM classes inhertiance must be virtual"
CErrorStr268 = 268,
+ // "SOM class data members must be private"
CErrorStr269 = 269,
+ // "illegal SOM function overload '%o'"
CErrorStr270 = 270,
+ // "no static members allowed in SOM classes"
CErrorStr271 = 271,
+ // "no parameters allowed in SOM class constructors"
CErrorStr272 = 272,
+ // "illegal SOM function parameters or return type"
CErrorStr273 = 273,
+ // "SOM runtime function '%u' not defined (should be defined in somobj.hh)"
CErrorStr274 = 274,
+ // "SOM runtime function '%u' has unexpected type"
CErrorStr275 = 275,
+ // "'%u' is not a SOM class"
CErrorStr276 = 276,
+ // "illegal use of #pragma outside of SOM class definition"
CErrorStr277 = 277,
+ // "introduced method '%o' is not specified in release order list"
CErrorStr278 = 278,
+ // "SOM class access qualification only allowed to direct parent or own class"
CErrorStr279 = 279,
+ // "SOM class must have one non-inline member function"
CErrorStr280 = 280,
+ // "SOM type '%u' undefined"
CErrorStr281 = 281,
+ // "new SOM callstyle method '%o' must have explicit 'Environment *' parameter"
CErrorStr282 = 282,
+ // "functions cannot return SOM classes"
CErrorStr283 = 283,
+ // "functions cannot have SOM class arguments"
CErrorStr284 = 284,
+ // "assignment is not supported for SOM classes"
CErrorStr285 = 285,
+ // "sizeof() is not supported for SOM classes"
CErrorStr286 = 286,
+ // "SOM classes cannot be class members"
CErrorStr287 = 287,
+ // "global SOM class objects are not supported"
CErrorStr288 = 288,
+ // "SOM class arrays are not supported"
CErrorStr289 = 289,
+ // "'pointer to member' is not supported for SOM classes"
CErrorStr290 = 290,
+ // "SOM class has no release order list"
CErrorStr291 = 291,
+ // "'%u' is not an Objective-C class"
CErrorStr292 = 292,
+ // "method '%m' redeclared"
CErrorStr293 = 293,
+ // "undefined method '%m'"
CErrorStr294 = 294,
+ // "class '%u' redeclared"
CErrorStr295 = 295,
+ // "class '%u' redefined"
CErrorStr296 = 296,
+ // "Objective-C type '%u' is undefined (should be defined in objc.h)"
CErrorStr297 = 297,
+ // "Objective-C type '%u' has unexpected type"
CErrorStr298 = 298,
+ // "method '%m' not defined"
CErrorStr299 = 299,
+ // "method '%m' redefined"
CErrorStr300 = 300,
+ // "illegal use of 'self'"
CErrorStr301 = 301,
+ // "illegal use of 'super'"
CErrorStr302 = 302,
+ // "illegal message receiver"
CErrorStr303 = 303,
+ // "receiver cannot handle this message"
CErrorStr304 = 304,
+ // "ambiguous message selector\nused: '%m'\nalso had: '%m'"
CErrorStr305 = 305,
+ // "unknown message selector"
CErrorStr306 = 306,
+ // "illegal use of Objective-C object"
CErrorStr307 = 307,
+ // "protocol '%u' redefined"
CErrorStr308 = 308,
+ // "protocol '%u' is undefined"
CErrorStr309 = 309,
+ // "protocol '%u' is already in protocol list"
CErrorStr310 = 310,
+ // "category '%u' redefined"
CErrorStr311 = 311,
+ // "category '%u' is undefined"
CErrorStr312 = 312,
+ // "illegal use of '%u'"
CErrorStr313 = 313,
+ // "template too complex or recursive"
CErrorStr314 = 314,
+ // "illegal return value in void/constructor/destructor function"
CErrorStr315 = 315,
+ // "assigning a non-int numeric value to an unprototyped function"
CErrorStr316 = 316,
+ // "implicit arithmetic conversion from '%t' to '%t'"
CErrorStr317 = 317,
+ // "preprocessor #error directive"
CErrorStr318 = 318,
+ // "ambiguous access to name found '%u' and '%u'"
CErrorStr319 = 319,
+ // "illegal namespace"
CErrorStr320 = 320,
+ // "illegal use of namespace name"
CErrorStr321 = 321,
+ // "illegal name overloading"
CErrorStr322 = 322,
+ // "instance variable list does not match @interface"
CErrorStr323 = 323,
+ // "protocol list does not match @interface"
CErrorStr324 = 324,
+ // "super class does not match @interface"
CErrorStr325 = 325,
+ // "function result is a pointer/reference to an automatic variable"
CErrorStr326 = 326,
+ // "cannot allocate initialized objects in the scratchpad"
CErrorStr327 = 327,
+ // "illegal class member access"
CErrorStr328 = 328,
+ // "data object '%o' redefined"
CErrorStr329 = 329,
+ // "illegal access to local variable from other function"
CErrorStr330 = 330,
+ // "illegal implicit member pointer conversion"
CErrorStr331 = 331,
+ // "typename redefined"
CErrorStr332 = 332,
+ // "object '%o' redefined"
CErrorStr333 = 333,
+ // "'main' not defined as external 'int main()' function"
CErrorStr334 = 334,
+ // "illegal explicit template specialization"
CErrorStr335 = 335,
+ // "name has not been declared in namespace/class"
CErrorStr336 = 336,
+ // "preprocessor #warning directive"
CErrorStr337 = 337,
+ // "illegal use of asm inline function"
CErrorStr338 = 338,
+ // "illegal use of C++ feature in EC++"
CErrorStr339 = 339,
+ // "illegal use template argument dependent type 'T::%u'"
CErrorStr340 = 340,
+ // "illegal use of alloca() in function argument"
CErrorStr341 = 341,
+ // "inline function call '%o' not inlined"
CErrorStr342 = 342,
+ // "inconsistent use of 'class' and 'struct' keywords"
CErrorStr343 = 343,
+ // "illegal partial specialization"
CErrorStr344 = 344,
+ // "illegal partial specialization argument list"
CErrorStr345 = 345,
+ // "ambiguous use of partial specialization"
CErrorStr346 = 346,
+ // "local classes shall not have member templates"
CErrorStr347 = 347,
+ // "illegal template argument dependent expression"
CErrorStr348 = 348,
+ // "implicit 'int' is no longer supported in C++"
CErrorStr349 = 349,
+ // "%i pad byte(s) inserted after data member '%u'"
CErrorStr350 = 350,
+ // "pure function '%o' is not virtual"
CErrorStr351 = 351,
+ // "illegal virtual function '%o' in 'union'"
CErrorStr352 = 352,
+ // "cannot pass 'void' or 'function' parameter"
CErrorStr353 = 353,
+ // "illegal static const member '%u' initialization"
CErrorStr354 = 354,
+ // "'typename' is missing in template argument dependent qualified type"
CErrorStr355 = 355,
+ // "more than one expression in non-class type conversion"
CErrorStr356 = 356,
+ // "template non-type argument objects shall have external linkage"
CErrorStr357 = 357,
+ // "illegal inline assembly operand: %u"
CErrorStr358 = 358,
+ // "illegal or unsupported __attribute__"
CErrorStr359 = 359,
+ // "cannot create object file '%f'"
CErrorStr360 = 360,
+ // "error writing to object file '%f'"
CErrorStr361 = 361,
+ // "printf-family format string doesn't match arguments"
CErrorStr362 = 362,
+ // "scanf-family format string doesn't match arguments"
CErrorStr363 = 363,
+ // "__alignof__() is not supported for SOM classes"
CErrorStr364 = 364,
+ // "illegal macro argument name '%u'"
CErrorStr365 = 365,
+ // "case has an empty range of values"
CErrorStr366 = 366,
+ // "'long long' switch() is not supported"
CErrorStr367 = 367,
+ // "'long long' case range is not supported"
CErrorStr368 = 368,
+ // "expression has no side effect"
CErrorStr369 = 369,
+ // "result of function call is not used"
CErrorStr370 = 370,
+ // "illegal non-type template argument"
CErrorStr371 = 371,
+ // "illegal use of abstract class ('%t')"
CErrorStr372 = 372,
+ // "illegal use of 'template' prefix"
CErrorStr373 = 373,
+ // "template parameter/argument list mismatch"
CErrorStr374 = 374,
+ // "cannot find matching deallocation function for '%t'"
CErrorStr375 = 375,
+ // "illegal operand '%t'"
CErrorStr376 = 376,
+ // "illegal operands '%t' %u '%t'"
CErrorStr377 = 377,
+ // "illegal use of default template-argument"
CErrorStr378 = 378,
+ // "illegal UUID syntax"
CErrorStr379 = 379,
+ // "__uuidof() is not supported for SOM classes"
CErrorStr380 = 380,
+ // "illegal access from '%t' to protected/private member '%o'"
CErrorStr381 = 381,
+ // "integral type is not large enough to hold pointer"
CErrorStr382 = 382,
+ // "unknown x86 assembler instruction mnemonic"
CErrorStr383 = 383,
+ // "illegal use of const/volatile function qualifier sequence"
CErrorStr384 = 384,
+ // "illegal optimization level for this limited version of CodeWarrior"
CErrorStr385 = 385,
+ // "no UUID defined for type '%t'"
CErrorStr386 = 386,
+ // "using implicit copy assigment for class with const or reference member ('%t')"
CErrorStr387 = 387,
+ // "unimplemented assembler instruction/directive"
CErrorStr388 = 388,
+ // "override of dllimport function '%u' only has application scope"
CErrorStr389 = 389,
+ // "illegal combination of operands in inline statement at line %i"
CErrorStr390 = 390,
+ // "illegal operand in inline statement at line %i"
CErrorStr391 = 391,
+ // "function call '*' is ambiguous"
CErrorStr392 = 392,
CErrorStrMAX = 393
};
@@ -316,12 +609,12 @@ extern char cerror_synchdata[32];
extern short cerror_synchoffset;
extern int CError_BreakPointcount;
-extern void CError_Init();
+extern void CError_Init(void);
extern void CError_SetErrorToken(TStreamElement *token);
-extern void CError_SetNullErrorToken();
+extern void CError_SetNullErrorToken(void);
extern void CError_LockErrorPos(TStreamElement *token, TStreamElement **saved);
extern void CError_UnlockErrorPos(TStreamElement **saved);
-extern void CError_ResetErrorSkip();
+extern void CError_ResetErrorSkip(void);
extern void CError_GetErrorString(char *buf, short code);
extern void CError_BufferInit(CErrorBuffer *eb, char *buf, SInt32 bufSize);
extern void CError_BufferGrow(CErrorBuffer *eb, SInt32 amount);
@@ -360,10 +653,10 @@ extern void CError_AbstractClassError(TypeClass *tclass);
extern void CError_Warning(int code, ...);
extern void CError_BreakPoint(const char *a, const char *b);
extern void CError_Internal(char *filename, int line);
-extern void CError_ExpressionTooComplex();
-extern void CError_NoMem();
-extern void CError_UserBreak();
-extern void CError_CannotOpen();
+extern void CError_ExpressionTooComplex(void);
+extern void CError_NoMem(void);
+extern void CError_UserBreak(void);
+extern void CError_CannotOpen(void);
extern void CError_QualifierCheck(UInt32 qual);
#endif
diff --git a/includes/compiler/CInline.h b/includes/compiler/CInline.h
index 4fae90a..51abd45 100644
--- a/includes/compiler/CInline.h
+++ b/includes/compiler/CInline.h
@@ -115,7 +115,7 @@ typedef struct CI_Action {
union {
struct {
FileOffsetInfo fileoffset;
- TStream stream;
+ TokenStream stream;
TypeClass *tclass;
} inlinefunc;
struct {
@@ -151,7 +151,7 @@ extern SInt16 CInline_GetStatementNumber(Statement *first, Statement *stmt);
extern void CInline_PackIFunctionData(CI_FuncData *packed, Statement *stmt, Object *object);
extern void CInline_UnpackIFunctionData(Object *object, CI_FuncData *packed, Statement *firstStmt);
extern void CInline_AddDefaultFunctionAction(Object *object);
-extern void CInline_AddInlineFunctionAction(Object *object, TypeClass *tclass, FileOffsetInfo *fileoffset, TStream *stream, Boolean flag);
+extern void CInline_AddInlineFunctionAction(Object *object, TypeClass *tclass, FileOffsetInfo *fileoffset, TokenStream *stream, Boolean flag);
extern void CInline_AddMemberFunctionAction(Object *object, TemplClass *templ, TemplClassInst *inst, TemplateMember *tmemb);
extern void CInline_AddTemplateFunctionAction(Object *object, TemplateFunction *func, TemplFuncInstance *inst);
extern void CInline_ObjectAddrRef(Object *object);
diff --git a/includes/compiler/CInt64.h b/includes/compiler/CInt64.h
index dc8b51d..a0938e2 100644
--- a/includes/compiler/CInt64.h
+++ b/includes/compiler/CInt64.h
@@ -40,7 +40,7 @@ inline void CInt64_Extend32(CInt64 *n) { // assumed name
n->hi = (n->lo >> 31) ? 0xFFFFFFFF : 0;
}
-extern void CInt64_Init();
+extern void CInt64_Init(void);
extern CInt64 CInt64_Not(CInt64 input);
extern CInt64 CInt64_Inv(CInt64 input);
extern CInt64 CInt64_Add(CInt64 lhs, CInt64 rhs);
diff --git a/includes/compiler/CMachine.h b/includes/compiler/CMachine.h
index be763d5..72efcea 100644
--- a/includes/compiler/CMachine.h
+++ b/includes/compiler/CMachine.h
@@ -60,7 +60,7 @@ extern Boolean CMach_FloatIsNegOne(Float fval);
extern void CMach_InitFloatMem(Type *type, Float val, void *mem);
extern void CMach_PrintFloat(char *buf, Float val);
extern void CMach_PragmaParams(void);
-extern void CMach_AdjustFuntionArgs(void);
+extern void CMach_AdjustFuntionArgs(/* unknown args */);
extern SInt16 CMach_GetStructAlign(TypeStruct *tstruct);
extern SInt16 CMach_GetClassAlign(TypeClass *tclass);
extern SInt16 CMach_GetTypeAlign(Type *type);
diff --git a/includes/compiler/CObjC.h b/includes/compiler/CObjC.h
index cd7686d..30a16bb 100644
--- a/includes/compiler/CObjC.h
+++ b/includes/compiler/CObjC.h
@@ -30,7 +30,7 @@ extern void CObjC_ParseInterface(void);
extern void CObjC_ParseImplementation(void);
extern void CObjC_ParseProtocol(void);
extern void CObjC_ParseClassDeclaration(void);
-extern void *CObjC_ParseIdentifier();
+extern void *CObjC_ParseIdentifier(/* unknown args */);
extern ENode *CObjC_MakeSendMsgExpr(ENode *objexpr, TypeClass *tclass, ObjCNamedArg *namedArgs, ENodeList *unnamedArgs, UInt8 calltype, Boolean isSuper);
extern ENode *CObjC_ParseMessageExpression(void);
extern ENode *CObjC_ParseEncodeExpression(void);
diff --git a/includes/compiler/CPrec.h b/includes/compiler/CPrec.h
index a2ac87c..38078ca 100644
--- a/includes/compiler/CPrec.h
+++ b/includes/compiler/CPrec.h
@@ -3,7 +3,9 @@
#include "compiler/common.h"
-extern void SetupPrecompiler(void);
+extern char *precomp_target_str;
+
+extern void SetupPrecompiler(Boolean isPrecompiling);
extern void CleanupPrecompiler(void);
extern void PreComp_StaticData(Object *obj, const void *data, OLinkList *links, SInt32 size);
extern void PrecompilerWrite(void);
diff --git a/includes/compiler/CPrep.h b/includes/compiler/CPrep.h
index aeb341b..02d5a76 100644
--- a/includes/compiler/CPrep.h
+++ b/includes/compiler/CPrep.h
@@ -15,7 +15,7 @@ struct Macro {
unsigned short xC;
Boolean is_special;
Boolean xF;
- HashNameNode *names[1];
+ HashNameNode *names[0];
};
typedef struct TokenStack {
char *pos;
@@ -25,7 +25,7 @@ typedef struct TokenStack {
} TokenStack;
//#define OPT_OFFSET(optname) ((short) (((char *) (&copts.optname)) - ((char *) &copts)))
-#define OPT_OFFSET(optname) ((short) ( &((COpts *)0)->optname ))
+#define OPT_OFFSET(optname) ((UInt16) ( &((COpts *)0)->optname ))
enum {
OPT_OFFSET_MASK = 0x1FFF,
OPT_FLAG_2000 = 0x2000,
@@ -89,11 +89,11 @@ extern void CPrep_UnLex(void);
// this is actually an arg of `const PrepState *`
extern void CPrep_TokenStreamSetCurState(SInt32 *state);
typedef void (*CPrepStreamFuncPtr)(TStreamElement *);
-extern void CPrep_StreamGetBlock(TStream *stream, CPrepStreamFuncPtr func, int arg);
-extern void CPrep_StreamGetSemicolon(TStream *stream, CPrepStreamFuncPtr func);
-extern void CPrep_StreamGetTemplate(TStream *stream, CPrepStreamFuncPtr func);
-extern void CPrep_StreamInsert(TStream *stream, SInt32 *state);
-extern void CPrep_StreamRemove(TStream *stream, SInt32 *state);
+extern void CPrep_StreamGetBlock(TokenStream *stream, CPrepStreamFuncPtr func, int arg);
+extern void CPrep_StreamGetSemicolon(TokenStream *stream, CPrepStreamFuncPtr func);
+extern void CPrep_StreamGetTemplate(TokenStream *stream, CPrepStreamFuncPtr func);
+extern void CPrep_StreamInsert(TokenStream *stream, SInt32 *state);
+extern void CPrep_StreamRemove(TokenStream *stream, SInt32 *state);
extern void CPrep_RemoveTokens(SInt32 amount);
extern void CPrep_TokenStreamFlush(void);
extern TStreamElement *CPrep_CurStreamElement(void);
diff --git a/includes/compiler/CScope.h b/includes/compiler/CScope.h
index f9ba72c..7a4c3de 100644
--- a/includes/compiler/CScope.h
+++ b/includes/compiler/CScope.h
@@ -97,7 +97,7 @@ extern NameSpaceObjectList *CScope_GetLocalObject(NameSpace *nspace, HashNameNod
extern BClassList *CScope_GetClassAccessPath(BClassList *list, TypeClass *tclass);
extern Boolean CScope_ParseMemberName(TypeClass *tclass, CScopeParseResult *result, Boolean flag);
extern void CScope_AddClassUsingDeclaration(TypeClass *tclass, TypeClass *tclass2, HashNameNode *name, AccessType access);
-extern void CScope_ParseUsingDeclaration(NameSpace *nspace, short access, Boolean flag);
+extern void CScope_ParseUsingDeclaration(NameSpace *nspace, AccessType access, Boolean flag);
extern void CScope_ParseNameSpaceAlias(HashNameNode *name);
extern void CScope_ParseUsingDirective(NameSpace *nspace);
diff --git a/includes/compiler/CTemplateClass.h b/includes/compiler/CTemplateClass.h
index 4400480..12cd088 100644
--- a/includes/compiler/CTemplateClass.h
+++ b/includes/compiler/CTemplateClass.h
@@ -13,7 +13,7 @@ extern void CTemplClass_RegisterObjectInit(TemplClass *tmclass, Object *object,
extern void CTemplClass_RegisterObjectDef(TemplClass *tmclass, ObjBase *refobj);
extern void CTemplClass_CompleteClass(TemplClass *templ, DeclE *de);
extern TemplClassInst *CTemplClass_GetInstance(TemplClass *tmclass, TemplArg *args1, TemplArg *args2);
-extern TemplateMember *CTemplClass_DefineMember(TemplClass *tmclass, Object *object, FileOffsetInfo *foi, TStream *stream);
+extern TemplateMember *CTemplClass_DefineMember(TemplClass *tmclass, Object *object, FileOffsetInfo *foi, TokenStream *stream);
extern void CTemplClass_ParsePartialSpecialization(DeclFucker *what_is_this, TemplParam *params, short mode, SInt32 *offset);
extern void CTemplClass_ParseClass(DeclFucker *what_is_this, TemplParam *params, short mode, SInt32 *offset);
extern Boolean CTemplClass_FindPartialTemplate(TemplArg *args, TemplClass **resultTempl, TemplArg **resultArgs);
diff --git a/includes/compiler/CompilerTools.h b/includes/compiler/CompilerTools.h
index 82ef228..b218925 100644
--- a/includes/compiler/CompilerTools.h
+++ b/includes/compiler/CompilerTools.h
@@ -49,7 +49,7 @@ struct GList {
extern long hash_name_id;
extern HashNameNode **name_hash_nodes;
-extern void (*GListErrorProc)();
+extern void (*GListErrorProc)(void);
extern short InitGList(GList *gl, SInt32 size);
extern void FreeGList(GList *gl);
@@ -79,34 +79,34 @@ extern HashNameNode *GetHashNameNodeHash2(const char *name, SInt16 hashval);
extern HashNameNode *GetHashNameNodeExport(const char *name);
extern SInt32 GetHashNameNodeExportID(HashNameNode *node);
extern HashNameNode *GetHashNameNodeByID(SInt32 id);
-extern void NameHashExportReset();
+extern void NameHashExportReset(void);
extern void NameHashWriteNameTable(GList *glist);
extern void NameHashWriteTargetEndianNameTable(GList *glist);
-extern void InitNameHash();
+extern void InitNameHash(void);
-typedef void (*heaperror_t)();
+typedef void (*heaperror_t)(void);
-extern SInt32 CTool_TotalHeapSize();
+extern SInt32 CTool_TotalHeapSize(void);
extern void CTool_GetHeapInfo(HeapInfo *result, unsigned char heapID);
extern short initheaps(heaperror_t heaperrorproc);
extern short initgheap(heaperror_t heaperrorproc);
-extern heaperror_t getheaperror();
+extern heaperror_t getheaperror(void);
extern void setheaperror(heaperror_t heaperrorproc);
-extern void releaseheaps();
-extern void releasegheap();
-extern void releaseoheap();
+extern void releaseheaps(void);
+extern void releasegheap(void);
+extern void releaseoheap(void);
extern void *galloc(SInt32 s);
extern void *lalloc(SInt32 s);
extern void *aalloc(SInt32 s);
extern void *oalloc(SInt32 s);
extern void *balloc(SInt32 s);
-extern void locklheap();
-extern void unlocklheap();
-extern void freelheap();
-extern void freeaheap();
-extern void freeoheap();
-extern void freebheap();
+extern void locklheap(void);
+extern void unlocklheap(void);
+extern void freelheap(void);
+extern void freeaheap(void);
+extern void freeoheap(void);
+extern void freebheap(void);
extern char *ScanHex(char *string, UInt32 *result, Boolean *overflow);
extern char *ScanOct(char *string, UInt32 *result, Boolean *overflow);
diff --git a/includes/compiler/ObjGenMachO.h b/includes/compiler/ObjGenMachO.h
index 82c8650..edc4944 100644
--- a/includes/compiler/ObjGenMachO.h
+++ b/includes/compiler/ObjGenMachO.h
@@ -47,7 +47,7 @@ extern void ObjGen_SrcBreakName(HashNameNode *name, SInt32 fileModDate, Boolean
extern GList *ObjGen_GetSectionGList(MachOSection *section);
extern MachOSection *ObjGen_DeclareFunction(Object *object);
extern MachOSection *ObjGen_DeclareCode(Object *object);
-extern MachOSection *ObjGen_DeclareMachSection();
+extern MachOSection *ObjGen_DeclareMachSection(/* unknown args */);
extern void ObjGen_Relocate(MachOSection *section, SInt32 offset, SInt32 relocID, RelocType relocType, MWReloc mwRelType);
extern void ObjGen_RelocateObj(MachOSection *section, SInt32 offset, Object *object, MWReloc mwRelType);
extern SInt32 ObjGen_DeclareLiteralString(UInt32 len, char *data, SInt32 align);
@@ -68,7 +68,7 @@ extern void ObjGen_DeclareSymInfo(void);
extern void ObjGen_Line(UInt32 line, UInt32 offset);
extern void ObjGen_OutputDebugInfo(Object *funcobj);
extern SInt32 ObjGen_OutputStab(SymbolData *symbol, SInt32 strIdx);
-extern void ObjGen_SetSectName();
+extern void ObjGen_SetSectName(/* unknown args */);
extern void ObjGen_DeclareInitFunction(Object *funcobj);
extern Boolean ObjGen_IsExported(Object *object);
diff --git a/includes/compiler/Operands.h b/includes/compiler/Operands.h
index cd9c035..8808e60 100644
--- a/includes/compiler/Operands.h
+++ b/includes/compiler/Operands.h
@@ -61,15 +61,15 @@ extern void combine(Operand *opA, Operand *opB, short output_reg, Operand *opOut
extern void coerce_to_addressable(Operand *op);
extern void Coerce_to_register(Operand *op, Type *type, short output_reg);
extern void coerce_to_register_pair(Operand *op, Type *type, short output_reg, short output_regHi);
-extern void Coerce_to_fp_register(Operand *op, Type *tint, short output_reg);
-extern void Coerce_to_v_register(Operand *op, Type *tstruct, short output_reg);
+extern void Coerce_to_fp_register(Operand *op, Type *type, short output_reg);
+extern void Coerce_to_v_register(Operand *op, Type *type, short output_reg);
extern void store(short reg, Operand *op, Type *type);
extern void store_pair(short reg, short regHi, Operand *op, Type *type);
extern void store_fp(short reg, Operand *op, Type *tint);
extern void store_v(short reg, Operand *op, Type *tstruct);
extern void extend32(Operand *op, Type *type, short output_reg);
extern void extend64(Operand *op, Type *type, short output_reg, short output_regHi);
-extern void load_floating_constant(short reg, Type *type, double *data);
+extern void load_floating_constant(short reg, Type *type, Float *data);
extern void convert_integer_to_floating(Operand *op, Boolean is_single, short output_reg);
extern void convert_unsigned_to_floating(Operand *op, Boolean is_single, short output_reg);
extern void convert_floating_to_integer(Operand *op, short output_reg);
diff --git a/includes/compiler/PCode.h b/includes/compiler/PCode.h
index 9b6103b..97f652d 100644
--- a/includes/compiler/PCode.h
+++ b/includes/compiler/PCode.h
@@ -8,11 +8,11 @@
#pragma options align=mac68k
#endif
-#define FLAG_SET_T(flags) (((flags) & (fPCodeFlag1 | fPCodeFlag8)) ? (flags) : 0)
-#define FLAG_SET_F(flags) (((flags) & (fPCodeFlag1 | fPCodeFlag8)) ? 0 : (flags))
+#define FLAG_SET_T(flags) (((flags) & (fIsBranch | fIsCall)) ? (flags) : 0)
+#define FLAG_SET_F(flags) (((flags) & (fIsBranch | fIsCall)) ? 0 : (flags))
-#define PCODE_FLAG_SET_T(pcode) (((pcode)->flags & (fPCodeFlag1 | fPCodeFlag8)) ? (pcode)->flags : 0)
-#define PCODE_FLAG_SET_F(pcode) (((pcode)->flags & (fPCodeFlag1 | fPCodeFlag8)) ? 0 : (pcode)->flags)
+#define PCODE_FLAG_SET_T(pcode) (((pcode)->flags & (fIsBranch | fIsCall)) ? (pcode)->flags : 0)
+#define PCODE_FLAG_SET_F(pcode) (((pcode)->flags & (fIsBranch | fIsCall)) ? 0 : (pcode)->flags)
enum {
EffectRead = 1,
@@ -22,16 +22,6 @@ enum {
Effect40 = 0x40 // spilled register?
};
-/*typedef enum {
- PCOp_REGISTER,
- PCOp_SYSREG,
- PCOp_IMMEDIATE,
- PCOp_MEMORY,
- PCOp_LABEL,
- PCOp_LABELDIFF,
- PCOp_PLACEHOLDEROPERAND
-} PCOpKind;*/
-
typedef enum {
RefType_0,
RefType_1, // like D, but 32-bit?
@@ -158,12 +148,11 @@ struct PCodeBlock {
/* PCode Flags */
enum {
- fPCodeFlag1 = 1, // some kinds of branches
- fPCodeFlag2 = 2, // read from memory
- fPCodeFlag4 = 4, // write to memory
- fPCodeFlag8 = 8, // other kinds of branches
- fPCodeFlag10 = 0x10, // moves
- fPCodeFlag20 = 0x20, // indexed operations
+ fIsBranch = 1,
+ fIsRead = 2, // read from memory
+ fIsWrite = 4, // write to memory
+ fIsCall = 8,
+ fIsMove = 0x10, // moves register (mcrf, mr, fmr, vmr, vmrp)
// Always valid
fIsConst = 0x40,
fIsVolatile = 0x80,
@@ -174,36 +163,39 @@ enum {
fPCodeFlag1000 = 0x1000, // ?
fCommutative = 0x2000,
fIsCSE = 0x4000,
- fPCodeFlag8000 = 0x8000,
+ fIsArgInit = 0x8000, // instruction that stores varargs from GPRs to the stack
fPCodeFlag20000 = 0x20000, // some kinda load?
fPCodeFlag40000 = 0x40000, // some kinda store?
// Set 1 (branches) only
fLink = 0x1000000,
+ fCanLink = 0x2000000, // is capable of being a link branch
fBranchNotTaken = 0x4000000,
fBranchTaken = 0x8000000,
fAbsolute = 0x10000000,
+ fCanBeAbsolute = 0x20000000, // is capable of having fAbsolute set
// Set 2 (non-branches) only
fIsPtrOp = 0x20,
+ fPCodeFlag200000 = 0x200000,
+ fPCodeFlag400000 = 0x400000,
fOverflow = 0x800000,
+ fUpdatesPtr = 0x2000000, // lbzu, lbzux, lwzu, stbu, stbux, etc
+ fCanSetCarry = 0x4000000, // is capable of having fSetsCarry set
+ fCanSetRecordBit = 0x8000000, // is capable of having fRecordBit set
fSetsCarry = 0x10000000,
- fPCodeFlag20000000 = 0x20000000, // record bit?
- // ??
- fPCodeFlag2000000 = 0x2000000,
- fPCodeFlag4000000 = 0x4000000,
- fPCodeFlag8000000 = 0x8000000,
- fPCodeFlag10000000 = 0x10000000,
- fPCodeFlag40000000 = 0x40000000,
- fPCodeFlag80000000 = 0x80000000,
- fPCodeFlagC0000000 = 0xC0000000
+ fRecordBit = 0x20000000,
+ fOpTypeFPR = 0x40000000,
+ fOpTypeGPR = 0x80000000,
+ fOpTypeVR = 0xC0000000,
+ fOpTypeMask = 0xC0000000
};
enum {
- fPCBlockFlag1 = 1, // fIsProlog
- fPCBlockFlag2 = 2, // fIsEpilogue
- fPCBlockFlag4 = 4, // fVisited
- fPCBlockFlag8 = 8, // fScheduled
+ fIsProlog = 1, // fIsProlog
+ fIsEpilogue = 2, // fIsEpilogue
+ fVisited = 4, // fVisited
+ fScheduled = 8, // fScheduled
fPCBlockFlag10 = 0x10, // maybe fIsSwitch based off v3?
- fPCBlockFlag20 = 0x20, // fDeleted
+ fDeleted = 0x20,
fPCBlockFlag2000 = 0x2000,
fPCBlockFlag4000 = 0x4000,
fPCBlockFlag6000 = 0x6000,
diff --git a/includes/compiler/PCodeInfo.h b/includes/compiler/PCodeInfo.h
index b70211a..330a422 100644
--- a/includes/compiler/PCodeInfo.h
+++ b/includes/compiler/PCodeInfo.h
@@ -463,870 +463,9 @@ typedef enum Opcode {
PC_RRIB = 0x1AB,
OPCODE_MAX = 0x1AC
} Opcode;
-//#define PC_B 0x0
-//#define PC_BL 0x1
-//#define PC_BC 0x2
-//#define PC_BCLR 0x3
-//#define PC_BCCTR 0x4
-//#define PC_BT 0x5
-//#define PC_BTLR 0x6
-//#define PC_BTCTR 0x7
-//#define PC_BF 0x8
-//#define PC_BFLR 0x9
-//#define PC_BFCTR 0xA
-//#define PC_BDNZ 0xB
-//#define PC_BDNZT 0xC
-//#define PC_BDNZF 0xD
-//#define PC_BDZ 0xE
-//#define PC_BDZT 0xF
-//#define PC_BDZF 0x10
-//#define PC_BLR 0x11
-//#define PC_BCTR 0x12
-//#define PC_BCTRL 0x13
-//#define PC_BLRL 0x14
-//#define PC_LBZ 0x15
-//#define PC_LBZU 0x16
-//#define PC_LBZX 0x17
-//#define PC_LBZUX 0x18
-//#define PC_LHZ 0x19
-//#define PC_LHZU 0x1A
-//#define PC_LHZX 0x1B
-//#define PC_LHZUX 0x1C
-//#define PC_LHA 0x1D
-//#define PC_LHAU 0x1E
-//#define PC_LHAX 0x1F
-//#define PC_LHAUX 0x20
-//#define PC_LHBRX 0x21
-//#define PC_LWZ 0x22
-//#define PC_LWZU 0x23
-//#define PC_LWZX 0x24
-//#define PC_LWZUX 0x25
-//#define PC_LWBRX 0x26
-//#define PC_LMW 0x27
-//#define PC_STB 0x28
-//#define PC_STBU 0x29
-//#define PC_STBX 0x2A
-//#define PC_STBUX 0x2B
-//#define PC_STH 0x2C
-//#define PC_STHU 0x2D
-//#define PC_STHX 0x2E
-//#define PC_STHUX 0x2F
-//#define PC_STHBRX 0x30
-//#define PC_STW 0x31
-//#define PC_STWU 0x32
-//#define PC_STWX 0x33
-//#define PC_STWUX 0x34
-//#define PC_STWBRX 0x35
-//#define PC_STMW 0x36
-//#define PC_DCBF 0x37
-//#define PC_DCBST 0x38
-//#define PC_DCBT 0x39
-//#define PC_DCBTST 0x3A
-//#define PC_DCBZ 0x3B
-//#define PC_ADD 0x3C
-//#define PC_ADDC 0x3D
-//#define PC_ADDE 0x3E
-//#define PC_ADDI 0x3F
-//#define PC_ADDIC 0x40
-//#define PC_ADDICR 0x41
-//#define PC_ADDIS 0x42
-//#define PC_ADDME 0x43
-//#define PC_ADDZE 0x44
-//#define PC_DIVW 0x45
-//#define PC_DIVWU 0x46
-//#define PC_MULHW 0x47
-//#define PC_MULHWU 0x48
-//#define PC_MULLI 0x49
-//#define PC_MULLW 0x4A
-//#define PC_NEG 0x4B
-//#define PC_SUBF 0x4C
-//#define PC_SUBFC 0x4D
-//#define PC_SUBFE 0x4E
-//#define PC_SUBFIC 0x4F
-//#define PC_SUBFME 0x50
-//#define PC_SUBFZE 0x51
-//#define PC_CMPI 0x52
-//#define PC_CMP 0x53
-//#define PC_CMPLI 0x54
-//#define PC_CMPL 0x55
-//#define PC_ANDI 0x56
-//#define PC_ANDIS 0x57
-//#define PC_ORI 0x58
-//#define PC_ORIS 0x59
-//#define PC_XORI 0x5A
-//#define PC_XORIS 0x5B
-//#define PC_AND 0x5C
-//#define PC_OR 0x5D
-//#define PC_XOR 0x5E
-//#define PC_NAND 0x5F
-//#define PC_NOR 0x60
-//#define PC_EQV 0x61
-//#define PC_ANDC 0x62
-//#define PC_ORC 0x63
-//#define PC_EXTSB 0x64
-//#define PC_EXTSH 0x65
-//#define PC_CNTLZW 0x66
-//#define PC_RLWINM 0x67
-//#define PC_RLWNM 0x68
-//#define PC_RLWIMI 0x69
-//#define PC_SLW 0x6A
-//#define PC_SRW 0x6B
-//#define PC_SRAWI 0x6C
-//#define PC_SRAW 0x6D
-//#define PC_CRAND 0x6E
-//#define PC_CRANDC 0x6F
-//#define PC_CREQV 0x70
-//#define PC_CRNAND 0x71
-//#define PC_CRNOR 0x72
-//#define PC_CROR 0x73
-//#define PC_CRORC 0x74
-//#define PC_CRXOR 0x75
-//#define PC_MCRF 0x76
-//#define PC_MTXER 0x77
-//#define PC_MTCTR 0x78
-//#define PC_MTLR 0x79
-//#define PC_MTCRF 0x7A
-//#define PC_MTMSR 0x7B
-//#define PC_MTSPR 0x7C
-//#define PC_MFMSR 0x7D
-//#define PC_MFSPR 0x7E
-//#define PC_MFXER 0x7F
-//#define PC_MFCTR 0x80
-//#define PC_MFLR 0x81
-//#define PC_MFCR 0x82
-//#define PC_MFFS 0x83
-//#define PC_MTFSF 0x84
-//#define PC_EIEIO 0x85
-//#define PC_ISYNC 0x86
-//#define PC_SYNC 0x87
-//#define PC_RFI 0x88
-//#define PC_LI 0x89
-//#define PC_LIS 0x8A
-//#define PC_MR 0x8B
-//#define PC_NOP 0x8C
-//#define PC_NOT 0x8D
-//#define PC_LFS 0x8E
-//#define PC_LFSU 0x8F
-//#define PC_LFSX 0x90
-//#define PC_LFSUX 0x91
-//#define PC_LFD 0x92
-//#define PC_LFDU 0x93
-//#define PC_LFDX 0x94
-//#define PC_LFDUX 0x95
-//#define PC_STFS 0x96
-//#define PC_STFSU 0x97
-//#define PC_STFSX 0x98
-//#define PC_STFSUX 0x99
-//#define PC_STFD 0x9A
-//#define PC_STFDU 0x9B
-//#define PC_STFDX 0x9C
-//#define PC_STFDUX 0x9D
-//#define PC_FMR 0x9E
-//#define PC_FABS 0x9F
-//#define PC_FNEG 0xA0
-//#define PC_FNABS 0xA1
-//#define PC_FADD 0xA2
-//#define PC_FADDS 0xA3
-//#define PC_FSUB 0xA4
-//#define PC_FSUBS 0xA5
-//#define PC_FMUL 0xA6
-//#define PC_FMULS 0xA7
-//#define PC_FDIV 0xA8
-//#define PC_FDIVS 0xA9
-//#define PC_FMADD 0xAA
-//#define PC_FMADDS 0xAB
-//#define PC_FMSUB 0xAC
-//#define PC_FMSUBS 0xAD
-//#define PC_FNMADD 0xAE
-//#define PC_FNMADDS 0xAF
-//#define PC_FNMSUB 0xB0
-//#define PC_FNMSUBS 0xB1
-//#define PC_FRES 0xB2
-//#define PC_FRSQRTE 0xB3
-//#define PC_FSEL 0xB4
-//#define PC_FRSP 0xB5
-//#define PC_FCTIW 0xB6
-//#define PC_FCTIWZ 0xB7
-//#define PC_FCMPU 0xB8
-//#define PC_FCMPO 0xB9
-//#define PC_LWARX 0xBA
-//#define PC_LSWI 0xBB
-//#define PC_LSWX 0xBC
-//#define PC_STFIWX 0xBD
-//#define PC_STSWI 0xBE
-//#define PC_STSWX 0xBF
-//#define PC_STWCX 0xC0
-//#define PC_ECIWX 0xC1
-//#define PC_ECOWX 0xC2
-//#define PC_DCBI 0xC3
-//#define PC_ICBI 0xC4
-//#define PC_MCRFS 0xC5
-//#define PC_MCRXR 0xC6
-//#define PC_MFTB 0xC7
-//#define PC_MFSR 0xC8
-//#define PC_MTSR 0xC9
-//#define PC_MFSRIN 0xCA
-//#define PC_MTSRIN 0xCB
-//#define PC_MTFSB0 0xCC
-//#define PC_MTFSB1 0xCD
-//#define PC_MTFSFI 0xCE
-//#define PC_SC 0xCF
-//#define PC_FSQRT 0xD0
-//#define PC_FSQRTS 0xD1
-//#define PC_TLBIA 0xD2
-//#define PC_TLBIE 0xD3
-//#define PC_TLBLD 0xD4
-//#define PC_TLBLI 0xD5
-//#define PC_TLBSYNC 0xD6
-//#define PC_TW 0xD7
-//#define PC_TRAP 0xD8
-//#define PC_TWI 0xD9
-//#define PC_OPWORD 0xDA
-//#define PC_MFROM 0xDB
-//#define PC_DSA 0xDC
-//#define PC_ESA 0xDD
-//#define PC_DCCCI 0xDE
-//#define PC_DCREAD 0xDF
-//#define PC_ICBT 0xE0
-//#define PC_ICCCI 0xE1
-//#define PC_ICREAD 0xE2
-//#define PC_RFCI 0xE3
-//#define PC_TLBRE 0xE4
-//#define PC_TLBSX 0xE5
-//#define PC_TLBWE 0xE6
-//#define PC_WRTEE 0xE7
-//#define PC_WRTEEI 0xE8
-//#define PC_MFDCR 0xE9
-//#define PC_MTDCR 0xEA
-//#define PC_DCBA 0xEB
-//#define PC_DSS 0xEC
-//#define PC_DSSALL 0xED
-//#define PC_DST 0xEE
-//#define PC_DSTT 0xEF
-//#define PC_DSTST 0xF0
-//#define PC_DSTSTT 0xF1
-//#define PC_LVEBX 0xF2
-//#define PC_LVEHX 0xF3
-//#define PC_LVEWX 0xF4
-//#define PC_LVSL 0xF5
-//#define PC_LVSR 0xF6
-//#define PC_LVX 0xF7
-//#define PC_LVXL 0xF8
-//#define PC_STVEBX 0xF9
-//#define PC_STVEHX 0xFA
-//#define PC_STVEWX 0xFB
-//#define PC_STVX 0xFC
-//#define PC_STVXL 0xFD
-//#define PC_MFVSCR 0xFE
-//#define PC_MTVSCR 0xFF
-//#define PC_VADDCUW 0x100
-//#define PC_VADDFP 0x101
-//#define PC_VADDSBS 0x102
-//#define PC_VADDSHS 0x103
-//#define PC_VADDSWS 0x104
-//#define PC_VADDUBM 0x105
-//#define PC_VADDUBS 0x106
-//#define PC_VADDUHM 0x107
-//#define PC_VADDUHS 0x108
-//#define PC_VADDUWM 0x109
-//#define PC_VADDUWS 0x10A
-//#define PC_VAND 0x10B
-//#define PC_VANDC 0x10C
-//#define PC_VAVGSB 0x10D
-//#define PC_VAVGSH 0x10E
-//#define PC_VAVGSW 0x10F
-//#define PC_VAVGUB 0x110
-//#define PC_VAVGUH 0x111
-//#define PC_VAVGUW 0x112
-//#define PC_VCFSX 0x113
-//#define PC_VCFUX 0x114
-//#define PC_VCMPBFP 0x115
-//#define PC_VCMPEQFP 0x116
-//#define PC_VCMPEQUB 0x117
-//#define PC_VCMPEQUH 0x118
-//#define PC_VCMPEQUW 0x119
-//#define PC_VCMPGEFP 0x11A
-//#define PC_VCMPGTFP 0x11B
-//#define PC_VCMPGTSB 0x11C
-//#define PC_VCMPGTSH 0x11D
-//#define PC_VCMPGTSW 0x11E
-//#define PC_VCMPGTUB 0x11F
-//#define PC_VCMPGTUH 0x120
-//#define PC_VCMPGTUW 0x121
-//#define PC_VCTSXS 0x122
-//#define PC_VCTUXS 0x123
-//#define PC_VEXPTEFP 0x124
-//#define PC_VLOGEFP 0x125
-//#define PC_VMAXFP 0x126
-//#define PC_VMAXSB 0x127
-//#define PC_VMAXSH 0x128
-//#define PC_VMAXSW 0x129
-//#define PC_VMAXUB 0x12A
-//#define PC_VMAXUH 0x12B
-//#define PC_VMAXUW 0x12C
-//#define PC_VMINFP 0x12D
-//#define PC_VMINSB 0x12E
-//#define PC_VMINSH 0x12F
-//#define PC_VMINSW 0x130
-//#define PC_VMINUB 0x131
-//#define PC_VMINUH 0x132
-//#define PC_VMINUW 0x133
-//#define PC_VMRGHB 0x134
-//#define PC_VMRGHH 0x135
-//#define PC_VMRGHW 0x136
-//#define PC_VMRGLB 0x137
-//#define PC_VMRGLH 0x138
-//#define PC_VMRGLW 0x139
-//#define PC_VMULESB 0x13A
-//#define PC_VMULESH 0x13B
-//#define PC_VMULEUB 0x13C
-//#define PC_VMULEUH 0x13D
-//#define PC_VMULOSB 0x13E
-//#define PC_VMULOSH 0x13F
-//#define PC_VMULOUB 0x140
-//#define PC_VMULOUH 0x141
-//#define PC_VNOR 0x142
-//#define PC_VOR 0x143
-//#define PC_VPKPX 0x144
-//#define PC_VPKSHSS 0x145
-//#define PC_VPKSHUS 0x146
-//#define PC_VPKSWSS 0x147
-//#define PC_VPKSWUS 0x148
-//#define PC_VPKUHUM 0x149
-//#define PC_VPKUHUS 0x14A
-//#define PC_VPKUWUM 0x14B
-//#define PC_VPKUWUS 0x14C
-//#define PC_VREFP 0x14D
-//#define PC_VRFIM 0x14E
-//#define PC_VRFIN 0x14F
-//#define PC_VRFIP 0x150
-//#define PC_VRFIZ 0x151
-//#define PC_VRLB 0x152
-//#define PC_VRLH 0x153
-//#define PC_VRLW 0x154
-//#define PC_VRSQRTEFP 0x155
-//#define PC_VSL 0x156
-//#define PC_VSLB 0x157
-//#define PC_VSLH 0x158
-//#define PC_VSLO 0x159
-//#define PC_VSLW 0x15A
-//#define PC_VSPLTB 0x15B
-//#define PC_VSPLTH 0x15C
-//#define PC_VSPLTW 0x15D
-//#define PC_VSPLTISB 0x15E
-//#define PC_VSPLTISH 0x15F
-//#define PC_VSPLTISW 0x160
-//#define PC_VSR 0x161
-//#define PC_VSRAB 0x162
-//#define PC_VSRAH 0x163
-//#define PC_VSRAW 0x164
-//#define PC_VSRB 0x165
-//#define PC_VSRH 0x166
-//#define PC_VSRO 0x167
-//#define PC_VSRW 0x168
-//#define PC_VSUBCUW 0x169
-//#define PC_VSUBFP 0x16A
-//#define PC_VSUBSBS 0x16B
-//#define PC_VSUBSHS 0x16C
-//#define PC_VSUBSWS 0x16D
-//#define PC_VSUBUBM 0x16E
-//#define PC_VSUBUBS 0x16F
-//#define PC_VSUBUHM 0x170
-//#define PC_VSUBUHS 0x171
-//#define PC_VSUBUWM 0x172
-//#define PC_VSUBUWS 0x173
-//#define PC_VSUMSWS 0x174
-//#define PC_VSUM2SWS 0x175
-//#define PC_VSUM4SBS 0x176
-//#define PC_VSUM4SHS 0x177
-//#define PC_VSUM4UBS 0x178
-//#define PC_VUPKHPX 0x179
-//#define PC_VUPKHSB 0x17A
-//#define PC_VUPKHSH 0x17B
-//#define PC_VUPKLPX 0x17C
-//#define PC_VUPKLSB 0x17D
-//#define PC_VUPKLSH 0x17E
-//#define PC_VXOR 0x17F
-//#define PC_VMADDFP 0x180
-//#define PC_VMHADDSHS 0x181
-//#define PC_VMHRADDSHS 0x182
-//#define PC_VMLADDUHM 0x183
-//#define PC_VMSUMMBM 0x184
-//#define PC_VMSUMSHM 0x185
-//#define PC_VMSUMSHS 0x186
-//#define PC_VMSUMUBM 0x187
-//#define PC_VMSUMUHM 0x188
-//#define PC_VMSUMUHS 0x189
-//#define PC_VNMSUBFP 0x18A
-//#define PC_VPERM 0x18B
-//#define PC_VSEL 0x18C
-//#define PC_VSLDOI 0x18D
-//#define PC_VMR 0x18E
-//#define PC_VMRP 0x18F
-//#define PC_SLE 0x190
-//#define PC_SLEQ 0x191
-//#define PC_SLIQ 0x192
-//#define PC_SLLIQ 0x193
-//#define PC_SLLQ 0x194
-//#define PC_SLQ 0x195
-//#define PC_SRAIQ 0x196
-//#define PC_SRAQ 0x197
-//#define PC_SRE 0x198
-//#define PC_SREA 0x199
-//#define PC_SREQ 0x19A
-//#define PC_SRIQ 0x19B
-//#define PC_SRLIQ 0x19C
-//#define PC_SRLQ 0x19D
-//#define PC_SRQ 0x19E
-//#define PC_MASKG 0x19F
-//#define PC_MASKIR 0x1A0
-//#define PC_LSCBX 0x1A1
-//#define PC_DIV 0x1A2
-//#define PC_DIVS 0x1A3
-//#define PC_DOZ 0x1A4
-//#define PC_MUL 0x1A5
-//#define PC_NABS 0x1A6
-//#define PC_ABS 0x1A7
-//#define PC_CLCS 0x1A8
-//#define PC_DOZI 0x1A9
-//#define PC_RLMI 0x1AA
-//#define PC_RRIB 0x1AB
-//#define PC_PENTRY 0x1AC
-//#define PC_PEXIT 0x1AD
-//#define OPCODE_MAX 0x1AE
-//const short PC_B = 0x0;
-//const short PC_BL = 0x1;
-//const short PC_BC = 0x2;
-//const short PC_BCLR = 0x3;
-//const short PC_BCCTR = 0x4;
-//const short PC_BT = 0x5;
-//const short PC_BTLR = 0x6;
-//const short PC_BTCTR = 0x7;
-//const short PC_BF = 0x8;
-//const short PC_BFLR = 0x9;
-//const short PC_BFCTR = 0xA;
-//const short PC_BDNZ = 0xB;
-//const short PC_BDNZT = 0xC;
-//const short PC_BDNZF = 0xD;
-//const short PC_BDZ = 0xE;
-//const short PC_BDZT = 0xF;
-//const short PC_BDZF = 0x10;
-//const short PC_BLR = 0x11;
-//const short PC_BCTR = 0x12;
-//const short PC_BCTRL = 0x13;
-//const short PC_BLRL = 0x14;
-//const short PC_LBZ = 0x15;
-//const short PC_LBZU = 0x16;
-//const short PC_LBZX = 0x17;
-//const short PC_LBZUX = 0x18;
-//const short PC_LHZ = 0x19;
-//const short PC_LHZU = 0x1A;
-//const short PC_LHZX = 0x1B;
-//const short PC_LHZUX = 0x1C;
-//const short PC_LHA = 0x1D;
-//const short PC_LHAU = 0x1E;
-//const short PC_LHAX = 0x1F;
-//const short PC_LHAUX = 0x20;
-//const short PC_LHBRX = 0x21;
-//const short PC_LWZ = 0x22;
-//const short PC_LWZU = 0x23;
-//const short PC_LWZX = 0x24;
-//const short PC_LWZUX = 0x25;
-//const short PC_LWBRX = 0x26;
-//const short PC_LMW = 0x27;
-//const short PC_STB = 0x28;
-//const short PC_STBU = 0x29;
-//const short PC_STBX = 0x2A;
-//const short PC_STBUX = 0x2B;
-//const short PC_STH = 0x2C;
-//const short PC_STHU = 0x2D;
-//const short PC_STHX = 0x2E;
-//const short PC_STHUX = 0x2F;
-//const short PC_STHBRX = 0x30;
-//const short PC_STW = 0x31;
-//const short PC_STWU = 0x32;
-//const short PC_STWX = 0x33;
-//const short PC_STWUX = 0x34;
-//const short PC_STWBRX = 0x35;
-//const short PC_STMW = 0x36;
-//const short PC_DCBF = 0x37;
-//const short PC_DCBST = 0x38;
-//const short PC_DCBT = 0x39;
-//const short PC_DCBTST = 0x3A;
-//const short PC_DCBZ = 0x3B;
-//const short PC_ADD = 0x3C;
-//const short PC_ADDC = 0x3D;
-//const short PC_ADDE = 0x3E;
-//const short PC_ADDI = 0x3F;
-//const short PC_ADDIC = 0x40;
-//const short PC_ADDICR = 0x41;
-//const short PC_ADDIS = 0x42;
-//const short PC_ADDME = 0x43;
-//const short PC_ADDZE = 0x44;
-//const short PC_DIVW = 0x45;
-//const short PC_DIVWU = 0x46;
-//const short PC_MULHW = 0x47;
-//const short PC_MULHWU = 0x48;
-//const short PC_MULLI = 0x49;
-//const short PC_MULLW = 0x4A;
-//const short PC_NEG = 0x4B;
-//const short PC_SUBF = 0x4C;
-//const short PC_SUBFC = 0x4D;
-//const short PC_SUBFE = 0x4E;
-//const short PC_SUBFIC = 0x4F;
-//const short PC_SUBFME = 0x50;
-//const short PC_SUBFZE = 0x51;
-//const short PC_CMPI = 0x52;
-//const short PC_CMP = 0x53;
-//const short PC_CMPLI = 0x54;
-//const short PC_CMPL = 0x55;
-//const short PC_ANDI = 0x56;
-//const short PC_ANDIS = 0x57;
-//const short PC_ORI = 0x58;
-//const short PC_ORIS = 0x59;
-//const short PC_XORI = 0x5A;
-//const short PC_XORIS = 0x5B;
-//const short PC_AND = 0x5C;
-//const short PC_OR = 0x5D;
-//const short PC_XOR = 0x5E;
-//const short PC_NAND = 0x5F;
-//const short PC_NOR = 0x60;
-//const short PC_EQV = 0x61;
-//const short PC_ANDC = 0x62;
-//const short PC_ORC = 0x63;
-//const short PC_EXTSB = 0x64;
-//const short PC_EXTSH = 0x65;
-//const short PC_CNTLZW = 0x66;
-//const short PC_RLWINM = 0x67;
-//const short PC_RLWNM = 0x68;
-//const short PC_RLWIMI = 0x69;
-//const short PC_SLW = 0x6A;
-//const short PC_SRW = 0x6B;
-//const short PC_SRAWI = 0x6C;
-//const short PC_SRAW = 0x6D;
-//const short PC_CRAND = 0x6E;
-//const short PC_CRANDC = 0x6F;
-//const short PC_CREQV = 0x70;
-//const short PC_CRNAND = 0x71;
-//const short PC_CRNOR = 0x72;
-//const short PC_CROR = 0x73;
-//const short PC_CRORC = 0x74;
-//const short PC_CRXOR = 0x75;
-//const short PC_MCRF = 0x76;
-//const short PC_MTXER = 0x77;
-//const short PC_MTCTR = 0x78;
-//const short PC_MTLR = 0x79;
-//const short PC_MTCRF = 0x7A;
-//const short PC_MTMSR = 0x7B;
-//const short PC_MTSPR = 0x7C;
-//const short PC_MFMSR = 0x7D;
-//const short PC_MFSPR = 0x7E;
-//const short PC_MFXER = 0x7F;
-//const short PC_MFCTR = 0x80;
-//const short PC_MFLR = 0x81;
-//const short PC_MFCR = 0x82;
-//const short PC_MFFS = 0x83;
-//const short PC_MTFSF = 0x84;
-//const short PC_EIEIO = 0x85;
-//const short PC_ISYNC = 0x86;
-//const short PC_SYNC = 0x87;
-//const short PC_RFI = 0x88;
-//const short PC_LI = 0x89;
-//const short PC_LIS = 0x8A;
-//const short PC_MR = 0x8B;
-//const short PC_NOP = 0x8C;
-//const short PC_NOT = 0x8D;
-//const short PC_LFS = 0x8E;
-//const short PC_LFSU = 0x8F;
-//const short PC_LFSX = 0x90;
-//const short PC_LFSUX = 0x91;
-//const short PC_LFD = 0x92;
-//const short PC_LFDU = 0x93;
-//const short PC_LFDX = 0x94;
-//const short PC_LFDUX = 0x95;
-//const short PC_STFS = 0x96;
-//const short PC_STFSU = 0x97;
-//const short PC_STFSX = 0x98;
-//const short PC_STFSUX = 0x99;
-//const short PC_STFD = 0x9A;
-//const short PC_STFDU = 0x9B;
-//const short PC_STFDX = 0x9C;
-//const short PC_STFDUX = 0x9D;
-//const short PC_FMR = 0x9E;
-//const short PC_FABS = 0x9F;
-//const short PC_FNEG = 0xA0;
-//const short PC_FNABS = 0xA1;
-//const short PC_FADD = 0xA2;
-//const short PC_FADDS = 0xA3;
-//const short PC_FSUB = 0xA4;
-//const short PC_FSUBS = 0xA5;
-//const short PC_FMUL = 0xA6;
-//const short PC_FMULS = 0xA7;
-//const short PC_FDIV = 0xA8;
-//const short PC_FDIVS = 0xA9;
-//const short PC_FMADD = 0xAA;
-//const short PC_FMADDS = 0xAB;
-//const short PC_FMSUB = 0xAC;
-//const short PC_FMSUBS = 0xAD;
-//const short PC_FNMADD = 0xAE;
-//const short PC_FNMADDS = 0xAF;
-//const short PC_FNMSUB = 0xB0;
-//const short PC_FNMSUBS = 0xB1;
-//const short PC_FRES = 0xB2;
-//const short PC_FRSQRTE = 0xB3;
-//const short PC_FSEL = 0xB4;
-//const short PC_FRSP = 0xB5;
-//const short PC_FCTIW = 0xB6;
-//const short PC_FCTIWZ = 0xB7;
-//const short PC_FCMPU = 0xB8;
-//const short PC_FCMPO = 0xB9;
-//const short PC_LWARX = 0xBA;
-//const short PC_LSWI = 0xBB;
-//const short PC_LSWX = 0xBC;
-//const short PC_STFIWX = 0xBD;
-//const short PC_STSWI = 0xBE;
-//const short PC_STSWX = 0xBF;
-//const short PC_STWCX = 0xC0;
-//const short PC_ECIWX = 0xC1;
-//const short PC_ECOWX = 0xC2;
-//const short PC_DCBI = 0xC3;
-//const short PC_ICBI = 0xC4;
-//const short PC_MCRFS = 0xC5;
-//const short PC_MCRXR = 0xC6;
-//const short PC_MFTB = 0xC7;
-//const short PC_MFSR = 0xC8;
-//const short PC_MTSR = 0xC9;
-//const short PC_MFSRIN = 0xCA;
-//const short PC_MTSRIN = 0xCB;
-//const short PC_MTFSB0 = 0xCC;
-//const short PC_MTFSB1 = 0xCD;
-//const short PC_MTFSFI = 0xCE;
-//const short PC_SC = 0xCF;
-//const short PC_FSQRT = 0xD0;
-//const short PC_FSQRTS = 0xD1;
-//const short PC_TLBIA = 0xD2;
-//const short PC_TLBIE = 0xD3;
-//const short PC_TLBLD = 0xD4;
-//const short PC_TLBLI = 0xD5;
-//const short PC_TLBSYNC = 0xD6;
-//const short PC_TW = 0xD7;
-//const short PC_TRAP = 0xD8;
-//const short PC_TWI = 0xD9;
-//const short PC_OPWORD = 0xDA;
-//const short PC_MFROM = 0xDB;
-//const short PC_DSA = 0xDC;
-//const short PC_ESA = 0xDD;
-//const short PC_DCCCI = 0xDE;
-//const short PC_DCREAD = 0xDF;
-//const short PC_ICBT = 0xE0;
-//const short PC_ICCCI = 0xE1;
-//const short PC_ICREAD = 0xE2;
-//const short PC_RFCI = 0xE3;
-//const short PC_TLBRE = 0xE4;
-//const short PC_TLBSX = 0xE5;
-//const short PC_TLBWE = 0xE6;
-//const short PC_WRTEE = 0xE7;
-//const short PC_WRTEEI = 0xE8;
-//const short PC_MFDCR = 0xE9;
-//const short PC_MTDCR = 0xEA;
-//const short PC_DCBA = 0xEB;
-//const short PC_DSS = 0xEC;
-//const short PC_DSSALL = 0xED;
-//const short PC_DST = 0xEE;
-//const short PC_DSTT = 0xEF;
-//const short PC_DSTST = 0xF0;
-//const short PC_DSTSTT = 0xF1;
-//const short PC_LVEBX = 0xF2;
-//const short PC_LVEHX = 0xF3;
-//const short PC_LVEWX = 0xF4;
-//const short PC_LVSL = 0xF5;
-//const short PC_LVSR = 0xF6;
-//const short PC_LVX = 0xF7;
-//const short PC_LVXL = 0xF8;
-//const short PC_STVEBX = 0xF9;
-//const short PC_STVEHX = 0xFA;
-//const short PC_STVEWX = 0xFB;
-//const short PC_STVX = 0xFC;
-//const short PC_STVXL = 0xFD;
-//const short PC_MFVSCR = 0xFE;
-//const short PC_MTVSCR = 0xFF;
-//const short PC_VADDCUW = 0x100;
-//const short PC_VADDFP = 0x101;
-//const short PC_VADDSBS = 0x102;
-//const short PC_VADDSHS = 0x103;
-//const short PC_VADDSWS = 0x104;
-//const short PC_VADDUBM = 0x105;
-//const short PC_VADDUBS = 0x106;
-//const short PC_VADDUHM = 0x107;
-//const short PC_VADDUHS = 0x108;
-//const short PC_VADDUWM = 0x109;
-//const short PC_VADDUWS = 0x10A;
-//const short PC_VAND = 0x10B;
-//const short PC_VANDC = 0x10C;
-//const short PC_VAVGSB = 0x10D;
-//const short PC_VAVGSH = 0x10E;
-//const short PC_VAVGSW = 0x10F;
-//const short PC_VAVGUB = 0x110;
-//const short PC_VAVGUH = 0x111;
-//const short PC_VAVGUW = 0x112;
-//const short PC_VCFSX = 0x113;
-//const short PC_VCFUX = 0x114;
-//const short PC_VCMPBFP = 0x115;
-//const short PC_VCMPEQFP = 0x116;
-//const short PC_VCMPEQUB = 0x117;
-//const short PC_VCMPEQUH = 0x118;
-//const short PC_VCMPEQUW = 0x119;
-//const short PC_VCMPGEFP = 0x11A;
-//const short PC_VCMPGTFP = 0x11B;
-//const short PC_VCMPGTSB = 0x11C;
-//const short PC_VCMPGTSH = 0x11D;
-//const short PC_VCMPGTSW = 0x11E;
-//const short PC_VCMPGTUB = 0x11F;
-//const short PC_VCMPGTUH = 0x120;
-//const short PC_VCMPGTUW = 0x121;
-//const short PC_VCTSXS = 0x122;
-//const short PC_VCTUXS = 0x123;
-//const short PC_VEXPTEFP = 0x124;
-//const short PC_VLOGEFP = 0x125;
-//const short PC_VMAXFP = 0x126;
-//const short PC_VMAXSB = 0x127;
-//const short PC_VMAXSH = 0x128;
-//const short PC_VMAXSW = 0x129;
-//const short PC_VMAXUB = 0x12A;
-//const short PC_VMAXUH = 0x12B;
-//const short PC_VMAXUW = 0x12C;
-//const short PC_VMINFP = 0x12D;
-//const short PC_VMINSB = 0x12E;
-//const short PC_VMINSH = 0x12F;
-//const short PC_VMINSW = 0x130;
-//const short PC_VMINUB = 0x131;
-//const short PC_VMINUH = 0x132;
-//const short PC_VMINUW = 0x133;
-//const short PC_VMRGHB = 0x134;
-//const short PC_VMRGHH = 0x135;
-//const short PC_VMRGHW = 0x136;
-//const short PC_VMRGLB = 0x137;
-//const short PC_VMRGLH = 0x138;
-//const short PC_VMRGLW = 0x139;
-//const short PC_VMULESB = 0x13A;
-//const short PC_VMULESH = 0x13B;
-//const short PC_VMULEUB = 0x13C;
-//const short PC_VMULEUH = 0x13D;
-//const short PC_VMULOSB = 0x13E;
-//const short PC_VMULOSH = 0x13F;
-//const short PC_VMULOUB = 0x140;
-//const short PC_VMULOUH = 0x141;
-//const short PC_VNOR = 0x142;
-//const short PC_VOR = 0x143;
-//const short PC_VPKPX = 0x144;
-//const short PC_VPKSHSS = 0x145;
-//const short PC_VPKSHUS = 0x146;
-//const short PC_VPKSWSS = 0x147;
-//const short PC_VPKSWUS = 0x148;
-//const short PC_VPKUHUM = 0x149;
-//const short PC_VPKUHUS = 0x14A;
-//const short PC_VPKUWUM = 0x14B;
-//const short PC_VPKUWUS = 0x14C;
-//const short PC_VREFP = 0x14D;
-//const short PC_VRFIM = 0x14E;
-//const short PC_VRFIN = 0x14F;
-//const short PC_VRFIP = 0x150;
-//const short PC_VRFIZ = 0x151;
-//const short PC_VRLB = 0x152;
-//const short PC_VRLH = 0x153;
-//const short PC_VRLW = 0x154;
-//const short PC_VRSQRTEFP = 0x155;
-//const short PC_VSL = 0x156;
-//const short PC_VSLB = 0x157;
-//const short PC_VSLH = 0x158;
-//const short PC_VSLO = 0x159;
-//const short PC_VSLW = 0x15A;
-//const short PC_VSPLTB = 0x15B;
-//const short PC_VSPLTH = 0x15C;
-//const short PC_VSPLTW = 0x15D;
-//const short PC_VSPLTISB = 0x15E;
-//const short PC_VSPLTISH = 0x15F;
-//const short PC_VSPLTISW = 0x160;
-//const short PC_VSR = 0x161;
-//const short PC_VSRAB = 0x162;
-//const short PC_VSRAH = 0x163;
-//const short PC_VSRAW = 0x164;
-//const short PC_VSRB = 0x165;
-//const short PC_VSRH = 0x166;
-//const short PC_VSRO = 0x167;
-//const short PC_VSRW = 0x168;
-//const short PC_VSUBCUW = 0x169;
-//const short PC_VSUBFP = 0x16A;
-//const short PC_VSUBSBS = 0x16B;
-//const short PC_VSUBSHS = 0x16C;
-//const short PC_VSUBSWS = 0x16D;
-//const short PC_VSUBUBM = 0x16E;
-//const short PC_VSUBUBS = 0x16F;
-//const short PC_VSUBUHM = 0x170;
-//const short PC_VSUBUHS = 0x171;
-//const short PC_VSUBUWM = 0x172;
-//const short PC_VSUBUWS = 0x173;
-//const short PC_VSUMSWS = 0x174;
-//const short PC_VSUM2SWS = 0x175;
-//const short PC_VSUM4SBS = 0x176;
-//const short PC_VSUM4SHS = 0x177;
-//const short PC_VSUM4UBS = 0x178;
-//const short PC_VUPKHPX = 0x179;
-//const short PC_VUPKHSB = 0x17A;
-//const short PC_VUPKHSH = 0x17B;
-//const short PC_VUPKLPX = 0x17C;
-//const short PC_VUPKLSB = 0x17D;
-//const short PC_VUPKLSH = 0x17E;
-//const short PC_VXOR = 0x17F;
-//const short PC_VMADDFP = 0x180;
-//const short PC_VMHADDSHS = 0x181;
-//const short PC_VMHRADDSHS = 0x182;
-//const short PC_VMLADDUHM = 0x183;
-//const short PC_VMSUMMBM = 0x184;
-//const short PC_VMSUMSHM = 0x185;
-//const short PC_VMSUMSHS = 0x186;
-//const short PC_VMSUMUBM = 0x187;
-//const short PC_VMSUMUHM = 0x188;
-//const short PC_VMSUMUHS = 0x189;
-//const short PC_VNMSUBFP = 0x18A;
-//const short PC_VPERM = 0x18B;
-//const short PC_VSEL = 0x18C;
-//const short PC_VSLDOI = 0x18D;
-//const short PC_VMR = 0x18E;
-//const short PC_VMRP = 0x18F;
-//const short PC_SLE = 0x190;
-//const short PC_SLEQ = 0x191;
-//const short PC_SLIQ = 0x192;
-//const short PC_SLLIQ = 0x193;
-//const short PC_SLLQ = 0x194;
-//const short PC_SLQ = 0x195;
-//const short PC_SRAIQ = 0x196;
-//const short PC_SRAQ = 0x197;
-//const short PC_SRE = 0x198;
-//const short PC_SREA = 0x199;
-//const short PC_SREQ = 0x19A;
-//const short PC_SRIQ = 0x19B;
-//const short PC_SRLIQ = 0x19C;
-//const short PC_SRLQ = 0x19D;
-//const short PC_SRQ = 0x19E;
-//const short PC_MASKG = 0x19F;
-//const short PC_MASKIR = 0x1A0;
-//const short PC_LSCBX = 0x1A1;
-//const short PC_DIV = 0x1A2;
-//const short PC_DIVS = 0x1A3;
-//const short PC_DOZ = 0x1A4;
-//const short PC_MUL = 0x1A5;
-//const short PC_NABS = 0x1A6;
-//const short PC_ABS = 0x1A7;
-//const short PC_CLCS = 0x1A8;
-//const short PC_DOZI = 0x1A9;
-//const short PC_RLMI = 0x1AA;
-//const short PC_RRIB = 0x1AB;
-//const short PC_PENTRY = 0x1AC;
-//const short PC_PEXIT = 0x1AD;
-//const short OPCODE_MAX = 0x1AE;
-extern OpcodeInfo opcodeinfo[OPCODE_MAX];
+// this is actually in OpcodeInfo.c
+extern OpcodeInfo opcodeinfo[];
extern void pcode_get_hi_lo(int bits, char typechar, SInt32 *hi, SInt32 *lo);
extern int pcode_check_imm_bits(SInt32 value, int bits, char typechar);
diff --git a/includes/compiler/PCodeListing.h b/includes/compiler/PCodeListing.h
index 994fd83..d01222e 100644
--- a/includes/compiler/PCodeListing.h
+++ b/includes/compiler/PCodeListing.h
@@ -5,34 +5,34 @@
extern int pclist_bad_operand;
-extern void pcinitlisting(void);
+extern void pcinitlisting(/* unknown args */);
extern void pccleanuplisting(void);
extern void pclistblocks(char *name1, char *name2);
-extern void pclistdataflow(void);
+extern void pclistdataflow(/* unknown args */);
extern void pclistinterferences(char *class_format, int regcount);
-extern void pclistspill(void);
-extern void pclistcopypropitem(void);
-extern void pclistcoalesce(void);
-extern void pclistusedefs(void);
-extern void pclistpropinfo(void);
-extern void pclistloops(void);
-extern void pclistswitchtables(void);
-extern void pclistdominators(void);
-extern void pclistbackedge(void);
-extern void pclistinterferencegraphnode(void);
-extern void pclistinterferencegraph(void);
-extern void pclistblock_scheduler(void);
+extern void pclistspill(/* unknown args */);
+extern void pclistcopypropitem(/* unknown args */);
+extern void pclistcoalesce(/* unknown args */);
+extern void pclistusedefs(/* unknown args */);
+extern void pclistpropinfo(/* unknown args */);
+extern void pclistloops(/* unknown args */);
+extern void pclistswitchtables(/* unknown args */);
+extern void pclistdominators(/* unknown args */);
+extern void pclistbackedge(/* unknown args */);
+extern void pclistinterferencegraphnode(/* unknown args */);
+extern void pclistinterferencegraph(/* unknown args */);
+extern void pclistblock_scheduler(/* unknown args */);
extern void pclistblocks_start_scheduler(char *str1, char *str2);
extern void pclistblocks_end_scheduler(void);
-extern void pctotalheap(void);
-extern void pctotalmemory(void);
+extern void pctotalheap(/* unknown args */);
+extern void pctotalmemory(/* unknown args */);
extern void pcmessage(char *probably_a_string, ...);
extern int formatalias(Alias *alias, char *buf, int bufSize);
extern int dumpalias(Alias *alias, int len, Boolean flag1, Boolean flag2);
-extern void pcformatset(void);
+extern void pcformatset(/* unknown args */);
extern int GetLineEndOffset(char *str, int lineNum, int len);
extern int GetLineOffset(char *str, int lineNum, int len);
-extern void DumpSourceCode(void);
-extern int DumpIR_SrcBreak(void);
+extern void DumpSourceCode(/* unknown args */);
+extern int DumpIR_SrcBreak(/* unknown args */);
#endif
diff --git a/includes/compiler/common.h b/includes/compiler/common.h
index 5eefd2c..0b8aaa7 100644
--- a/includes/compiler/common.h
+++ b/includes/compiler/common.h
@@ -187,7 +187,7 @@ typedef struct TemplInstance TemplInstance;
typedef struct TemplParam TemplParam;
typedef struct TemplPartialSpec TemplPartialSpec;
typedef struct TemplStack TemplStack;
-typedef struct TStream TStream;
+typedef struct TokenStream TokenStream;
typedef struct TStreamElement TStreamElement;
typedef struct Type Type;
typedef struct TypeBitfield TypeBitfield;
diff --git a/includes/compiler/objects.h b/includes/compiler/objects.h
index 52bbf36..2209dee 100644
--- a/includes/compiler/objects.h
+++ b/includes/compiler/objects.h
@@ -188,7 +188,7 @@ struct ObjectTemplated {
};
enum {
- OBJECT_FLAGS_UNUSED = 1,
+ OBJECT_FLAGS_1 = 1,
OBJECT_FLAGS_2 = 2,
OBJECT_FLAGS_4 = 4,
OBJECT_FLAGS_8 = 8,
diff --git a/includes/compiler/templates.h b/includes/compiler/templates.h
index 8fe5c46..14f60b6 100644
--- a/includes/compiler/templates.h
+++ b/includes/compiler/templates.h
@@ -31,7 +31,7 @@ struct Template {
struct TemplateFriend { // verified via CPrec
PackedDeclInfo decl;
FileOffsetInfo fileoffset;
- TStream stream;
+ TokenStream stream;
};
struct TemplateMember { // verified via CPrec
@@ -39,7 +39,7 @@ struct TemplateMember { // verified via CPrec
TemplParam *params;
Object *object;
FileOffsetInfo fileoffset;
- TStream stream;
+ TokenStream stream;
CPrepFileInfo *srcfile;
SInt32 startoffset;
SInt32 endoffset;
@@ -191,7 +191,7 @@ struct TemplateFunction { // verified via CPrec
TemplateFunction *unk4; // parent?
HashNameNode *name;
TemplParam *params;
- TStream stream;
+ TokenStream stream;
TStreamElement deftoken;
Object *tfunc;
TemplFuncInstance *instances;
diff --git a/includes/compiler/tokens.h b/includes/compiler/tokens.h
index 43c2e85..4230194 100644
--- a/includes/compiler/tokens.h
+++ b/includes/compiler/tokens.h
@@ -7,19 +7,20 @@
#pragma options align=mac68k
#endif
-#define TKD_OPERATOR 328
-#define TKD_TEMPLATE 332
-#define TKD_IDENTIFIER -3
-#define TKD_COLON_COLON 372
-
typedef enum EToken {
TK_INTCONST = -1,
TK_FLOATCONST = -2,
TK_IDENTIFIER = -3,
TK_STRING = -4,
TK_STRING_WIDE = -5,
- TK_NEG6 = -6,
- TK_NEG7 = -7,
+ TK_ILLEGAL = -6,
+ TK_EOL = -7,
+ TK_END = 0,
+ TK_MACRO_ARG_1 = 1,
+ TK_MACRO_ARG_2 = 2,
+ TK_MACRO_ARG_HASH = 3, // #something, followed by the arg index
+ TK_4 = 4,
+ TK_5 = 5,
TK_AUTO = 256,
TK_REGISTER,
TK_STATIC,
@@ -180,8 +181,7 @@ struct TStreamElement {
TData data;
};
-// this is actually called TokenStream
-struct TStream {
+struct TokenStream {
SInt32 tokens;
TStreamElement *firsttoken;
};
diff --git a/includes/compiler/types.h b/includes/compiler/types.h
index 4d6e16e..b1d6c73 100644
--- a/includes/compiler/types.h
+++ b/includes/compiler/types.h
@@ -96,7 +96,7 @@ struct StructMember {
UInt32 qual;
};
-/*enum {
+enum {
STRUCT_TYPE_STRUCT = 0,
STRUCT_TYPE_UNION = 1,
STRUCT_TYPE_CLASS = 2,
@@ -112,22 +112,22 @@ struct StructMember {
STRUCT_TYPE_C = 12,
STRUCT_TYPE_D = 13,
STRUCT_TYPE_E = 14
-};*/
-const char STRUCT_TYPE_STRUCT = 0;
-const char STRUCT_TYPE_UNION = 1;
-const char STRUCT_TYPE_CLASS = 2;
-const char STRUCT_TYPE_3 = 3;
-const char STRUCT_TYPE_4 = 4;
-const char STRUCT_TYPE_5 = 5;
-const char STRUCT_TYPE_6 = 6;
-const char STRUCT_TYPE_7 = 7;
-const char STRUCT_TYPE_8 = 8;
-const char STRUCT_TYPE_9 = 9;
-const char STRUCT_TYPE_A = 10;
-const char STRUCT_TYPE_B = 11;
-const char STRUCT_TYPE_C = 12;
-const char STRUCT_TYPE_D = 13;
-const char STRUCT_TYPE_E = 14;
+};
+//const char STRUCT_TYPE_STRUCT = 0;
+//const char STRUCT_TYPE_UNION = 1;
+//const char STRUCT_TYPE_CLASS = 2;
+//const char STRUCT_TYPE_3 = 3;
+//const char STRUCT_TYPE_4 = 4;
+//const char STRUCT_TYPE_5 = 5;
+//const char STRUCT_TYPE_6 = 6;
+//const char STRUCT_TYPE_7 = 7;
+//const char STRUCT_TYPE_8 = 8;
+//const char STRUCT_TYPE_9 = 9;
+//const char STRUCT_TYPE_A = 10;
+//const char STRUCT_TYPE_B = 11;
+//const char STRUCT_TYPE_C = 12;
+//const char STRUCT_TYPE_D = 13;
+//const char STRUCT_TYPE_E = 14;
struct ClassList { // checked via CPrec
diff --git a/includes/cos.h b/includes/cos.h
index f49ed63..f9818c3 100644
--- a/includes/cos.h
+++ b/includes/cos.h
@@ -17,9 +17,9 @@ extern char *COS_NewPtr(SInt32 byteCount);
extern char *COS_NewPtrClear(SInt32 byteCount);
extern void COS_FreePtr(char *ptr);
extern void COS_AppendPtrToHandle(char *ptr1, Handle hand2, SInt32 size);
-extern OSErr COS_GetMemErr();
-extern SInt32 COS_GetTicks();
-extern SInt32 COS_GetTime();
+extern OSErr COS_GetMemErr(void);
+extern SInt32 COS_GetTicks(void);
+extern SInt32 COS_GetTime(void);
extern void COS_GetString(char *buffer, SInt16 strListID, SInt16 index);
extern void COS_GetPString(StringPtr buffer, SInt16 strListID, SInt16 index);
extern Boolean COS_IsMultiByte(const void *str1, const void *str2);
diff --git a/includes/macemul.h b/includes/macemul.h
index dbc4765..ac52e0a 100644
--- a/includes/macemul.h
+++ b/includes/macemul.h
@@ -51,9 +51,9 @@ extern OSErr Allocate(SInt16 refNum, SInt32 *byteCount);
/********************************/
/* LowMem */
-extern UInt32 LMGetTicks();
-extern UInt32 LMGetTime();
-extern OSErr LMGetMemErr();
+extern UInt32 LMGetTicks(void);
+extern UInt32 LMGetTime(void);
+extern OSErr LMGetMemErr(void);
extern void LMSetMemErr(OSErr value);
/********************************/
@@ -63,7 +63,7 @@ extern Handle OS_CreateMacHandle(OSHandle *h);
extern Handle OS_CreateMacHandleDup(OSHandle *h);
extern void OS_DestroyMacHandle(Handle h, OSHandle *ret);
-extern OSErr MemError();
+extern OSErr MemError(void);
extern Handle NewHandle(SInt32 dataSize);
extern Handle NewHandleClear(UInt32 dataSize);
extern Handle TempNewHandle(UInt32 dataSize, OSErr *resultCode);
@@ -88,12 +88,12 @@ extern Ptr NewPtr(SInt32 dataSize);
extern void DisposePtr(Ptr p);
extern Ptr NewPtrClear(SInt32 dataSize);
extern void DebugStr(ConstStringPtr str);
-extern struct Zone *HandleZone();
-extern struct Zone *ApplicationZone();
+extern struct Zone *HandleZone(void);
+extern struct Zone *ApplicationZone(void);
/********************************/
/* Resources */
-extern Boolean OS_UsingMacResourceForkInfo();
+extern Boolean OS_UsingMacResourceForkInfo(void);
extern void OS_UseMacResourceForkInfo(Boolean which);
extern OSErr SystemInitResources(OSSpec *spec);
extern void OS_AddMacResourceForkRef(int ref, const OSSpec *spec);
@@ -106,13 +106,13 @@ extern void OS_CleanupMacResourceForkDir(const OSPathSpec *dir);
extern OSErr OS_MacDumpResourceFork(SInt16 ref, Boolean dumpContents);
extern OSErr FSpOpenRF(const FSSpec *fss, SInt8 permission, SInt16 *refNum);
extern OSErr HOpenRF(SInt16 vRefNum, SInt32 dirID, ConstStringPtr fileName, SInt8 permission, SInt16 *refNum);
-extern OSErr InitResources();
-extern OSErr ResError();
+extern OSErr InitResources(void);
+extern OSErr ResError(void);
extern void FSpCreateResFile(const FSSpec *fss, OSType creator, OSType fileType, ScriptCode scriptTag);
extern void HCreateResFile(SInt16 vRefNum, SInt32 dirID, ConstStringPtr fileName);
extern OSErr FSpOpenResFile(const FSSpec *spec, SInt8 permission);
extern SInt16 HOpenResFile(SInt16 vRefNum, SInt32 dirID, ConstStringPtr fileName, SInt8 permission);
-extern SInt16 CurResFile();
+extern SInt16 CurResFile(void);
extern void UseResFile(SInt16 refNum);
extern SInt16 HomeResFile(Handle theResource);
extern Handle GetResource(OSType theType, SInt16 theID);
@@ -134,28 +134,28 @@ extern SInt16 CountResources(OSType theType);
extern SInt16 Count1Resources(OSType theType);
extern Handle GetIndResource(OSType theType, SInt16 index);
extern Handle Get1IndResource(OSType theType, SInt16 index);
-extern SInt16 Count1Types();
+extern SInt16 Count1Types(void);
extern void Get1IndType(OSType *theType, SInt16 index);
-extern void ReleaseResource();
+extern void ReleaseResource(Handle theResource);
extern void DetachResource(Handle theResource);
extern void RemoveResource(Handle theResource);
extern void CloseResFile(SInt16 refNum);
extern SInt16 GetResFileAttrs(SInt16);
-extern Boolean LMGetResLoad();
+extern Boolean LMGetResLoad(void);
/********************************/
/* ResourceStrings */
-extern void Res_Initialize();
+extern void Res_Initialize(void);
extern int Res_AddResource(const char *name, SInt16 rsrcid, const char **strings);
extern const char *Res_GetResource(SInt16 rsrcid, SInt16 index);
-extern void Res_Cleanup();
+extern void Res_Cleanup(void);
/********************************/
/* TextUtils */
extern StringPtr c2pstr(char *s);
extern char *p2cstr(StringPtr s);
extern SInt16 CharacterByteType(Ptr textBuf, SInt16 textOffset, ScriptCode script);
-extern SInt16 CharByte();
+extern SInt16 CharByte(void);
extern void GetDateTime(UInt32 *secs);
extern Boolean EqualString(ConstStr255Param strA, ConstStr255Param strB, Boolean caseSens, Boolean diacSens);
extern void GetIndString(Str255 theString, SInt16 strListID, SInt16 index);
diff --git a/includes/mwcc_decomp.h b/includes/mwcc_decomp.h
index a898422..312c858 100644
--- a/includes/mwcc_decomp.h
+++ b/includes/mwcc_decomp.h
@@ -26,35 +26,35 @@ extern OSErr GetMacFileType(const FSSpec *fss, void *a); // TODO sig
extern void GetStaticTarget(OSType *cpu, OSType *os);
extern void GetStaticPluginType(OSType *language, OSType *plugintype);
extern void GetStaticParserPluginType(OSType *style);
-extern int RegisterStaticTargetResources();
-extern int RegisterStaticTargetPlugins();
+extern int RegisterStaticTargetResources(void);
+extern int RegisterStaticTargetPlugins(void);
/********************************/
/* Might be ParserGlue-mach-ppc-cc.c? */
-extern int RegisterStaticParserToolInfo();
+extern int RegisterStaticParserToolInfo(void);
/********************************/
/* Might be cc-mach-ppc.c? */
-extern int RegisterStaticCompilerPlugin();
-extern int RegisterCompilerResources();
+extern int RegisterStaticCompilerPlugin(void);
+extern int RegisterCompilerResources(void);
/********************************/
/* libimp-mach-ppc.c */
// some statics here
-extern int RegisterStaticLibImporterPlugin();
-extern int RegisterLibImporterResources();
+extern int RegisterStaticLibImporterPlugin(void);
+extern int RegisterLibImporterResources(void);
/********************************/
/* TargetOptimizer-ppc-mach.c */
extern int TargetSetOptFlags(SInt16 val, Boolean set);
extern void TargetDisplayOptimizationOptions(Handle txt);
-extern void TargetSetPragmaOptimizationsToUnspecified();
+extern void TargetSetPragmaOptimizationsToUnspecified(void);
/********************************/
/* OptimizerHelpers.c */
-extern int SetPragmaOptimizationsToUnspecified();
+extern int SetPragmaOptimizationsToUnspecified(void);
extern int SetOptFlags(char *opt, void *str, ...); // two unknown args
-extern int DisplayOptimizationOptions();
+extern int DisplayOptimizationOptions(void);
/********************************/
/* Unk name lol */
@@ -64,7 +64,7 @@ extern int TargetDisplayWarningOptions(Handle txt);
/********************************/
/* WarningHelpers.c */
extern int SetWarningFlags(char *opt, void *str, ...); // two unknown args
-extern int DisplayWarningOptions();
+extern int DisplayWarningOptions(void);
/********************************/
/* CCompiler.c */
@@ -74,8 +74,8 @@ extern CWPLUGIN_ENTRY(MWC_main)(CWPluginContext context);
/********************************/
/* StaticParserGlue.c */
-extern int RegisterStaticParserPlugins();
-extern int RegisterStaticParserResources();
+extern int RegisterStaticParserPlugins(void);
+extern int RegisterStaticParserResources(void);
/********************************/
/* CmdLineBuildDate.c */
diff --git a/includes/option_system.h b/includes/option_system.h
index aa519e2..f95f5a9 100644
--- a/includes/option_system.h
+++ b/includes/option_system.h
@@ -326,14 +326,14 @@ extern anon0_50 prelinkargs;
extern anon0_50 postlinkargs;
extern void Arg_Init(int theargc, char **theargv);
-extern void Arg_Terminate();
-extern void Arg_Reset();
+extern void Arg_Terminate(void);
+extern void Arg_Reset(void);
extern void Arg_Stop(ArgToken *where);
-extern ArgToken *Arg_PeekToken();
-extern ArgToken *Arg_UsedToken();
-extern int Arg_IsEmpty();
-extern ArgToken *Arg_GetToken();
-extern ArgToken *Arg_UndoToken();
+extern ArgToken *Arg_PeekToken(void);
+extern ArgToken *Arg_UsedToken(void);
+extern int Arg_IsEmpty(void);
+extern ArgToken *Arg_GetToken(void);
+extern ArgToken *Arg_UndoToken(void);
extern const char *Arg_GetTokenName(ArgToken *tok);
extern const char *Arg_GetTokenText(ArgToken *tok, char *buffer, int maxlen, unsigned char warn);
extern void Arg_InitToolArgs(anon0_50 *ta);
@@ -364,19 +364,19 @@ typedef struct {
extern char curopt[1024];
-extern void Args_InitStack();
-extern int Args_StackSize();
+extern void Args_InitStack(void);
+extern int Args_StackSize(void);
extern void Args_Push(SInt16 flags, void *first, void *second);
extern Opt48 *Args_Pop(SInt16 flags);
extern void Args_SpellStack(char *buffer, SInt16 flags);
extern void Args_AddToToolArgs(anon0_50 *ta);
-extern void Options_Init();
-extern OptionList *Options_GetOptions();
-extern void Options_SortOptions();
+extern void Options_Init(void);
+extern OptionList *Options_GetOptions(void);
+extern void Options_SortOptions(void);
extern int Options_AddList(OptionList *optlst);
extern int Options_AddLists(OptionList **optlst);
extern int Option_ForTool(Option *opt, int which);
-extern int Option_ThisTool();
+extern int Option_ThisTool(void);
extern int Option_ForThisTool(Option *opt);
extern int Option_AlsoPassedToTool(Option *opt, int which);
extern int Option_AlsoPassedFromThisTool(Option *opt);
@@ -391,7 +391,7 @@ extern void Option_Error(SInt16 id, ...);
extern void Option_Warning(SInt16 id, ...);
extern int Options_Help(const char *keyword);
extern int Option_Help(const char *opt);
-extern int Options_DisplayHelp();
+extern int Options_DisplayHelp(void);
/********************************/
/* Parameter.c */
@@ -407,11 +407,11 @@ extern void Param_Warning(SInt16 id, ...);
/* Help.c */
extern int Help_Option(OptionList *lst, Option *opt, int subprint, const char *keyword);
extern void Help_Options(OptionList *lst, int subprint, const char *keyword);
-extern void Help_Usage();
-extern void Help_Null();
-extern void Help_Init();
+extern void Help_Usage(void);
+extern void Help_Null(void);
+extern void Help_Init(void);
extern void Help_Line(char ch);
-extern void Help_Term();
+extern void Help_Term(void);
#ifdef __cplusplus
}
diff --git a/includes/oslib.h b/includes/oslib.h
index 4de46e9..d5be38e 100644
--- a/includes/oslib.h
+++ b/includes/oslib.h
@@ -110,7 +110,7 @@ extern int OS_AppendHandle(OSHandle *hand, const void *data, UInt32 len);
extern uOSTypePair OS_TEXTTYPE;
extern const char *OS_GetErrText(int err);
extern int OS_InitProgram(int *pArgc, char ***pArgv);
-extern int OS_TermProgram();
+extern int OS_TermProgram(void);
extern int OS_Create(const OSSpec *spec, const uOSTypePair *type);
extern int OS_Status(const OSSpec *spec);
extern int OS_GetFileType(const OSSpec *spec, uOSTypePair *type);
@@ -157,7 +157,7 @@ extern int OS_ResolveLink(const OSSpec *link, OSSpec *target);
extern int OS_OpenDir(const OSPathSpec *spec, OSOpenedDir *ref);
extern int OS_ReadDir(OSOpenedDir *ref, OSSpec *spec, char *filename, Boolean *isfile);
extern int OS_CloseDir(OSOpenedDir *ref);
-extern UInt32 OS_GetMilliseconds();
+extern UInt32 OS_GetMilliseconds(void);
extern void OS_GetTime(time_t *p);
extern int OS_NewHandle(UInt32 size, OSHandle *hand);
extern int OS_ResizeHandle(OSHandle *hand, UInt32 size);
diff --git a/includes/parser.h b/includes/parser.h
index ae28fee..92e4504 100644
--- a/includes/parser.h
+++ b/includes/parser.h
@@ -125,9 +125,9 @@ typedef struct {
OptionList **optionLists;
int numPrefDataPanels;
PrefDataPanel *prefDataPanels;
- int (*PreParse)();
- int (*MidParse)();
- int (*PostParse)();
+ int (*PreParse)(void);
+ int (*MidParse)(void);
+ int (*PostParse)(void);
} ParserTool; // assumed name
typedef struct {
@@ -184,7 +184,7 @@ extern Pragma irPragmas[];
extern int SetPragmaOptimizationsToUnspecified(const char *opt, void *, const char *, int);
extern int SetOptFlags(const char *opt, void *str, const char *, int flags);
-extern int DisplayOptimizationOptions();
+extern int DisplayOptimizationOptions(const char *, void *, const char *, int);
/********************************/
/* ParserErrors.c */
@@ -281,12 +281,12 @@ extern int SetupPragmas(const Pragma *pragmas);
/********************************/
/* Projects.c */
-extern int GetFileCount();
+extern int GetFileCount(void);
extern void SetFileOutputName(SInt32 position, SInt16 which, char *outfilename);
extern int AddFileToProject(OSSpec *oss, SInt16 which, char *outfilename, Boolean exists, SInt32 position);
extern Boolean GetFileInfo(SInt32 position, OSSpec *spec, char *plugin);
extern int AddAccessPath(OSPathSpec *oss, SInt16 type, SInt32 position, Boolean recursive);
-extern int MoveSystemPathsIntoUserList();
+extern int MoveSystemPathsIntoUserList(void);
extern void AddVirtualFile(const char *filename, Handle *text);
extern void GetOutputFileDirectory(OSPathSpec *dir);
extern void SetOutputFileDirectory(OSPathSpec *dir);
@@ -302,7 +302,7 @@ extern char schedule_ppc_default;
extern int TargetSetOptFlags(short val, Boolean set);
extern void TargetDisplayOptimizationOptions(Handle txt);
-extern void TargetSetPragmaOptimizationsToUnspecified();
+extern void TargetSetPragmaOptimizationsToUnspecified(void);
/********************************/
/* TargetWarningHelpers-ppc-cc.c */
@@ -318,7 +318,7 @@ extern ParserTool *pTool;
extern int SetParserToolInfo(ParserTool *tool);
extern Boolean ParserToolMatchesPlugin(OSType type, OSType lang, OSType cpu, OSType os);
extern Boolean ParserToolHandlesPanels(int numPanels, const char **panelNames);
-extern Boolean SetupParserToolOptions();
+extern Boolean SetupParserToolOptions(void);
/********************************/
/* ToolHelpers.c */
@@ -348,7 +348,7 @@ extern int Opt_RedirectStream(const char *opt, void *file, const char *filename)
/* ToolHelpers-cc.c */
extern int Opt_DummyLinkerRoutine(const char *opt, void *, const char *, int);
extern int Opt_DummyLinkerSettingRoutine(const char *var, const char *val);
-extern void FinishCompilerTool();
+extern void FinishCompilerTool(void);
/********************************/
/* Utils.c */
@@ -363,7 +363,7 @@ extern int Utils_CompareOptionString(const char *a, const char *b, int cased, in
/********************************/
/* WarningHelpers.c */
extern int SetWarningFlags(const char *opt, void *str, const char *, int flags);
-extern int DisplayWarningOptions();
+extern int DisplayWarningOptions(const char *, void *, const char *, int);
#ifdef __cplusplus
extern "C" }
diff --git a/includes/pref_structs.h b/includes/pref_structs.h
index ee016b6..3b34b7e 100644
--- a/includes/pref_structs.h
+++ b/includes/pref_structs.h
@@ -70,6 +70,17 @@ typedef struct PCmdLineLinker {
Boolean callLinker;
} PCmdLineLinker;
+typedef enum {
+ PrefCPU_Generic,
+ PrefCPU_601,
+ PrefCPU_603,
+ PrefCPU_603e,
+ PrefCPU_604,
+ PrefCPU_604e,
+ PrefCPU_750,
+ PrefCPU_Altivec
+} PrefCPU;
+
typedef struct PBackEnd {
SInt16 version;
UInt8 structalignment;
@@ -241,11 +252,11 @@ typedef struct PGlobalOptimizer {
// assumed name/symbols for this one
typedef struct PExtraWarningC {
- Boolean warn_largeargs;
- Boolean warn_padding;
- Boolean warn_resultnotused;
- Boolean warn_ptr_int_conv;
- Boolean warn_no_side_effect;
+ UInt8 warn_largeargs;
+ UInt8 warn_padding;
+ UInt8 warn_resultnotused;
+ UInt8 warn_ptr_int_conv;
+ UInt8 warn_no_side_effect;
} PExtraWarningC;
#ifdef __MWERKS__