#include "abend.h"
#include "chartype.h"
#include "cmdline.h"
+#include "debugflag.h"
#include "fname.h"
#include "print.h"
+#include "segnames.h"
#include "target.h"
#include "tgttrans.h"
#include "version.h"
" --help\t\tHelp (this text)\n"
" --include-dir dir\tSet an include directory search path\n"
" --list-opt-steps\tList all optimizer steps and exit\n"
+ " --register-space b\tSet space available for register variables\n"
" --register-vars\tEnable register variables\n"
" --rodata-name seg\tSet the name of the RODATA segment\n"
" --signed-chars\tDefault characters are signed\n"
static void OptDebug (const char* Opt attribute ((unused)),
- const char* Arg attribute ((unused)))
+ const char* Arg attribute ((unused)))
/* Compiler debug mode */
{
- Debug = 1;
+ ++Debug;
}
-static void OptRegisterVars (const char* Opt attribute ((unused)),
+static void OptRegisterSpace (const char* Opt, const char* Arg)
+/* Handle the --register-space option */
+{
+ /* Numeric argument expected */
+ if (sscanf (Arg, "%u", &RegisterSpace) != 1 || RegisterSpace > 256) {
+ AbEnd ("Argument for option %s is invalid", Opt);
+ }
+}
+
+
+
+static void OptRegisterVars (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Handle the --register-vars option */
{
{ "--help", 0, OptHelp },
{ "--include-dir", 1, OptIncludeDir },
{ "--list-opt-steps", 0, OptListOptSteps },
+ { "--register-space", 1, OptRegisterSpace },
{ "--register-vars", 0, OptRegisterVars },
{ "--rodata-name", 1, OptRodataName },
{ "--signed-chars", 0, OptSignedChars },