Skip to content

Commit f83f410

Browse files
committed
make use of FLANG_VENDOR
Signed-off-by: Paul Osmialowski <[email protected]>
1 parent e74ac47 commit f83f410

File tree

8 files changed

+53
-6
lines changed

8 files changed

+53
-6
lines changed

tools/flang1/flang1exe/ccffinfo.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ int bu_auto_inline(void);
4040

4141
static int anyunits = 0;
4242

43+
#ifdef FLANG_VENDOR
44+
#define BUILD_VENDOR FLANG_VENDOR
45+
#else
4346
#define BUILD_VENDOR "flang-compiler"
47+
#endif
4448

4549
FIHB fihb = {(FIH *)0, 0, 0, 0, 0, 0, 0};
4650
FIHB ifihb = {(FIH *)0, 0, 0, 0, 0, 0, 0}; /* bottom-up auto-inliner */

tools/flang1/flang1exe/listing.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,13 @@ list_ln(char *beg, char *txt)
116116
if (!lf)
117117
return; /* in case error msg written before file
118118
* opened */
119+
#ifdef FLANG_VENDOR
120+
fprintf(lf, "\n\n\n%s%s (Version %8s) %s page %d\n\n",
121+
FLANG_VENDOR, version.lang, version.vsn, gbl.datetime, pgno);
122+
#else
119123
fprintf(lf, "\n\n\n%s (Version %8s) %s page %d\n\n",
120124
version.lang, version.vsn, gbl.datetime, pgno);
125+
#endif
121126
pgno++;
122127
pgpos = 6;
123128
}

tools/flang1/flang1exe/main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@ static char *accel = NULL;
127127

128128
/** Product name in debug output
129129
*/
130+
#ifdef FLANG_VENDOR
131+
#define DNAME FLANG_VENDOR "F90"
132+
#else
130133
#define DNAME "F90"
134+
#endif
131135

132136
#if DEBUG
133137
static int dodebug = 0;
@@ -1185,7 +1189,11 @@ do_debug(char *phase)
11851189
return;
11861190
}
11871191
if (dodebug)
1192+
#ifdef FLANG_VENDOR
1193+
fprintf(gbl.dbgfil, "{%sF90 after %s\n", FLANG_VENDOR, phase);
1194+
#else
11881195
fprintf(gbl.dbgfil, "{%s after %s\n", feature, phase);
1196+
#endif
11891197

11901198
current_phase = phase;
11911199
execute_actions_for_keyword(phase_dump_map, phase);

tools/flang1/flang1exe/semfunc.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5458,7 +5458,7 @@ ref_pd(SST *stktop, ITEM *list)
54585458
int pvar;
54595459
int nelems, eltype;
54605460
char *sname = NULL;
5461-
char verstr[140]; /*140, get_version_str returns max 128 char + pf90 prefix */
5461+
char verstr[256]; /* get_version_str returns max 128 chars + vendor prefix */
54625462
FtnRtlEnum rtlRtn;
54635463

54645464
/* any integer type, or hollerith, or, if -x 51 0x20 not set, real/double */
@@ -10660,7 +10660,13 @@ ref_pd(SST *stktop, ITEM *list)
1066010660
goto call_e74_cnt;
1066110661
}
1066210662

10663+
#ifdef FLANG_VENDOR
10664+
assert(strlen(FLANG_VENDOR) < 116, "FLANG_VENDOR string too long",
10665+
strlen(FLANG_VENDOR), 4);
10666+
sprintf(verstr, FLANG_VENDOR "F90 %s", get_version_string());
10667+
#else
1066310668
sprintf(verstr, "flang %s", get_version_string());
10669+
#endif
1066410670
sptr = getstring(verstr, strlen(verstr));
1066510671

1066610672
goto const_str_val;

tools/flang1/flang1exe/version.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020

2121
#define LANGUAGE "F90"
2222

23+
#ifdef FLANG_VENDOR
24+
#define PRODUCT FLANG_VENDOR LANGUAGE " "
25+
#else
2326
#define PRODUCT ""
27+
#endif
2428

