This patch to the C++ frontend extends -Wsuggest-override so that the
suggestions contain fix-it hints, provided that it can get at the correct
location. Doing so requires the blt_node infrastructure.
gcc/cp/ChangeLog:
* class.c: Include "gcc-rich-location.h" and "blt.h".
(check_f
This patch adds a "server" abstract base class for listening
on a port, for use by the later patches to implement an LSP server.
It's largely adapted from examples in glibc's docs. I suspect that
I've introduced platform-specific assumptions (and that it may need some
extra configure tests for th
This patch implements an abstract class of HTTP server, as a subclass
of the server class implemented in the previous patch.
gcc/ChangeLog:
* Makefile.in (OBJS): Add http-server.o.
* http-server.c: New file.
* http-server.h: New file.
* selftest-run-tests.c (selftes
This file adds the beginnings of a testsuite for the LSP
implementation.
The test cases are implemented in Python; they aren't currently
wired up to DejaGnu (I've been invoking them manually).
There's an automated test case, and a PyGTK UI.
Both require the language server to be manually started
This patch adds an lsp::server abstract base class for implementing
servers for the Language Server Protocol:
https://github.com/Microsoft/language-server-protocol
along with supporting classes mirroring those from the protocol
description.
The public specification of the protocol uses CamelCas
This patch is the first part of the Language Server Protocol
server proof-of-concept.
It adds support to gcc for reading and writing JSON,
based on DOM-like trees of "json::value" instances.
gcc/ChangeLog:
* Makefile.in (OBJS): Add json.o.
* json.c: New file.
* json.h: New
This patch to the C++ frontend uses the BLT infrastructure to improve:
extern int callee_1 (int one, const char *two, float three);
int test_1 (int first, int second, float third)
{
return callee_1 (first, second, third);
}
from:
error: invalid conversion from 'int' to 'const char
This patch adds an abstract base class for implementing
JSON-RPC 2.0 servers, along with a class for wiring them
up to the HTTP server class implemented in the previous
patch, supporting the serving of JSON-RPC over HTTP on a port.
gcc/ChangeLog:
* Makefile.in (OBJS): Add json-rpc.o.
This patch to the C frontend uses the BLT infrastructure to improve:
extern int callee_1 (int one, const char *two, float three);
int test_1 (int first, int second, float third)
{
return callee_1 (first, second, third);
}
from:
warning: passing argument 2 of 'callee_1' makes point
This patch to the C++ frontend uses the BLT infrastructure to highlight
the return type of a function when complaining about code within the
function that doesn't match it.
For example, given:
error: return-statement with a value, in function returning 'void'
[-fpermissive]
return 42;
This patch to the C frontend uses the BLT infrastructure to highlight
the return type of a function when complaining about code within the
function that doesn't match it.
For example, given:
warning: 'return' with a value, in function returning void
return 42;
^~
note: declar
This patch extends the C frontend so that it optionally builds a BLT tree,
by using an auto_blt_node class within the recursive descent through the
parser, so that its ctor/dtors build the blt_node hierarchy; this is
rapidly (I hope) rejected in the no -fblt case, so that by default, no
blt nodes a
This patch extends the C++ frontend so that it optionally builds a BLT tree,
by using an auto_blt_node class within the recursive descent through the
parser, so that its ctor/dtors build the blt_node hierarchy; this is
rapidly (I hope) rejected in the no -fblt case, so that by default, no
blt nodes
This patch implements a concrete subclass of the lsp::server
class implemented in the previous patch, wiring it up to GCC's
internal representation.
The patch is very much just a proof-of-concept; the only method it
implements is "textDocument/definition" i.e. "report the definition
of the symbol
On Fri, 2017-07-14 at 15:27 +0200, Marek Polacek wrote:
> On Thu, Jul 13, 2017 at 04:59:20PM -0400, David Malcolm wrote:
> > On Thu, 2017-07-13 at 16:39 -0400, Eric Gallager wrote:
> > > On 7/13/17, David Malcolm wrote:
> > > > On Thu, 2017-07-13 at 18:33 +0200, Ma
On Wed, 2017-07-26 at 23:35 +0900, Oleg Endo wrote:
> On Mon, 2017-07-24 at 16:05 -0400, David Malcolm wrote:
> >
> > +
> > +You should have received a copy of the GNU General Public License
> > +along with GCC; see the file COPYING3. If not see
> &
On Wed, 2017-07-26 at 18:00 +0200, Pierre-Marie de Rodat wrote:
> Hello,
>
> At the last GNU Cauldron, Richard Biener and I talked about DWARF
> output
> testing. Except for guality tests, which are disabled on several
> targets, the only way tests check the DWARF is scanning the annotated
> assem
On Wed, 2017-07-26 at 18:00 +0200, Pierre-Marie de Rodat wrote:
[...snip...]
> diff --git a/gcc/testsuite/python/testutils.py
> b/gcc/testsuite/python/testutils.py
> new file mode 100644
> index 000..503105ad9d0
> --- /dev/null
> +++ b/gcc/testsuite/python/testutils.py
> @@ -0,0 +1,45 @@
>
On Wed, 2017-07-26 at 18:35 +0200, Pierre-Marie de Rodat wrote:
> On 07/26/2017 06:25 PM, David Malcolm wrote:
> > str.format was introduced in Python 2.6, so presumably the minimum
> > python 2 version here is at least 2.6+; for Python 3 I believe it
> > was
> > pr
On Wed, 2017-07-26 at 18:00 +0200, Pierre-Marie de Rodat wrote:
[...]
> diff --git a/gcc/testsuite/python/dwarfutils/__init__.py
> b/gcc/testsuite/python/dwarfutils/__init__.py
> new file mode 100644
> index 000..246fbbd15be
> --- /dev/null
> +++ b/gcc/testsuite/python/dwarfutils/__init__.p
On Thu, 2017-07-27 at 10:49 +0200, Pierre-Marie de Rodat wrote:
> On 07/26/2017 06:48 PM, David Malcolm wrote:
> > IIRC RHEL 6 has Python 2.6 as its /usr/bin/python (but Python 2.7
> > is
> > available as a "software collection" add-on).
> >
> > I d
On Thu, 2017-07-27 at 16:42 +0200, Marek Polacek wrote:
> On Tue, Jul 25, 2017 at 11:03:12AM -0400, David Malcolm wrote:
> > Thanks for updating the patch.
> >
> > There's still an issue with ordering in the updated patch.
> >
> > There are three orde
PR c++/81514 reports a problem where
g++.dg/lookup/missing-std-include-2.C
fails on Solaris, offering the suggestion:
error: 'string' is not a member of 'std'
note: suggested alternative: 'sprintf'
instead of the expected:
error: 'string' is not a member of 'std'
note: 'std::string' is
On Thu, 2017-07-27 at 13:51 -0600, Martin Sebor wrote:
> I think this is great. My overall question is: is the new BLT
> representation available in the middle-end?
Given that, err, I'm not freeing it anywhere yet (ahem), the answer is
yes. Although it lives in the "gcc" dir, the generated tre
On Thu, 2017-07-27 at 00:14 -0400, Trevor Saunders wrote:
> On Mon, Jul 24, 2017 at 04:05:12PM -0400, David Malcolm wrote:
> > This patch adds an lsp::server abstract base class for implementing
> > servers for the Language Server Protocol:
> > https://github.com/Micr
On Thu, 2017-07-27 at 09:55 +0200, Richard Biener wrote:
> On Mon, Jul 24, 2017 at 10:05 PM, David Malcolm
> wrote:
> > This patch adds an lsp::server abstract base class for implementing
> > servers for the Language Server Protocol:
> > https://github.com/Microsoft/
On Mon, 2017-07-31 at 16:14 +0200, Marek Polacek wrote:
> This patch improves the diagnostic of -Wsign-compare for ?: by also
> printing
> the types, similarly to my recent patch. But we can do even better
> here if we
> actually point to the operand in question, so I passed the locations
> of the
On Mon, 2017-07-31 at 19:46 -0400, tbsaunde+...@tbsaunde.org wrote:
> From: Trevor Saunders
>
> Hi,
>
> I've been saying I'd do this for a long time, but I'm finally getting
> to
> importing the C++98 compatable unique_ptr class Pedro wrote for gdb a
> while
> back. I believe the gtl namespace
On Mon, 2017-07-31 at 19:46 -0400, tbsaunde+...@tbsaunde.org wrote:
> From: Trevor Saunders
>
> For most of the history of this see
> https://sourceware.org/ml/gdb-patches/2016-10/msg00223.html
> The changes are mostly s/gdb/gtl/g
>
> include/ChangeLog:
>
> 2017-07-29 Trevor Saunders
>
>
(Unchanged since v1; already approved by Marek, assuming rest is approved)
gcc/c-family/ChangeLog:
* c-common.c (c_parse_error): Add rich_location * param, using it
rather implicitly using input_location.
* c-common.h (c_parse_error): Add rich_location * param.
gcc/testsui
On Wed, 2017-07-12 at 09:13 -0400, Trevor Saunders wrote:
> On Tue, Jul 11, 2017 at 11:24:45AM -0400, David Malcolm wrote:
> > +/* Some tokens naturally come in pairs e.g.'(' and ')'.
> > + This class is for tracking such a matching pair of symbols.
> >
Changed in v2:
* Renamed template argument to traits_t; eliminated subclasses, just
using traits struct.
* Moved enum constants into struct bodies (string constants can't be
without constexpr, which isn't available in C++98).
* Fixed typo.
OK for trunk?
gcc/c/ChangeLog:
* c-parser.c
Changed in v2:
* Renamed template argument to traits_t; eliminated subclasses, just
using traits struct.
* Moved constants into struct bodies.
* Fixed typo.
OK for trunk?
gcc/cp/ChangeLog:
* parser.c (cp_parser_error): Update for new param to
c_parse_error.
(class token
On Mon, 2017-07-31 at 18:05 +0200, Marek Polacek wrote:
> On Mon, Jul 31, 2017 at 09:54:03AM -0600, Martin Sebor wrote:
> > On 07/31/2017 08:14 AM, Marek Polacek wrote:
> > > This patch improves the diagnostic of -Wsign-compare for ?: by
> > > also printing
> > > the types, similarly to my recent p
On Tue, 2017-08-01 at 16:15 +0200, Marek Polacek wrote:
> On Mon, Jul 31, 2017 at 11:31:44AM -0400, David Malcolm wrote:
> > On Mon, 2017-07-31 at 16:14 +0200, Marek Polacek wrote:
> > > This patch improves the diagnostic of -Wsign-compare for ?: by
> > > also
>
On Wed, 2017-08-02 at 13:20 +0200, Martin Liška wrote:
> Hello.
>
> After some discussions with Honza, I've decided to convert current
> code in stmt.c that
> is responsible for switch expansion. More precisely, I would like to
> convert the code
> to expand gswitch statements on tree level. Curre
On Thu, 2017-08-03 at 11:34 -0600, Jeff Law wrote:
> On 08/01/2017 02:21 PM, David Malcolm wrote:
> > Changed in v2:
> >
> > * Renamed template argument to traits_t; eliminated subclasses,
> > just
> > using traits struct.
> > * Moved enum constants int
gcc/ChangeLog:
* input.c (selftest::test_making_arbitrary_locations): New function.
(selftest::input_c_tests): Call it.
libcpp/ChangeLog:
* include/line-map.h (linemap_position_for_file_line_and_column):
New decl.
* line-map.c (linemap_position_for_file_line
gcc/ChangeLog:
* input.c: Include "selftest-input.h".
(selftest::assert_loceq): Remove "static". Add "report_loc" param
and update assertions to use it.
(selftest::test_accessing_ordinary_linemaps): Use ASSERT_LOCEQ
rather than assert_loceq.
(selftes
the output from the tool
into the common JSON format.
Some notes on the data model can be seen here:
http://firehose.readthedocs.io/en/latest/data-model.html
(though that's expressed as Python objects and XML, rather than
the JSON format).
Successfully bootstrapped®rtested the co
This patch adds support to gcc for reading and writing JSON,
based on DOM-like trees of json::value instances.
gcc/ChangeLog:
* Makefile.in (OBJS): Add json.o.
* json.cc: New file.
* json.h: New file.
* selftest-run-tests.c (selftest::run_tests): Call json_cc_tests.
0..9b6a864
--- /dev/null
+++ b/checkers/cppcheck.py
@@ -0,0 +1,138 @@
+#!/usr/bin/env python
+# Copyright 2012, 2013, 2015, 2017 David Malcolm
+# Copyright 2012, 2013, 2015, 2017 Red Hat, Inc.
+#
+# This is free software: you can redistribute it and/or modify it
+# under the terms of the G
gcc/ChangeLog:
* annobin.h (GNU_BUILD_ATTRIBUTE_STATIC_ANALYSIS): New define.
---
gcc/annobin.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/gcc/annobin.h b/gcc/annobin.h
index 76eb01c..1152316 100644
--- a/gcc/annobin.h
+++ b/gcc/annobin.h
@@ -35,6 +35,7 @@
#define GNU_BUILD_ATTRI
s diagnostic subsystem by checker.cc, these
"info" results are emitted as notes, e.g.:
../../src/checkers/test-sources/cpychecker-demo.c:2:4: note: I am not a lawyer
[not-a-lawyer:copyright-line]
Copyright 2011 David Malcolm
^
../../src/checkers/test-sources/cpychecker-
auto-profile.o \
bb-reorder.o \
diff --git a/gcc/annobin.cc b/gcc/annobin.cc
new file mode 100644
index 000..ad8e49a
--- /dev/null
+++ b/gcc/annobin.cc
@@ -0,0 +1,185 @@
+/* annobin - support for annotating binary files.
+ Copyright (c) 2017 Red Hat.
+ Created by Nick Clifton
This implements a new "policy" class to read a description of
a set of checkers to run, along with a "checker" class to
handle actually running the checkers, ouputting the results
through gcc's diagnostic subsystem, and watermarking the
generated binary with the results and metadata.
Caveats:
* t
This patch adds a simple Python 2/3 script for reading the
static analysis "watermark" from object files, writing the
JSON to stdout (prettyprinting it with indentation and newlines
for ease of human reading).
contrib/ChangeLog:
* get-static-analysis.py: New file.
---
contrib/get-static-a
This patch is a hack used by the followup checkers.cc patch,
and ought to be removed in any final version of the kit.
gcc/ChangeLog:
* selftest.c (read_file): New overload.
* selftest.h (read_file): New overload.
---
gcc/selftest.c | 16 +---
gcc/selftest.h | 7 ++
/cpychecker-demo.c
new file mode 100644
index 000..b379729
--- /dev/null
+++ b/checkers/test-sources/cpychecker-demo.c
@@ -0,0 +1,110 @@
+/*
+ Copyright 2011 David Malcolm
+ Copyright 2011 Red Hat, Inc.
+
+ This is free software: you can redistribute it and/or modify it
+ under the terms of
!/usr/bin/env python
+# Copyright 2017 David Malcolm
+# Copyright 2017 Red Hat, Inc.
+#
+# This is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License,
"Firehose" is a serialization format for results from code
analysis tools:
http://firehose.readthedocs.io/en/latest/index.html
(along with a Python module for working with the format).
This patch implements a set of C++ classes modeling the format,
with support for populating them from a JSON
00755
index 000..ae41d93
--- /dev/null
+++ b/checkers/clang_analyzer.py
@@ -0,0 +1,145 @@
+#!/usr/bin/env python
+# Copyright 2012, 2013, 2015, 2017 David Malcolm
+# Copyright 2012, 2013, 2015, 2017 Red Hat, Inc.
+#
+# This is free software: you can redistribute it and/or modify it
+#
The checker.cc patch later in the kit can optionally make use of pthread
if available.
Doing it properly would involve some configure checks; this patch simply
hacks in -lpthread into LIB unconditionally for now.
gcc/ChangeLog:
* Makefile.in (LIB): Hack in -lpthread.
---
gcc/Makefile.in
+)
create mode 100755 checkers/always_fails.py
diff --git a/checkers/always_fails.py b/checkers/always_fails.py
new file mode 100755
index 000..35fd4ac
--- /dev/null
+++ b/checkers/always_fails.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+# Copyright 2012, 2013, 2015, 2017 David Malcolm
+#
This patch introduces -Wrun-analyzers= and wires it up to the checkers.cc
code, via toplev.c
As noted earlier, I'm not a great fan of the monolithic option syntax
here; maybe there should be some kind of option that can be supplied
multiple times for adding individual checkers.
gcc/ChangeLog:
This patch adds a rather simplistic Makefile to "checkers", purely for
exercising the test suites of the various harness.
checkers/ChangeLog:
* Makefile: New file.
---
checkers/Makefile | 23 +++
1 file changed, 23 insertions(+)
create mode 100644 checkers/Makefile
d
null
+++ b/checkers/flawfinder.py
@@ -0,0 +1,124 @@
+#!/usr/bin/env python
+# Copyright 2012, 2013, 2015, 2017 David Malcolm
+# Copyright 2012, 2013, 2015, 2017 Red Hat, Inc.
+#
+# This is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public
f --git a/checkers/ChangeLog b/checkers/ChangeLog
new file mode 100644
index 000..9189883
--- /dev/null
+++ b/checkers/ChangeLog
@@ -0,0 +1,9 @@
+2017-08-03 David Malcolm
+
+ * ChangeLog: New ChangeLog file.
+
+Copyright (C) 2017 Free Software Foundation, Inc.
+
+Copying and dist
diff --git a/checkers/splint.py b/checkers/splint.py
new file mode 100755
index 000..e8f79f2
--- /dev/null
+++ b/checkers/splint.py
@@ -0,0 +1,77 @@
+#!/usr/bin/env python
+# Copyright 2017 David Malcolm
+# Copyright 2017 Red Hat, Inc.
+#
+# This is free software: you can redistribute
This patch adds fields "external_tool" and "external_test_id"
to diagnostic_info, allowing for diagnostics to be marked as
coming from a 3rd-party tool.
Instead of printing the pertinent warning flag e.g.:
foo.c:10:1: something is wrong [-Wpointer-arith]
the tool "ID" and (optionally) test ID
On Fri, 2017-08-04 at 21:00 -0400, Eric Gallager wrote:
> On 8/4/17, David Malcolm wrote:
> > This patch kit clearly isn't ready yet as-is (see e.g. the
> > "known unknowns" below), but I'm posting it now in the hope of
> > getting early feedback.
> &g
On Mon, 2017-08-07 at 14:25 -0400, Jason Merrill wrote:
Thanks for looking at this.
> On 08/01/2017 04:21 PM, David Malcolm wrote:
> > @@ -27632,6 +27769,9 @@ cp_parser_sizeof_operand (cp_parser*
> > parser, enum rid keyword)
> > {
> >
On Fri, 2017-08-04 at 12:09 -0600, Jeff Law wrote:
> On 08/04/2017 08:32 AM, David Malcolm wrote:
> > On Thu, 2017-08-03 at 11:34 -0600, Jeff Law wrote:
> > > On 08/01/2017 02:21 PM, David Malcolm wrote:
> > > > Changed in v2:
> > > >
> > > &g
For reference, here's the diff of the v3 C++ patch to the v2 patch,
in case it's useful:
gcc/cp/ChangeLog:
* parser.c (token_pair::require_open): Use tabs rather than spaces.
(token_pair::peek_open): Delete.
(token_pair::require_close): Use tabs rather than spaces.
On Wed, 2017-08-09 at 20:42 +1200, Michael Cree wrote:
> On Mon, Aug 07, 2017 at 10:28:57AM -0400, David Malcolm wrote:
> > On Mon, 2017-08-07 at 20:12 +1200, Michael Cree wrote:
> >
> > Hi Michael
> >
> > > I am wondering if libgccjit supports vector types,
On Wed, 2017-08-16 at 16:29 +0200, Marek Polacek wrote:
> This patch improves -Wtautological-compare so that it also detects
> bitwise comparisons involving & and | that are always true or false,
> e.g.
>
> if ((a & 16) == 10)
> return 1;
>
> can never be true. Note that e.g. "(a & 9) == 8
Successfully bootstrapped®rtested on x86_64-pc-linux-gnu.
Committed to trunk as r251128.
gcc/ChangeLog:
* diagnostic-show-locus.c (colorizer::m_caret): Remove unused
field.
---
gcc/diagnostic-show-locus.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/gcc/diagnostic-show-locu
On Wed, 2017-08-16 at 10:12 -0600, Martin Sebor wrote:
> PR c/81859 - [8 Regression] valgrind error from
> warn_about_normalization
>
> gcc/ChangeLog:
>
> PR c/81859
> * pretty-print.c (pp_format): Use strnlen in %.*s to avoid
> reading
> past the end of an array.
> (test_
Ping
On Thu, 2017-07-27 at 17:36 -0400, David Malcolm wrote:
> PR c++/81514 reports a problem where
> g++.dg/lookup/missing-std-include-2.C
> fails on Solaris, offering the suggestion:
>
> error: 'string' is not a member of 'std'
> note: suggested alte
The C reproducers generated by gcc_jit_context_dump_reproducer_to_file
contain numerous pointer values (from %p) to ensure uniqueness of the
identifiers, but this makes them less readable than they could be.
This patch updates reproducer::make_identifier so that the pointer
is only added if it's n
On Thu, 2017-08-17 at 11:51 -0400, David Malcolm wrote:
> On Thu, 2017-08-17 at 09:15 +1200, Michael Cree wrote:
> > On Wed, Aug 16, 2017 at 10:01:57AM -0400, David Malcolm wrote:
> > > On Wed, 2017-08-16 at 21:58 +1200, Michael Cree wrote:
> > > >
> > > >
The previous patch uncovered a bug in how c_parser_expr_list builds the
vec: it was only using the location of the first token
within each assignment-expression in the expr-list.
This shows up in e.g. this -Wformat warning, where only part of the
2nd param is underlined:
printf("hello %i", (lo
This patch passes along the vec of argument locations
at a callsite from the C frontend to check_function_arguments and
from there to c-format.c, so that we can underline the pertinent
argument to mismatched format codes even for tree codes like decls
and constants which lack a location_t for their
On Tue, 2017-08-22 at 09:35 -0600, Jeff Law wrote:
> On 08/19/2017 12:22 PM, Martin Sebor wrote:
> > On 07/30/2017 11:35 PM, Jeff Law wrote:
> > > This patch introduces the stack clash protection options
> > >
> > > Changes since V2:
> > >
> > > Adds two new params. The first controls the size o
On Tue, 2017-08-22 at 13:01 +0200, Andreas Schwab wrote:
> On Aug 18 2017, David Malcolm wrote:
>
> > gcc/c/ChangeLog:
> > * c-parser.c (c_parser_expr_list): Use c_expr::get_location ()
> > rather than peeking the location of the first token.
> > *
I have various patch kits under development that improve
how the C and C++ frontends handle mismatched types of
params at callsites.
For example, given:
extern int callee_1 (int one, const char *two, float three);
int test_1 (int first, int second, float third)
{
return callee_1 (first
In r251239 I added a c_expr::get_location method for use by
c_parser_expr_list for building the vec for
an expression list, rather than using the location of the first token.
When determining whether to use the location within the tree node,
or fall back to the range in the c_expr, I used EXPR_CAN
This patch extends various call-handling locations within the C++
frontend so that they can accept a possibly NULL vec *,
using the location information if available in various diagnostics.
It updates the C++ frontend's parser for this production:
postfix-expression:
postfix-expression (
This patch uses the name_hint/deferred_diagnostic to provide
a message in the C++ frontend if a macro is used before it is defined
e.g.:
test.c:6:24: error: expected ‘;’ at end of member declaration
virtual void clone() const OVERRIDE { }
^
In various places we use lookup_name_fuzzy to provide a hint,
and can report messages of the form:
error: unknown foo named 'bar'
or:
error: unknown foo named 'bar'; did you mean 'SUGGESTION?
This patch provides a way for lookup_name_fuzzy to provide
both the suggestion above, and (optionally)
The C frontend already "knows" about many common functions in
the C standard library:
test.c: In function 'test':
test.c:3:3: warning: implicit declaration of function 'printf'
[-Wimplicit-function-declaration]
printf ("hello world\n");
^~
test.c:3:3: warning: incompatible imp
This patch simplifies diagnostic_report_diagnostic by moving the
pragma-handling logic into a subroutine.
No functional change intended.
Successfully bootstrapped®rtested on x86_64-pc-linux-gnu.
Committed to trunk as r247660
gcc/ChangeLog:
* diagnostic.c (diagnostic_report_diagnostic):
This patch simplifies diagnostic_report_diagnostic by moving
option-printing to a new subroutine.
Doing so required a slight rewrite. In both the old and new
code, context->option_name returns a malloc-ed string.
The old behavior was to then use ACONCAT to manipulate the
format_spec, appending th
This patch eliminates the report_diagnostic macro, manually
expanding it in all sites in the code.
No functional change intended.
Successfully bootstrapped®rtested on x86_64-pc-linux-gnu.
Committed to trunk as r247663.
gcc/c-family/ChangeLog:
* c-common.c (c_cpp_error): Replace report_d
diagnostic.h has a couple of macros (diagnostic_last_module_changed
and diagnostic_set_last_module) which are only used within
diagnostic_report_current_module.
This patch eliminates the macros in favor of static functions within
diagnostic.c.
No functional change intended.
Successfully bootstra
No functional change intended.
Successfully bootstrapped®rtested on x86_64-pc-linux-gnu.
Committed to trunk as r247665.
gcc/ChangeLog:
* diagnostic.h (diagnostic_override_option_index): Convert from
macro to inline function.
---
gcc/diagnostic.h | 8 ++--
1 file changed, 6 i
Successfully bootstrapped®rtested on x86_64-pc-linux-gnu.
Committed to trunk as r247666.
gcc/ChangeLog:
* diagnostic.h (CARET_LINE_MARGIN): Convert from macro to const
int.
---
gcc/diagnostic.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/diagnostic.h b
On Mon, 2017-05-01 at 14:43 -0400, Jason Merrill wrote:
> On Thu, Apr 27, 2017 at 7:23 AM, Nathan Sidwell
> wrote:
> > On 04/26/2017 12:34 PM, David Malcolm wrote:
> >
> > > Thanks - yes; that gives information on the const vs non-const of
> > > the
>
On Mon, 2017-05-08 at 07:36 -0400, Nathan Sidwell wrote:
> On 05/04/2017 07:44 PM, David Malcolm wrote:
> > This patch kit implements two new options to make it easier
> > to read diagnostics involving mismatched template types:
> >-fdiagnostics-show-template-tree and
&
Changed in v2: use %qH and %qI rather than %H and %I.
This is the second half of the kit, which uses %qH and %qI throughout
the C++ frontend whenever describing type mismatches between a pair
of %qT.
gcc/cp/ChangeLog:
* call.c (print_conversion_rejection): Replace pairs of %qT with
Changes in v2:
- pass "quote" as an extra bool argument to the pp_format_decoder
callback, so that we can optionally quote the delayed chunks (with
%qH and %qI)
- use %qH and %qI rather than %H and %I.
- use CLASS_TYPE_P.
- use TYPE_P rather than EXPR_P in arg_to_string to handle non-type template
On Tue, 2017-05-09 at 10:52 -0400, Nathan Sidwell wrote:
> On 05/09/2017 10:07 AM, David Malcolm wrote:
>
>
> > +static const char *
> > +type_to_string_with_compare (tree type, tree peer, bool verbose,
> > +bool show_color)
> > +
(unchanged in v3)
Changed in v2: use %qH and %qI rather than %H and %I.
This is the second half of the kit, which uses %qH and %qI throughout
the C++ frontend whenever describing type mismatches between a pair
of %qT.
gcc/cp/ChangeLog:
* call.c (print_conversion_rejection): Replace pairs
This patch is broken out from the C++ patch, for ease of review.
I believe I can self-approve this one, assuming the other patches
in the kit are OK.
The patch:
- adds the bool and const char ** params to the
pp_format_decoder callback
- adds the format_postprocessor class
- adds the "type-diff"
Changes in v3:
- Merge bodies of type_to_string_with_compare and
print_template_tree_comparison into a new function,
print_template_differences. Use simpler comma-insertion criterion.
- Cleanup assertions in cxx_format_postprocessor::handle.
Would it make sense to rename "m_type_a"/"m_type_b" to
On Wed, 2017-05-17 at 12:48 +0200, Jan Hubicka wrote:
> Hi,
> this is first patch of series to modularize function analysis done by
> ipa-inline and ipa-cp. This patch turns predicates into a class. It
> avoids any
> code movement or semnatic changes which I will do next. Main change
> is to
> t
On Tue, 2017-05-02 at 12:56 -0400, Eric Gallager wrote:
> On 3/24/17, Eric Gallager wrote:
> > On 3/24/17, David Malcolm wrote:
> > > On Fri, 2017-03-24 at 14:10 -0400, Eric Gallager wrote:
> > > > The attached test case failed with gcc 4.9 and older, but
>
On Tue, 2017-05-23 at 14:11 +0200, Jakub Jelinek wrote:
> On Tue, May 23, 2017 at 06:48:15AM -0400, Aldy Hernandez wrote:
[...]
> > --- /dev/null
> > +++ b/gcc/range.h
> > +
> > +You should have received a copy of the GNU General Public License
> > +along with GCC; see the file COPYING3. If not
Ping
On Fri, 2017-04-28 at 18:09 -0400, David Malcolm wrote:
> Ping for these two patches:
> - https://gcc.gnu.org/ml/gcc-patches/2017-03/msg00909.html
> - https://gcc.gnu.org/ml/gcc-patches/2017-03/msg00910.html
>
> On Thu, 2017-03-16 at 21:51 -0400, David Malcolm wrote:
&g
On Wed, 2017-05-03 at 09:51 -0400, David Malcolm wrote:
> On Thu, 2017-04-27 at 23:03 +0200, Marek Polacek wrote:
> > On Thu, Apr 27, 2017 at 05:10:24PM -0400, David Malcolm wrote:
> > > + /* First try const_cast. */
> > > + trial = build_const_cast (dst_typ
2801 - 2900 of 5457 matches
Mail list logo