File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,8 @@ CXString createCXString(CXStringBuf *buf) {
107107 return Str;
108108}
109109
110- CXStringSet *createSet (const std::vector<std::string> &Strings) {
110+ template <typename StringTy>
111+ static CXStringSet *createSetImpl (const std::vector<StringTy> &Strings) {
111112 CXStringSet *Set = new CXStringSet;
112113 Set->Count = Strings.size ();
113114 Set->Strings = new CXString[Set->Count ];
@@ -116,6 +117,13 @@ CXStringSet *createSet(const std::vector<std::string> &Strings) {
116117 return Set;
117118}
118119
120+ CXStringSet *createSet (const std::vector<std::string> &Strings) {
121+ return createSetImpl (Strings);
122+ }
123+
124+ CXStringSet *createSet (const std::vector<StringRef> &Strings) {
125+ return createSetImpl (Strings);
126+ }
119127
120128// ===----------------------------------------------------------------------===//
121129// String pools.
Original file line number Diff line number Diff line change @@ -67,7 +67,10 @@ CXString createRef(std::string String) = delete;
6767// / Create a CXString object that is backed by a string buffer.
6868CXString createCXString (CXStringBuf *buf);
6969
70+ // / Create a CXStringSet object owns the strings. Such an object should be
71+ // / disposed with clang_disposeStringSet.
7072CXStringSet *createSet (const std::vector<std::string> &Strings);
73+ CXStringSet *createSet (const std::vector<StringRef> &Strings);
7174
7275// / A string pool used for fast allocation/deallocation of strings.
7376class CXStringPool {
You can’t perform that action at this time.
0 commit comments