GCC Middle and Back End API Reference
strinfo_struct Struct Reference
Collaboration diagram for strinfo_struct:

Data Fields

tree length
tree ptr
gimple stmt
tree endptr
int refcount
int idx
int first
int next
int prev
bool writable
bool dont_invalidate

Detailed Description

String information record.


Field Documentation

bool strinfo_struct::dont_invalidate

A flag for the next maybe_invalidate that this strinfo shouldn't be invalidated. Always cleared by maybe_invalidate.

Referenced by handle_pointer_plus().

tree strinfo_struct::endptr

Pointer to '\0' if known, if NULL, it can be computed as ptr + length.

Referenced by handle_pointer_plus(), and verify_related_strinfos().

int strinfo_struct::first

These 3 fields are for chaining related string pointers together. E.g. for bl = strlen (b); dl = strlen (d); strcpy (a, b); c = a + bl; strcpy (c, d); e = c + dl; strinfo(a) -> strinfo(c) -> strinfo(e) All have ->first field equal to strinfo(a)->idx and are doubly chained through prev/next fields. The later strinfos are required to point into the same string with zero or more bytes after the previous pointer and all bytes in between the two pointers must be non-zero. Functions like strcpy or memcpy are supposed to adjust all previous strinfo lengths, but not following strinfo lengths (those are uncertain, usually invalidated during maybe_invalidate, except when the alias oracle knows better). Functions like strcat on the other side adjust the whole related strinfo chain. They are updated lazily, so to use the chain the same first fields and si->prev->next == si->idx needs to be verified.

Referenced by find_equal_ptrs(), handle_pointer_plus(), and verify_related_strinfos().

int strinfo_struct::idx

Copy of index. get_strinfo (si->idx) should return si;

Referenced by find_equal_ptrs(), and verify_related_strinfos().

tree strinfo_struct::length

String length of this string.

Referenced by adjust_last_stmt(), free_strinfo(), handle_builtin_strlen(), and handle_pointer_plus().

int strinfo_struct::next
int strinfo_struct::prev
tree strinfo_struct::ptr

Any of the corresponding pointers for querying alias oracle.

int strinfo_struct::refcount

Reference count. Any changes to strinfo entry possibly shared with dominating basic blocks need unshare_strinfo first, except for dont_invalidate which affects only the immediately next maybe_invalidate.

gimple strinfo_struct::stmt

Statement for delayed length computation.

Referenced by free_strinfo(), and handle_pointer_plus().

bool strinfo_struct::writable

A flag whether the string is known to be written in the current function.

Referenced by handle_pointer_plus().


The documentation for this struct was generated from the following file: