Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sven-Bodo Scholz
sac2c
Commits
dc5b44fe
Commit
dc5b44fe
authored
3 years ago
by
Hans-Nikolai Viessmann
Browse files
Options
Download
Plain Diff
Merge branch 'less-verbose-help' into 'develop'
changed -h; added -help See merge request
sac-group/sac2c!148
parents
56d300f3
c01f6eed
develop
NTC_INFOCHN-improvements
WLF-DBUG-output-improvement
alwyn-fold-traversal
bodo-subsel
cinterface-improvement-sbs
cinterface-improvement-sbs-rebase
error-streamlining
fix-cmake-distmem-sbs
fixing-structs
fp16
gijs-fold-suballoc
hotfix-1288
hotfix-2266
hotfix-2287
hotfix-2318
hotfix-2319
hotfix-2337
hotfix-2344
hotfix-2434
hotfix-2434-ea
hotfix-2437
hotfix-cc-warnings-check-c
hotfix-mowl-cuknl
keeping-strings-sbs
new_fun_types_charl
one-bit-booleans
opencl-timon
opt-rearrange
plibsac2c-fix
records-reg
records-reg-rebase
revive-cudahybrid
sbs-add-checks-variants-in-sac2crc
sbs-assign-global-objects
sbs-multi-assign
type-extension-shape-relations
v2.0.0-Tintigny
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/libsac2c/global/globals.mac
+2
-0
src/libsac2c/global/globals.mac
src/libsac2c/global/main.c
+2
-2
src/libsac2c/global/main.c
src/libsac2c/global/options.c
+2
-2
src/libsac2c/global/options.c
src/libsac2c/global/phase_options.c
+43
-10
src/libsac2c/global/phase_options.c
src/libsac2c/global/usage.c
+97
-49
src/libsac2c/global/usage.c
with
146 additions
and
63 deletions
+146
-63
src/libsac2c/global/globals.mac
+
2
-
0
View file @
dc5b44fe
...
...
@@ -1056,6 +1056,8 @@ GLOBAL (int, verbose_level, 3, xfree_dummy, )
* Verbosity of compile time output
*/
GLOBAL (bool, verbose_help, FALSE, xfree_dummy, )
GLOBAL (compiler_phase_t, compiler_phase, PH_initial, xfree_dummy, )
/*
* Counter for compilation phases
...
...
This diff is collapsed.
Click to expand it.
src/libsac2c/global/main.c
+
2
-
2
View file @
dc5b44fe
...
...
@@ -70,10 +70,10 @@ SetupCompiler (int argc, char *argv[], tool_t tool, char *toolname)
RSCevaluateConfiguration
();
OPTcheckPostSetupOptions
();
GLOBsetupBackend
();
OPTcheckPostSetupOptions
();
/* For the distributed memory backend
determine the communication library setting. */
if
(
global
.
backend
==
BE_distmem
)
{
...
...
This diff is collapsed.
Click to expand it.
src/libsac2c/global/options.c
+
2
-
2
View file @
dc5b44fe
...
...
@@ -890,8 +890,8 @@ AnalyseCommandlineSac2c (int argc, char *argv[])
* Options starting with hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
*/
ARGS_FLAG
(
"h"
,
global
.
print_help_and_exit
=
TRUE
);
ARGS_FLAG
(
"help"
,
global
.
print_help_and_exit
=
TRUE
);
ARGS_FLAG
(
"h"
,
global
.
print_help_and_exit
=
TRUE
;
global
.
verbose_help
=
FALSE
);
ARGS_FLAG
(
"help"
,
global
.
print_help_and_exit
=
TRUE
;
global
.
verbose_help
=
TRUE
);
/*
* Options starting with iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
...
...
This diff is collapsed.
Click to expand it.
src/libsac2c/global/phase_options.c
+
43
-
10
View file @
dc5b44fe
...
...
@@ -18,6 +18,7 @@
#include
"globals.h"
#include
"memory.h"
#include
"phase_info.h"
#include
"rtspec_modes.h"
#ifdef __cplusplus
static
inline
void
...
...
@@ -604,30 +605,60 @@ PHOinterpretDbugOption (char *option)
#define PHASEname(name) \
cnt += 1; \
printf ("\n %-3s | %-2d", #name, cnt)
;
name_str = #name
;
#define PHASEtext(text)
printf (" : " text "\n")
;
#define PHASEtext(text)
text_str = text
;
#define SUBPHASEname(name) printf (" %-8s", #name);
#define PHASEcond(cond) \
phase_on = cond; \
if (global.verbose_help || phase_on) { \
printf ("\n %-3s | %-2d : %s\n", name_str, cnt, text_str); \
}
#define SUBPHASEname(name) name_str = #name;
#define SUBPHASEtext(text) text_str = text;
#define SUBPHASEtext(text) printf (" : " text "\n");
#define SUBPHASEcond(cond) \
if (global.verbose_help || (phase_on && (cond))) { \
printf (" %-8s : %s\n", name_str, text_str); \
}
#define CYCLEname(name) name_str = #name;
#define CYCLE
name(name) printf (" %-8s", #name)
;
#define CYCLE
text(text) text_str = text
;
#define CYCLEtext(text) printf (" : " text "\n");
#define CYCLEcond(cond) \
cycle_on = cond; \
if (global.verbose_help || (phase_on && cycle_on)) { \
printf (" %-8s : %s\n", name_str, text_str); \
}
#define CYCLEPHASEname(name)
printf (" %-8s",
#name
)
;
#define CYCLEPHASEname(name)
name_str =
#name;
#define CYCLEPHASEtext(text)
printf (" : " text "\n")
;
#define CYCLEPHASEtext(text)
text_str = text
;
#define CYCLEPHASEFUNname(name) printf (" %-8s", #name);
#define CYCLEPHASEcond(cond) \
if (global.verbose_help || (phase_on && cycle_on && (cond))) { \
printf (" %-8s : %s\n", name_str, text_str); \
}
#define CYCLEPHASEFUNname(name) name_str = #name;
#define CYCLEPHASEFUNtext(text) text_str = text;
#define CYCLEPHASEFUNcond(cond) \
if (global.verbose_help || (phase_on && cycle_on && (cond))) { \
printf (" %-8s : %s (fun based)\n", name_str, text_str); \
}
#define CYCLEPHASEFUNtext(text) printf (" : " text " (fun based)\n");
void
PHOprintPhasesSac2c
(
void
)
{
int
cnt
=
0
;
char
*
name_str
,
*
text_str
;
bool
phase_on
,
cycle_on
;
DBUG_ENTER
();
...
...
@@ -640,6 +671,8 @@ void
PHOprintPhasesSac4c
(
void
)
{
int
cnt
=
0
;
char
*
name_str
,
*
text_str
;
bool
phase_on
;
DBUG_ENTER
();
...
...
This diff is collapsed.
Click to expand it.
src/libsac2c/global/usage.c
+
97
-
49
View file @
dc5b44fe
...
...
@@ -36,32 +36,36 @@ PrintDescriptionSac2c (void)
{
DBUG_ENTER
();
printf
(
"
\n\n
DESCRIPTION:
\n\n
"
" The sac2c compiler transforms SAC source code into executable programs
\n
"
" (SAC programs) or into a SAC specific library format (SAC module and
\n
"
" class implementations), respectively.
\n
"
"
\n
"
" The compilation process is performed in 4 separate stages:
\n
"
" 1. sac2c uses any C preprocessor to preprocess the given SAC source;
\n
"
" 2. sac2c itself transforms preprocessed SAC source code into C code;
\n
"
" 3. sac2c uses any C compiler to generate target machine code;
\n
"
" 4. sac2c uses any C linker to create an executable program
\n
"
" or sac2c itself creates a SAC library file.
\n
"
"
\n
"
" When compiling a SAC program, sac2c stores the corresponding
\n
"
" intermediate C code either in the file a.out.c in the current directory
\n
"
" (default) or in the file <file>.c if <file> is specified using the -o
\n
"
" option. Here, any absolute or relative path name may be used.
\n
"
" The executable program is either written to the file a.out or to any
\n
"
" file specified using the -o option.
\n
"
"
\n
"
" However, when compiling a SAC module/class implementation, the
\n
"
" resulting SAC library is stored in the files <mod/class name>.a
\n
"
" and <mod/class name>.so in the current directory.
\n
"
" In this case, the -o option may be used to specify a
\n
"
" different directory but not a different file name.
\n
"
);
if
(
global
.
verbose_help
)
{
printf
(
"
\n\n
DESCRIPTION:
\n\n
"
" The sac2c compiler transforms SAC source code into executable programs
\n
"
" (SAC programs) or into a SAC specific library format (SAC module and
\n
"
" class implementations), respectively.
\n
"
"
\n
"
" The compilation process is performed in 4 separate stages:
\n
"
" 1. sac2c uses any C preprocessor to preprocess the given SAC source;
\n
"
" 2. sac2c itself transforms preprocessed SAC source code into C code;
\n
"
" 3. sac2c uses any C compiler to generate target machine code;
\n
"
" 4. sac2c uses any C linker to create an executable program
\n
"
" or sac2c itself creates a SAC library file.
\n
"
"
\n
"
" When compiling a SAC program, sac2c stores the corresponding
\n
"
" intermediate C code either in the file a.out.c in the current directory
\n
"
" (default) or in the file <file>.c if <file> is specified using the -o
\n
"
" option. Here, any absolute or relative path name may be used.
\n
"
" The executable program is either written to the file a.out or to any
\n
"
" file specified using the -o option.
\n
"
"
\n
"
" However, when compiling a SAC module/class implementation, the
\n
"
" resulting SAC library is stored in the files <mod/class name>.a
\n
"
" and <mod/class name>.so in the current directory.
\n
"
" In this case, the -o option may be used to specify a
\n
"
" different directory but not a different file name.
\n
"
);
}
else
{
printf
(
"
\n\n
DESCRIPTION: sac2c transforms SAC source code into executable programs.
\n
"
);
}
DBUG_RETURN
();
}
...
...
@@ -129,10 +133,19 @@ PrintSpecialOptions (void)
DBUG_ENTER
();
printf
(
"
\n\n
SPECIAL OPTIONS:
\n\n
"
"
\n\n
SPECIAL OPTIONS:
\n\n
"
);
if
(
global
.
verbose_help
)
{
printf
(
" -h Display very condensed helptext.
\n
"
" -help Display this helptext.
\n
"
);
}
else
{
printf
(
" -h Display this helptext.
\n
"
" -help Display this helptext.
\n
"
" -help Display much more helptext.
\n
"
);
}
printf
(
" -copyright Display copyright/disclaimer.
\n
"
" -V Display version identification.
\n
"
" -VV Display verbose version identification.
\n
"
...
...
@@ -145,11 +158,14 @@ PrintSpecialOptions (void)
" will be needed to compile the given file: use/imports,
\n
"
" arguments of linkobj and linkwith pragmas.
\n
"
"
\n
"
" -C <name> Print out a configuration parameter
\n
"
" -C <name> Print out a configuration parameter
\n
"
);
if
(
global
.
verbose_help
)
{
printf
(
"
\n
"
" NOTE:
\n
"
" When called with one of these options, sac2c does not perform
\n
"
" any compilation steps.
\n
"
);
}
DBUG_RETURN
();
}
...
...
@@ -256,8 +272,10 @@ PrintBreakOptions (void)
{
DBUG_ENTER
();
printf
(
"
\n\n
BREAK OPTIONS:
\n\n
"
printf
(
"
\n\n
BREAK OPTIONS:
\n\n
"
);
if
(
global
.
verbose_help
)
{
printf
(
" Break options allow you to stop the compilation process
\n
"
" after a particular phase, subphase or cycle optimisation.
\n
"
" By default the intermediate programm will be printed. You
\n
"
...
...
@@ -273,7 +291,9 @@ PrintBreakOptions (void)
" <format> must be supported by your dot installation,
\n
"
" run
\"
dot -Tv
\"
for a list of available formats.
\n
"
"
\n
"
"
\n
"
);
}
printf
(
" -b<spec> Break after the compilation stage given
\n
"
" by <spec>, where <spec> follows the pattern
\n
"
" <phase>:<subphase>:<cyclephase>:<pass>.
\n
"
...
...
@@ -290,7 +310,9 @@ PrintBreakoptionSpecifierSac2c (void)
{
DBUG_ENTER
();
printf
(
"
\n\n
BREAK OPTION SPECIFIERS:
\n
"
);
printf
(
"
\n\n
BREAK OPTION SPECIFIERS: %s
\n
"
,
(
global
.
verbose_help
?
"(all, including disabled phases)"
:
"(only enabled phases)"
));
PHOprintPhasesSac2c
();
...
...
@@ -343,7 +365,9 @@ PrintOptimisationOptions (void)
" - disable parallel execution of fold-with-loops.
\n
"
" Currently implemented for:
\n
"
" - associative law optimization,
\n
"
" - segmentation and tiling of fold-with-loops.
\n
"
" - segmentation and tiling of fold-with-loops.
\n
"
);
if
(
global
.
verbose_help
)
{
printf
(
"
\n
"
" -noreuse Disable reuse inference in emm.
\n
"
"
\n
"
...
...
@@ -366,23 +390,27 @@ PrintOptimisationOptions (void)
" use optimizations based on index variable extrema;
\n
"
" i.e., the minimum and maximum value that index variables
\n
"
" may take on. This option is deprecated.
\n
"
"
\n
"
"
\n
"
);
}
printf
(
" -no <opt> Disable optimization technique <opt>.
\n
"
"
\n
"
" -do <opt> Enable optimization technique <opt>.
\n
"
"
\n\n
"
" The following optimization techniques are currently supported:
\n
"
"
\n
"
" (A leading * identifies optimization enabled by default.)
\n
"
" (A leading * identifies
enabled
optimization
s, |* indicates
enabled by default.)
\n
"
"
\n
"
);
#define DELAYPHM global.config.use_phm_api
#ifdef PRODUCTION
#define OPTIMIZE(str, abbr, devl, prod, name) \
printf (" %s %-8s%s\n", prod ? "*" : " ", str, name);
printf (" %s%s %-8s%s\n", global.optimize.do ## abbr ? "*" : " ", \
prod ? "|*" : " ", str, name);
#else
#define OPTIMIZE(str, abbr, devl, prod, name) \
printf (" %s %-8s%s\n", devl ? "*" : " ", str, name);
printf (" %s%s %-8s%s\n", global.optimize.do ## abbr ? "*" : " ", \
devl ? "*" : " ", str, name);
#endif
#include
"optimize.mac"
...
...
@@ -1322,18 +1350,34 @@ USGprintUsage ()
switch
(
global
.
tool
)
{
case
TOOL_sac2c
:
PrintDescriptionSac2c
();
PrintFeatureSet
();
if
(
global
.
verbose_help
)
PrintFeatureSet
();
PrintSpecialOptions
();
PrintGeneralOptions
();
#ifndef DBUG_OFF
PrintBreakOptions
();
PrintBreakoptionSpecifierSac2c
();
PrintPrintingOptions
();
PrintTypeInferenceOptions
();
#else
if
(
global
.
verbose_help
)
{
global
.
verbose_help
=
FALSE
;
PrintBreakOptions
();
PrintBreakoptionSpecifierSac2c
();
global
.
verbose_help
=
TRUE
;
}
#endif
if
(
global
.
verbose_help
)
PrintPrintingOptions
();
if
(
global
.
verbose_help
)
PrintTypeInferenceOptions
();
PrintOptimisationOptions
();
PrintMultithreadOptions
();
PrintDistMemOptions
();
PrintMutcOptions
();
PrintBackendOptions
();
if
(
global
.
verbose_help
)
PrintMultithreadOptions
();
if
(
global
.
verbose_help
)
PrintDistMemOptions
();
if
(
global
.
verbose_help
)
PrintMutcOptions
();
if
(
global
.
verbose_help
)
PrintBackendOptions
();
#ifndef DBUG_OFF
PrintDebugOptions
();
PrintFredFishOptions
();
...
...
@@ -1342,8 +1386,10 @@ USGprintUsage ()
PrintRuntimeCheckOptions
();
PrintRuntimeTraceOptions
();
PrintRuntimeProfilingOptions
();
PrintCacheSimulationOptions
();
PrintLibraryOptions
();
if
(
global
.
verbose_help
)
PrintCacheSimulationOptions
();
if
(
global
.
verbose_help
)
PrintLibraryOptions
();
PrintCCompilerOptions
();
PrintCustomisationOptions
();
break
;
...
...
@@ -1366,8 +1412,10 @@ USGprintUsage ()
}
PrintEnvironmentVariables
();
PrintAuthors
();
PrintContact
();
if
(
global
.
verbose_help
)
PrintAuthors
();
if
(
global
.
verbose_help
)
PrintContact
();
printf
(
"
\n\n
"
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help