Author: iseki Date: 2024-12-12T07:54:09-08:00 New Revision: a8e66d7f17bc648865cebf6b1e58c7a9071c6a84
URL: https://github.com/llvm/llvm-project/commit/a8e66d7f17bc648865cebf6b1e58c7a9071c6a84 DIFF: https://github.com/llvm/llvm-project/commit/a8e66d7f17bc648865cebf6b1e58c7a9071c6a84.diff LOG: [docs] Add a more detailed description in CXString.h. (#119090) Emmm... Maybe I'm splitting hairs. But I really think the paragraph should be more detailed. The orginal document makes me confused. Do I take the ownership of the string data? Here I don't refer the `clang_disposeString` function, because here's a `clang_disposeStringSet`. Co-authored-by: Saleem Abdulrasool <compn...@compnerd.org> Added: Modified: clang/include/clang-c/CXString.h Removed: ################################################################################ diff --git a/clang/include/clang-c/CXString.h b/clang/include/clang-c/CXString.h index f117010c71a462..63dce4d140ce2c 100644 --- a/clang/include/clang-c/CXString.h +++ b/clang/include/clang-c/CXString.h @@ -46,6 +46,10 @@ typedef struct { /** * Retrieve the character data associated with the given string. + * + * 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