From 06828628cc71fdf190b6c9a3bb20fec206d6b23b Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 22 May 2017 15:28:54 -0400 Subject: [PATCH 28/31] FIXME: more fixupts for blt --- gcc/blt.c | 1 + gcc/blt.h | 2 +- gcc/diagnostic-show-locus.c | 3 +++ gcc/lsp-main.c | 9 +++++++-- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gcc/blt.c b/gcc/blt.c index d92149b..34e4591 100644 --- a/gcc/blt.c +++ b/gcc/blt.c @@ -238,6 +238,7 @@ blt_node::dump (pretty_printer *pp, const char *prefix, source_prefix = ACONCAT ((begin_color, new_prefix, "|:", end_color, NULL)); pp_set_prefix (pp, source_prefix); pp_prefixing_rule (pp) = DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE; + dc.show_ruler_p = true; diagnostic_show_locus (&dc, &richloc, DK_NOTE); pp_prefixing_rule (pp) = DIAGNOSTICS_SHOW_PREFIX_NEVER; pp_set_prefix (pp, saved_prefix); diff --git a/gcc/blt.h b/gcc/blt.h index a18038e..0fe874c 100644 --- a/gcc/blt.h +++ b/gcc/blt.h @@ -81,7 +81,7 @@ public: /* Modification. */ - void set_finish (location_t loc) { m_finish = loc; } + void set_finish (location_t loc) { m_finish = ::get_finish (loc); } void set_tree (tree t); void set_kind (enum blt_kind kind) { m_kind = kind; } diff --git a/gcc/diagnostic-show-locus.c b/gcc/diagnostic-show-locus.c index e460acf..e441198 100644 --- a/gcc/diagnostic-show-locus.c +++ b/gcc/diagnostic-show-locus.c @@ -1455,6 +1455,7 @@ layout::show_ruler (int max_column) const /* Hundreds. */ if (max_column > 99) { + pp_emit_prefix (m_pp); pp_space (m_pp); for (int column = 1 + m_x_offset; column <= max_column; column++) if (0 == column % 10) @@ -1465,6 +1466,7 @@ layout::show_ruler (int max_column) const } /* Tens. */ + pp_emit_prefix (m_pp); pp_space (m_pp); for (int column = 1 + m_x_offset; column <= max_column; column++) if (0 == column % 10) @@ -1474,6 +1476,7 @@ layout::show_ruler (int max_column) const pp_newline (m_pp); /* Units. */ + pp_emit_prefix (m_pp); pp_space (m_pp); for (int column = 1 + m_x_offset; column <= max_column; column++) pp_character (m_pp, '0' + (column % 10)); diff --git a/gcc/lsp-main.c b/gcc/lsp-main.c index 5c63a7e..5172f6a 100644 --- a/gcc/lsp-main.c +++ b/gcc/lsp-main.c @@ -144,8 +144,13 @@ gcc_lsp_server::do_text_document_definition (const TextDocumentPositionParams &p break; default: - /* No results. */ - return; + { + /* Just show the blt_node itself. */ + Location result; + if (Location_from_blt_node (blt, result)) + out.safe_push (result); + } + break; } } -- 1.8.5.3