libclang: introduce cxstring::{createRef,createDup} for C strings
Also migrate all clients from the old API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174238 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/CXString.h b/tools/libclang/CXString.h
index 0688712..3b86826 100644
--- a/tools/libclang/CXString.h
+++ b/tools/libclang/CXString.h
@@ -33,8 +33,17 @@
/// A NULL string should be used as an "invalid" value in case of errors.
CXString createNull();
-/// \brief Create a CXString object from a C string.
-CXString createCXString(const char *String, bool DupString = false);
+/// \brief Create a CXString object from a nul-terminated C string. New
+/// CXString may contain a pointer to \p String.
+///
+/// \p String should not be changed by the caller afterwards.
+CXString createRef(const char *String);
+
+/// \brief Create a CXString object from a nul-terminated C string. New
+/// CXString will contain a copy of \p String.
+///
+/// \p String can be changed or freed by the caller.
+CXString createDup(const char *String);
/// \brief Create a CXString object from a StringRef.
CXString createCXString(StringRef String, bool DupString = true);