Compute the contents of a null-terminated C string pointed to by V.
Declared in <llvm/Analysis/ValueTracking.h>
bool
getConstantStringInfo(
Value const* V,
StringRef& Str,
bool TrimAtNul = true);
If successful, it returns true and returns the string in Str. If unsuccessful, it returns false. This does not include the trailing null character by default. If TrimAtNul is set to false, then this returns any trailing null characters as well as any other characters that come after it.
True if a constant string was successfully recovered.
| Name | Description |
|---|---|
| V | Pointer to a potential constant C string. |
| Str | Output string contents on success. |
| TrimAtNul | Whether to stop at the first nul character. |