Move createCXString() functions out of CIndexer and into the clang::cxstring namespace.
We can much more succinctly refer to these functions this way.
Also change the default behavior of createCXString(StringRef&) to duplicate the
string. This is almost always what we want. The other case is where we pass
a constant c-string, which uses the other version of createCXString().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96423 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/CIndex/CIndexer.h b/tools/CIndex/CIndexer.h
index b83e2b7..d559f13 100644
--- a/tools/CIndex/CIndexer.h
+++ b/tools/CIndex/CIndexer.h
@@ -24,6 +24,13 @@
using namespace clang;
+namespace clang {
+namespace cxstring {
+ CXString createCXString(const char *String, bool DupString = false);
+ CXString createCXString(llvm::StringRef String, bool DupString = true);
+}
+}
+
class CIndexer {
bool UseExternalASTGeneration;
bool OnlyLocalDecls;
@@ -49,10 +56,6 @@
/// \brief Get the path of the clang resource files.
std::string getClangResourcesPath();
-
- static CXString createCXString(const char *String, bool DupString = false);
- static CXString createCXString(llvm::StringRef String,
- bool DupString = false);
};
namespace clang {