[clang] a8e66d7 - [docs] Add a more detailed description in CXString.h. (#119090)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 12 07:54:14 PST 2024
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 <compnerd at 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);
More information about the cfe-commits
mailing list