2529
/* COPYRIGHT is extern to make it easy to find in symbol table */
2630
/* it also has extra space to patch in interesting stuff */

tools/flang2/flang2exe/ccffinfo.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ int bu_auto_inline(void);
4646

4747
static int anyunits = 0;
4848

49+
#ifdef FLANG_VENDOR
50+
#define BUILD_VENDOR FLANG_VENDOR
51+
#else
4952
#define BUILD_VENDOR "flang-compiler"
53+
#endif
5054

5155
FIHB fihb = {(FIH *)0, 0, 0, 0, 0, 0, 0};
5256
FIHB ifihb = {(FIH *)0, 0, 0, 0, 0, 0, 0}; /* bottom-up auto-inliner */

tools/flang2/flang2exe/main.c

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ void acc_add_global(void); /* FIXME - does not belong here */
6262

6363
static LOGICAL process_input(char *argv0, LOGICAL *need_cuda_constructor);
6464

65+
/** Product name in debug output
66+
*/
67+
#ifdef FLANG_VENDOR
68+
#define DNAME FLANG_VENDOR "F90"
69+
#else
70+
#define DNAME "F90"
71+
#endif
72+
6573
#if DEBUG & sun
6674
#ifndef _ERRNO_H
6775
extern int errno;
@@ -120,7 +128,11 @@ static int dodebug = 0;
120128
#define DEBUGQQ 0
121129
#endif
122130

131+
#if defined(FLANG_VENDOR) && defined(DNAME)
132+
static char *dbg_feature = DNAME;
133+
#else
123134
static char *dbg_feature = "flang";
135+
#endif
124136

125137
static int ipa_import_mode = 0;
126138

@@ -208,7 +220,7 @@ process_input(char *argv0, LOGICAL *need_cuda_constructor)
208220
gbl.func_count++;
209221

210222
if (gbl.multiversion <= 1) {
211-
TR("F90 ILM INPUT begins\n")
223+
TR(DNAME " ILM INPUT begins\n")
212224
if (!IS_PARFILE)
213225
{
214226
upper(0);
@@ -273,7 +285,7 @@ process_input(char *argv0, LOGICAL *need_cuda_constructor)
273285
AssignAddresses(); /* exp_rte.c */
274286
}
275287
}
276-
TR("F90 EXPANDER begins\n");
288+
TR(DNAME " EXPANDER begins\n");
277289

278290
expand(); /* expand ILM's into ILI */
279291
DUMP("expand");
@@ -301,14 +313,14 @@ process_input(char *argv0, LOGICAL *need_cuda_constructor)
301313
rm_smove();
302314
DUMP("rmsmove");
303315

304-
TR("F90 SCHEDULER begins\n");
316+
TR(DNAME " SCHEDULER begins\n");
305317
DUMP("before-schedule");
306318
schedule();
307319
xtimes[5] += getcpu();
308320
DUMP("schedule");
309321
} /* CUDAG(GBL_CURRFUNC) & CUDA_HOST */
310322
}
311-
TR("F90 ASSEMBLER begins\n");
323+
TR(DNAME " ASSEMBLER begins\n");
312324
assemble();
313325
xtimes[6] += getcpu();
314326
upper_save_syminfo();
@@ -929,7 +941,7 @@ process_stb_file()
929941

930942
gbl.func_count++;
931943

932-
TR("F90 STBFILE INPUT begins\n")
944+
TR(DNAME " STBFILE INPUT begins\n")
933945
upper(1); /* should we generate upper_stbfil()? */
934946

935947
if (gbl.eof_flag)

tools/flang2/flang2exe/version.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
#define LANGUAGE "F90"
2323
#endif
2424

25+
#ifdef FLANG_VENDOR
26+
#define PRODUCT FLANG_VENDOR LANGUAGE " "
27+
#else
2528
#define PRODUCT ""
29+
#endif
2630

2731
/* COPYRIGHT is extern to make it easy to find in symbol table */
2832
/* it also has extra space to patch in interesting stuff */

0 commit comments

Comments
 (0)