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 0c641f8c22c4..d5d357de235f 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; @@ -1189,7 +1193,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 69957464e647..e3c5d60bb019 100644 --- a/tools/flang1/flang1exe/semfunc.c +++ b/tools/flang1/flang1exe/semfunc.c @@ -5559,7 +5559,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; SPTR pdsym = SST_SYMG(stktop); int pdtype = PDNUMG(pdsym); @@ -10759,7 +10759,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 90319daed565..72e4aa91a2d5 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/main.cpp b/tools/flang2/flang2exe/main.cpp index c7b6cdcf4486..3edd84dd7465 100644 --- a/tools/flang2/flang2exe/main.cpp +++ b/tools/flang2/flang2exe/main.cpp @@ -56,6 +56,14 @@ static bool process_input(char *argv0, bool *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; @@ -113,7 +121,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; @@ -201,7 +213,7 @@ process_input(char *argv0, bool *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); @@ -269,7 +281,7 @@ process_input(char *argv0, bool *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"); @@ -297,14 +309,14 @@ process_input(char *argv0, bool *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(); @@ -928,7 +940,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.cpp b/tools/flang2/flang2exe/version.cpp index 1f1c2d1c43b8..f472ad9219f3 100644 --- a/tools/flang2/flang2exe/version.cpp +++ b/tools/flang2/flang2exe/version.cpp @@ -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 */ diff --git a/tools/shared/ccffinfo.c b/tools/shared/ccffinfo.c index ac0096028410..9138347675e9 100644 --- a/tools/shared/ccffinfo.c +++ b/tools/shared/ccffinfo.c @@ -54,7 +54,11 @@ static int prevchildnest = -1; static int prevlineno = 0; static bool anymessages; +#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 */