aboutsummaryrefslogtreecommitdiff
path: root/gcc/analyzer/analyzer.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/analyzer/analyzer.h')
-rw-r--r--gcc/analyzer/analyzer.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/analyzer/analyzer.h b/gcc/analyzer/analyzer.h
index a161952..579517c 100644
--- a/gcc/analyzer/analyzer.h
+++ b/gcc/analyzer/analyzer.h
@@ -183,6 +183,11 @@ extern tree get_field_at_bit_offset (tree record_type, bit_offset_t bit_offset);
class region_offset
{
public:
+ region_offset ()
+ : m_base_region (NULL), m_offset (0), m_sym_offset (NULL)
+ {
+ }
+
static region_offset make_concrete (const region *base_region,
bit_offset_t offset)
{
@@ -193,9 +198,12 @@ public:
{
return region_offset (base_region, 0, sym_offset);
}
+ static region_offset make_byte_offset (const region *base_region,
+ const svalue *num_bytes_sval);
const region *get_base_region () const { return m_base_region; }
+ bool concrete_p () const { return m_sym_offset == NULL; }
bool symbolic_p () const { return m_sym_offset != NULL; }
bit_offset_t get_bit_offset () const
@@ -204,12 +212,26 @@ public:
return m_offset;
}
+ bool get_concrete_byte_offset (byte_offset_t *out) const
+ {
+ gcc_assert (!symbolic_p ());
+ if (m_offset % BITS_PER_UNIT == 0)
+ {
+ *out = m_offset / BITS_PER_UNIT;
+ return true;
+ }
+ return false;
+ }
+
const svalue *get_symbolic_byte_offset () const
{
gcc_assert (symbolic_p ());
return m_sym_offset;
}
+ tree calc_symbolic_bit_offset (const region_model &model) const;
+ const svalue *calc_symbolic_byte_offset (region_model_manager *mgr) const;
+
bool operator== (const region_offset &other) const
{
return (m_base_region == other.m_base_region
@@ -217,6 +239,9 @@ public:
&& m_sym_offset == other.m_sym_offset);
}
+ void dump_to_pp (pretty_printer *pp, bool) const;
+ void dump (bool) const;
+
private:
region_offset (const region *base_region, bit_offset_t offset,
const svalue *sym_offset)
@@ -228,6 +253,11 @@ private:
const svalue *m_sym_offset;
};
+extern bool operator< (const region_offset &, const region_offset &);
+extern bool operator<= (const region_offset &, const region_offset &);
+extern bool operator> (const region_offset &, const region_offset &);
+extern bool operator>= (const region_offset &, const region_offset &);
+
extern location_t get_stmt_location (const gimple *stmt, function *fun);
extern bool compat_types_p (tree src_type, tree dst_type);