1 /* Implementation of gcc_rich_location class
2 Copyright (C) 2014-2016 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
22 #include "coretypes.h"
28 #include "double-int.h"
34 #include "tree-core.h"
36 #include "diagnostic-core.h"
37 #include "gcc-rich-location.h"
38 #include "print-tree.h"
39 #include "pretty-print.h"
42 #include "diagnostic.h"
44 /* Add a range to the rich_location, covering expression EXPR. */
47 gcc_rich_location::add_expr (tree expr
)
51 if (CAN_HAVE_RANGE_P (expr
))
52 add_range (EXPR_LOCATION (expr
), false);
55 /* If T is an expression, add a range for it to the rich_location. */
58 gcc_rich_location::maybe_add_expr (tree t
)