Skip to content

[NFC][libclang][Dependency Scanning] Document Link Library Related C-APIs' Return Values' Lifetimes #11009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions clang/include/clang-c/Dependencies.h
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,8 @@ typedef struct CXOpaqueDepGraphModuleLinkLibrary *CXDepGraphModuleLinkLibrary;
/**
* Get the set of link libraries given a \c CXDepGraphModule instance.
* The returned set is a pointer into memory that the \c CXDepGraphModule
* instance owns. Therefore the set does not need to be disposed.
* instance owns. Therefore the set does not need to be disposed, and it has
* the same lifetime as the \c CXDepGraphModule instance.
*/
CINDEX_LINKAGE CXDepGraphModuleLinkLibrarySet
clang_experimental_DepGraphModule_getLinkLibrarySet(CXDepGraphModule);
Expand All @@ -765,7 +766,10 @@ CINDEX_LINKAGE size_t clang_experimental_DepGraphModuleLinkLibrarySet_getSize(

/**
* Retrieve the \c CXDepGraphModuleLinkLibrary instance at index \p Idx from the
* \c CXDepGraphModuleLinkLibrarySet instance.
* \c CXDepGraphModuleLinkLibrarySet instance. The returned object is owned
* by the \c CXDepGraphModule instance where the
* \c CXDepGraphModuleLinkLibrarySet was retrieved from, and has the same
* lifetime as the \c CXDepGraphModule instance.
*/
CINDEX_LINKAGE CXDepGraphModuleLinkLibrary
clang_experimental_DepGraphModuleLinkLibrarySet_getLinkLibrary(
Expand All @@ -775,7 +779,9 @@ clang_experimental_DepGraphModuleLinkLibrarySet_getLinkLibrary(
* Get the `Library` string from the \c CXDepGraphModuleLinkLibrary instance.
* `Library` could be a library name, or an absolute path to a library or a
* framework, as specified in the corresponding \c CXDepGraphModule instance's
* modulemap.
* modulemap. The returned \c CXString is a reference to a string owned
* by the \c CXDepGraphModule instance, and has the same lifetime as the
* the \c CXDepGraphModule instance.
*/
CINDEX_LINKAGE CXString clang_experimental_DepGraphModuleLinkLibrary_getLibrary(
CXDepGraphModuleLinkLibrary);
Expand Down