cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
linking_diagnostics.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: ANSI-C Linking
4
5
Author: Michael Tautschnig
6
7
\*******************************************************************/
8
11
12
#ifndef CPROVER_LINKING_LINKING_DIAGNOSTICS_H
13
#define CPROVER_LINKING_LINKING_DIAGNOSTICS_H
14
15
#include <
util/std_expr.h
>
16
#include <
util/symbol.h
>
17
18
class
message_handlert
;
19
class
namespacet
;
20
21
class
linking_diagnosticst
22
{
23
public
:
24
linking_diagnosticst
(
message_handlert
&
message_handler
,
namespacet
&
ns
)
25
:
message_handler
(
message_handler
),
ns
(
ns
)
26
{
27
}
28
29
void
error
(
30
const
symbolt
&old_symbol,
31
const
symbolt
&new_symbol,
32
const
std::string &msg);
33
34
void
warning
(
35
const
symbolt
&old_symbol,
36
const
symbolt
&new_symbol,
37
const
std::string &msg);
38
39
void
detailed_conflict_report
(
40
const
symbolt
&old_symbol,
41
const
symbolt
&new_symbol,
42
const
typet
&type1,
43
const
typet
&type2)
44
{
45
symbol_exprt
conflict_path =
symbol_exprt::typeless
(ID_C_this);
46
detailed_conflict_report_rec
(
47
old_symbol,
48
new_symbol,
49
type1,
50
type2,
51
10,
// somewhat arbitrary limit
52
conflict_path);
53
}
54
55
protected
:
56
message_handlert
&
message_handler
;
57
const
namespacet
&
ns
;
58
59
std::string
60
type_to_string_verbose
(
const
symbolt
&symbol,
const
typet
&type)
const
;
61
62
std::string
type_to_string_verbose
(
const
symbolt
&symbol)
const
63
{
64
return
type_to_string_verbose
(symbol, symbol.
type
);
65
}
66
70
bool
detailed_conflict_report_rec
(
71
const
symbolt
&old_symbol,
72
const
symbolt
&new_symbol,
73
const
typet
&type1,
74
const
typet
&type2,
75
unsigned
depth,
76
exprt
&conflict_path);
77
};
78
79
#endif
// CPROVER_LINKING_LINKING_DIAGNOSTICS_H
exprt
Base class for all expressions.
Definition
expr.h:57
linking_diagnosticst::linking_diagnosticst
linking_diagnosticst(message_handlert &message_handler, namespacet &ns)
Definition
linking_diagnostics.h:24
linking_diagnosticst::type_to_string_verbose
std::string type_to_string_verbose(const symbolt &symbol) const
Definition
linking_diagnostics.h:62
linking_diagnosticst::message_handler
message_handlert & message_handler
Definition
linking_diagnostics.h:56
linking_diagnosticst::ns
const namespacet & ns
Definition
linking_diagnostics.h:57
linking_diagnosticst::type_to_string_verbose
std::string type_to_string_verbose(const symbolt &symbol, const typet &type) const
Definition
linking_diagnostics.cpp:35
linking_diagnosticst::warning
void warning(const symbolt &old_symbol, const symbolt &new_symbol, const std::string &msg)
Definition
linking_diagnostics.cpp:382
linking_diagnosticst::detailed_conflict_report_rec
bool detailed_conflict_report_rec(const symbolt &old_symbol, const symbolt &new_symbol, const typet &type1, const typet &type2, unsigned depth, exprt &conflict_path)
Returns true iff the conflict report on a particular branch of the tree of types was a definitive res...
Definition
linking_diagnostics.cpp:87
linking_diagnosticst::detailed_conflict_report
void detailed_conflict_report(const symbolt &old_symbol, const symbolt &new_symbol, const typet &type1, const typet &type2)
Definition
linking_diagnostics.h:39
linking_diagnosticst::error
void error(const symbolt &old_symbol, const symbolt &new_symbol, const std::string &msg)
Definition
linking_diagnostics.cpp:365
message_handlert
Definition
message.h:27
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition
namespace.h:91
symbol_exprt
Expression to hold a symbol (variable).
Definition
std_expr.h:132
symbol_exprt::typeless
static symbol_exprt typeless(const irep_idt &id)
Generate a symbol_exprt without a proper type.
Definition
std_expr.h:151
symbolt
Symbol table entry.
Definition
symbol.h:28
symbolt::type
typet type
Type of symbol.
Definition
symbol.h:31
typet
The type of an expression, extends irept.
Definition
type.h:29
std_expr.h
API to expression classes.
symbol.h
Symbol table entry.
linking
linking_diagnostics.h
Generated by
1.17.0