Skip to content

Commit f769d63

Browse files
smeenaiMForster
authored andcommitted
[SourceKit] Adjust for LLVM StringRef change (swiftlang#29625)
StringRef needs an explicit conversion to std::string now.
1 parent 259d78a commit f769d63

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tools/SourceKit/tools/sourcekitd/bin/InProc/sourcekitdInProc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ std::string sourcekitd::getRuntimeLibPath() {
9393
llvm_unreachable("call to GetModuleFileNameA failed");
9494
libPath = llvm::sys::path::parent_path(llvm::sys::path::parent_path(path));
9595
llvm::sys::path::append(libPath, "lib");
96-
return libPath.str();
96+
return libPath.str().str();
9797
#else
9898
// This silly cast below avoids a C++ warning.
9999
Dl_info info;

tools/SourceKit/tools/sourcekitd/lib/API/sourcekitdAPI-InProc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ void ResponseBuilder::Dictionary::set(UIdent Key, const char *Str) {
633633

634634
void ResponseBuilder::Dictionary::set(UIdent Key, StringRef Str) {
635635
static_cast<SKDObject *>(Impl)->set(SKDUIDFromUIdent(Key),
636-
new SKDString(Str));
636+
new SKDString(std::string(Str)));
637637
}
638638

639639
void ResponseBuilder::Dictionary::set(UIdent Key, const std::string &Str) {
@@ -649,7 +649,7 @@ void ResponseBuilder::Dictionary::set(SourceKit::UIdent Key,
649649
ArrayRef<StringRef> Strs) {
650650
auto ArrayObject = new SKDArray();
651651
for (auto Str : Strs) {
652-
ArrayObject->set(SOURCEKITD_ARRAY_APPEND, new SKDString(Str));
652+
ArrayObject->set(SOURCEKITD_ARRAY_APPEND, new SKDString(std::string(Str)));
653653
}
654654
static_cast<SKDObject *>(Impl)->set(SKDUIDFromUIdent(Key), ArrayObject);
655655
}

0 commit comments

Comments
 (0)