+2018-11-21 Alexandre Oliva <oliva@adacore.com>
+
+ * final.c (compute_discriminator): Declare. Renamed from...
+ (maybe_set_discriminator): ... this. Set and return a local.
+ (override_discriminator): New.
+ (final_scan_insn_1): Set it.
+ (notice_source_line): Adjust. Always set discriminator.
+
2018-11-21 Jakub Jelinek <jakub@redhat.com>
PR target/87839
/* Discriminator to be written to assembly for current instruction.
Note: actual usage depends on loc_discriminator_kind setting. */
static int discriminator;
+static inline int compute_discriminator (location_t loc);
/* Discriminator identifying current basic block among others sharing
the same locus. */
static const char *override_filename;
static int override_linenum;
static int override_columnnum;
+static int override_discriminator;
/* Whether to force emission of a line note before the next insn. */
static bool force_source_line = false;
override_filename = LOCATION_FILE (*locus_ptr);
override_linenum = LOCATION_LINE (*locus_ptr);
override_columnnum = LOCATION_COLUMN (*locus_ptr);
+ override_discriminator = compute_discriminator (*locus_ptr);
}
}
break;
override_filename = LOCATION_FILE (*locus_ptr);
override_linenum = LOCATION_LINE (*locus_ptr);
override_columnnum = LOCATION_COLUMN (*locus_ptr);
+ override_discriminator = compute_discriminator (*locus_ptr);
}
else
{
override_filename = NULL;
override_linenum = 0;
override_columnnum = 0;
+ override_discriminator = 0;
}
}
break;
/* Set DISCRIMINATOR to the appropriate value, possibly derived from LOC. */
-static inline void
-maybe_set_discriminator (location_t loc)
+static inline int
+compute_discriminator (location_t loc)
{
+ int discriminator;
+
if (!decl_to_instance_map)
discriminator = bb_discriminator;
else
discriminator = map_decl_to_instance (decl);
}
+
+ return discriminator;
}
/* Return whether a source line note needs to be emitted before INSN.
filename = xloc.file;
linenum = xloc.line;
columnnum = xloc.column;
- maybe_set_discriminator (loc);
+ discriminator = compute_discriminator (loc);
force_source_line = true;
}
else if (override_filename)
filename = override_filename;
linenum = override_linenum;
columnnum = override_columnnum;
+ discriminator = override_discriminator;
}
else if (INSN_HAS_LOCATION (insn))
{
filename = xloc.file;
linenum = xloc.line;
columnnum = xloc.column;
- maybe_set_discriminator (INSN_LOCATION (insn));
+ discriminator = compute_discriminator (INSN_LOCATION (insn));
}
else
{
filename = NULL;
linenum = 0;
columnnum = 0;
+ discriminator = 0;
}
if (filename == NULL)