diff --git a/tools/flang1/flang1exe/ccffinfo.c b/tools/flang1/flang1exe/ccffinfo.c index 8dc157e584a5..e12760a25cbb 100644 --- a/tools/flang1/flang1exe/ccffinfo.c +++ b/tools/flang1/flang1exe/ccffinfo.c @@ -40,7 +40,11 @@ int bu_auto_inline(void); static int anyunits = 0; +#ifdef FLANG_VENDOR +#define BUILD_VENDOR FLANG_VENDOR +#else #define BUILD_VENDOR "flang-compiler" +#endif FIHB fihb = {(FIH *)0, 0, 0, 0, 0, 0, 0}; FIHB ifihb = {(FIH *)0, 0, 0, 0, 0, 0, 0}; /* bottom-up auto-inliner */ diff --git a/tools/flang1/flang1exe/listing.c b/tools/flang1/flang1exe/listing.c index c990f3e84f6c..c14f666c382a 100644 --- a/tools/flang1/flang1exe/listing.c +++ b/tools/flang1/flang1exe/listing.c @@ -116,8 +116,13 @@ list_ln(char *beg, char *txt) if (!lf) return; /* in case error msg written before file * opened */ +#ifdef FLANG_VENDOR + fprintf(lf, "\n\n\n%s%s (Version %8s) %s page %d\n\n", + FLANG_VENDOR, version.lang, version.vsn, gbl.datetime, pgno); +#else fprintf(lf, "\n\n\n%s (Version %8s) %s page %d\n\n", version.lang, version.vsn, gbl.datetime, pgno); +#endif pgno++; pgpos = 6; } diff --git a/tools/flang1/flang1exe/main.c b/tools/flang1/flang1exe/main.c index 7c2272d45edd..28a780064e9f 100644 --- a/tools/flang1/flang1exe/main.c +++ b/tools/flang1/flang1exe/main.c @@ -127,7 +127,11 @@ static char *accel = NULL; /** Product name in debug output */ +#ifdef FLANG_VENDOR +#define DNAME FLANG_VENDOR "F90" +#else #define DNAME "F90" +#endif #if DEBUG static int dodebug = 0; @@ -1185,7 +1189,11 @@ do_debug(char *phase) return; } if (dodebug) +#ifdef FLANG_VENDOR + fprintf(gbl.dbgfil, "{%sF90 after %s\n", FLANG_VENDOR, phase); +#else fprintf(gbl.dbgfil, "{%s after %s\n", feature, phase); +#endif current_phase = phase; execute_actions_for_keyword(phase_dump_map, phase); diff --git a/tools/flang1/flang1exe/semfunc.c b/tools/flang1/flang1exe/semfunc.c index 62a754932bb5..d3964bac8864 100644 --- a/tools/flang1/flang1exe/semfunc.c +++ b/tools/flang1/flang1exe/semfunc.c @@ -5458,7 +5458,7 @@ ref_pd(SST *stktop, ITEM *list) int pvar; int nelems, eltype; char *sname = NULL; - char verstr[140]; /*140, get_version_str returns max 128 char + pf90 prefix */ + char verstr[256]; /* get_version_str returns max 128 chars + vendor prefix */ FtnRtlEnum rtlRtn; /* any integer type, or hollerith, or, if -x 51 0x20 not set, real/double */ @@ -10660,7 +10660,13 @@ ref_pd(SST *stktop, ITEM *list) goto call_e74_cnt; } +#ifdef FLANG_VENDOR + assert(strlen(FLANG_VENDOR) < 116, "FLANG_VENDOR string too long", + strlen(FLANG_VENDOR), 4); + sprintf(verstr, FLANG_VENDOR "F90 %s", get_version_string()); +#else sprintf(verstr, "flang %s", get_version_string()); +#endif sptr = getstring(verstr, strlen(verstr)); goto const_str_val; diff --git a/tools/flang1/flang1exe/version.c b/tools/flang1/flang1exe/version.c index 9e16acfeaf81..7e097ef6086a 100644 --- a/tools/flang1/flang1exe/version.c +++ b/tools/flang1/flang1exe/version.c @@ -20,7 +20,11 @@ #define LANGUAGE "F90" +#ifdef FLANG_VENDOR +#define PRODUCT FLANG_VENDOR LANGUAGE " " +#else #define PRODUCT "" +#endif /* COPYRIGHT is extern to make it easy to find in symbol table */ /* it also has extra space to patch in interesting stuff */ diff --git a/tools/flang2/flang2exe/ccffinfo.c b/tools/flang2/flang2exe/ccffinfo.c index bb62b1937a1f..00b9eeff67d4 100644 --- a/tools/flang2/flang2exe/ccffinfo.c +++ b/tools/flang2/flang2exe/ccffinfo.c @@ -46,7 +46,11 @@ int bu_auto_inline(void); static int anyunits = 0; +#ifdef FLANG_VENDOR +#define BUILD_VENDOR FLANG_VENDOR +#else #define BUILD_VENDOR "flang-compiler" +#endif FIHB fihb = {(FIH *)0, 0, 0, 0, 0, 0, 0}; FIHB ifihb = {(FIH *)0, 0, 0, 0, 0, 0, 0}; /* bottom-up auto-inliner */ diff --git a/tools/flang2/flang2exe/main.c b/tools/flang2/flang2exe/main.c index a4f581d1ac61..7ee0fa8d11a5 100644 --- a/tools/flang2/flang2exe/main.c +++ b/tools/flang2/flang2exe/main.c @@ -62,6 +62,14 @@ void acc_add_global(void); /* FIXME - does not belong here */ static LOGICAL process_input(char *argv0, LOGICAL *need_cuda_constructor); +/** Product name in debug output + */ +#ifdef FLANG_VENDOR +#define DNAME FLANG_VENDOR "F90" +#else +#define DNAME "F90" +#endif + #if DEBUG & sun #ifndef _ERRNO_H extern int errno; @@ -120,7 +128,11 @@ static int dodebug = 0; #define DEBUGQQ 0 #endif +#if defined(FLANG_VENDOR) && defined(DNAME) +static char *dbg_feature = DNAME; +#else static char *dbg_feature = "flang"; +#endif static int ipa_import_mode = 0; @@ -208,7 +220,7 @@ process_input(char *argv0, LOGICAL *need_cuda_constructor) gbl.func_count++; if (gbl.multiversion <= 1) { - TR("F90 ILM INPUT begins\n") + TR(DNAME " ILM INPUT begins\n") if (!IS_PARFILE) { upper(0); @@ -273,7 +285,7 @@ process_input(char *argv0, LOGICAL *need_cuda_constructor) AssignAddresses(); /* exp_rte.c */ } } - TR("F90 EXPANDER begins\n"); + TR(DNAME " EXPANDER begins\n"); expand(); /* expand ILM's into ILI */ DUMP("expand"); @@ -301,14 +313,14 @@ process_input(char *argv0, LOGICAL *need_cuda_constructor) rm_smove(); DUMP("rmsmove"); - TR("F90 SCHEDULER begins\n"); + TR(DNAME " SCHEDULER begins\n"); DUMP("before-schedule"); schedule(); xtimes[5] += getcpu(); DUMP("schedule"); } /* CUDAG(GBL_CURRFUNC) & CUDA_HOST */ } - TR("F90 ASSEMBLER begins\n"); + TR(DNAME " ASSEMBLER begins\n"); assemble(); xtimes[6] += getcpu(); upper_save_syminfo(); @@ -929,7 +941,7 @@ process_stb_file() gbl.func_count++; - TR("F90 STBFILE INPUT begins\n") + TR(DNAME " STBFILE INPUT begins\n") upper(1); /* should we generate upper_stbfil()? */ if (gbl.eof_flag) diff --git a/tools/flang2/flang2exe/version.c b/tools/flang2/flang2exe/version.c index 59b2c4f8bd7d..56c53e3169c9 100644 --- a/tools/flang2/flang2exe/version.c +++ b/tools/flang2/flang2exe/version.c @@ -22,7 +22,11 @@ #define LANGUAGE "F90" #endif +#ifdef FLANG_VENDOR +#define PRODUCT FLANG_VENDOR LANGUAGE " " +#else #define PRODUCT "" +#endif /* COPYRIGHT is extern to make it easy to find in symbol table */ /* it also has extra space to patch in interesting stuff */