https://github.com/iseki0 updated https://github.com/llvm/llvm-project/pull/119090
>From 06be29809a8ac03e4ec9546e1dcfc138ab79167b Mon Sep 17 00:00:00 2001 From: iseki zero <admin@iseki.space> Date: Sun, 8 Dec 2024 03:17:40 +0800 Subject: [PATCH 1/2] [docs] Add a more detailed description in CXString.h. --- clang/include/clang-c/CXString.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang/include/clang-c/CXString.h b/clang/include/clang-c/CXString.h index f117010c71a462..27375913e4cc19 100644 --- a/clang/include/clang-c/CXString.h +++ b/clang/include/clang-c/CXString.h @@ -46,6 +46,9 @@ typedef struct { /** * Retrieve the character data associated with the given string. + * + * The caller shouldn't free the returned string data, and the returned string + * data shouldn't be accessed after the \c CXString disposed. */ CINDEX_LINKAGE const char *clang_getCString(CXString string); >From c35de430af327b7f3d6882c488243acf2f95739f Mon Sep 17 00:00:00 2001 From: iseki <admin@iseki.space> Date: Wed, 11 Dec 2024 00:16:45 +0800 Subject: [PATCH 2/2] Update clang/include/clang-c/CXString.h Co-authored-by: Saleem Abdulrasool <compn...@compnerd.org> --- clang/include/clang-c/CXString.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clang/include/clang-c/CXString.h b/clang/include/clang-c/CXString.h index 27375913e4cc19..63dce4d140ce2c 100644 --- a/clang/include/clang-c/CXString.h +++ b/clang/include/clang-c/CXString.h @@ -47,8 +47,9 @@ typedef struct { /** * Retrieve the character data associated with the given string. * - * The caller shouldn't free the returned string data, and the returned string - * data shouldn't be accessed after the \c CXString disposed. + * The returned data is a reference and not owned by the user. This data + * is only valid while the `CXString` is valid. This function is similar + * to `std::string::c_str()`. */ CINDEX_LINKAGE const char *clang_getCString(CXString string); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits