HomePhabricator

[OCaml] Code simplification using string allocation functions

Authored by jberdine on Mar 27 2021, 4:00 PM.

Description

[OCaml] Code simplification using string allocation functions

Using the cstr_to_string function that allocates and initializes an
OCaml string value enables simplifications in several cases. This
change also has the effect of avoiding calling memcpy on NULL
pointers even if only 0 bytes are to be copied.

Differential Revision: https://reviews.llvm.org/D99474