================ @@ -411,6 +412,48 @@ RT_API_ATTRS void ShallowCopy(const Descriptor &to, const Descriptor &from, bool toIsContiguous, bool fromIsContiguous); RT_API_ATTRS void ShallowCopy(const Descriptor &to, const Descriptor &from); +RT_API_ATTRS const char *EnsureNullTerminated( + const char *str, size_t length, Terminator &terminator); + +RT_API_ATTRS std::size_t LengthWithoutTrailingSpaces(const Descriptor &d); + +// Returns the length of the \p string. Assumes \p string is valid. +RT_API_ATTRS std::int64_t StringLength(const char *string); + +// Assumes Descriptor \p value is not nullptr. +RT_API_ATTRS bool IsValidCharDescriptor(const Descriptor *value); + +// Assumes Descriptor \p intVal is not nullptr. +RT_API_ATTRS bool IsValidIntDescriptor(const Descriptor *intVal); + +// Assume Descriptor \p value is valid: pass IsValidCharDescriptor check. +RT_API_ATTRS void FillWithSpaces( + const Descriptor &value, std::size_t offset = 0); + +RT_API_ATTRS std::int32_t CopyToDescriptor(const Descriptor &value, + const char *rawValue, std::int64_t rawValueLength, const Descriptor *errmsg, + std::size_t offset = 0); + +void CopyCharToDescriptor( + const Descriptor &value, const char *rawValue, std::size_t offset = 0); + +RT_API_ATTRS std::int32_t CheckAndCopyToDescriptor(const Descriptor *value, + const char *rawValue, const Descriptor *errmsg, std::size_t &offset); + +RT_API_ATTRS void CheckAndCopyCharToDescriptor( + const Descriptor *value, const char *rawValue, std::size_t offset = 0); + +RT_API_ATTRS void StoreIntToDescriptor( + const Descriptor *length, std::int64_t value, Terminator &terminator); + +RT_API_ATTRS void CheckAndStoreIntToDescriptor( + const Descriptor *intVal, std::int64_t value, Terminator &terminator); + +template <int KIND> struct FitsInIntegerKind; ---------------- klausler wrote:
What does this do? https://github.com/llvm/llvm-project/pull/74077 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits