Skip to content

Commit

Permalink
[lldb/Symbol] Use StringRef ctor to prevent incorrect overload
Browse files Browse the repository at this point in the history
Use the StringRef constructor instead of toStringRef so we don't end up
with the wrong overload (llvm::toStringRef(bool)).

Fixes PR44736
  • Loading branch information
JDevlieghere committed Jan 31, 2020
1 parent 8fbc7fd commit 574685b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lldb/source/Symbol/TypeSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ TypeSystemMap::GetTypeSystemForLanguage(lldb::LanguageType language,
}
error = llvm::make_error<llvm::StringError>(
"TypeSystem for language " +
llvm::toStringRef(Language::GetNameForLanguageType(language)) +
llvm::StringRef(Language::GetNameForLanguageType(language)) +
" doesn't exist",
llvm::inconvertibleErrorCode());
return std::move(error);
Expand All @@ -256,7 +256,7 @@ TypeSystemMap::GetTypeSystemForLanguage(lldb::LanguageType language,
}
error = llvm::make_error<llvm::StringError>(
"TypeSystem for language " +
llvm::toStringRef(Language::GetNameForLanguageType(language)) +
llvm::StringRef(Language::GetNameForLanguageType(language)) +
" doesn't exist",
llvm::inconvertibleErrorCode());
return std::move(error);
Expand All @@ -266,7 +266,7 @@ TypeSystemMap::GetTypeSystemForLanguage(lldb::LanguageType language,
if (!can_create) {
error = llvm::make_error<llvm::StringError>(
"Unable to find type system for language " +
llvm::toStringRef(Language::GetNameForLanguageType(language)),
llvm::StringRef(Language::GetNameForLanguageType(language)),
llvm::inconvertibleErrorCode());
} else {
// Cache even if we get a shared pointer that contains a null type system
Expand All @@ -279,7 +279,7 @@ TypeSystemMap::GetTypeSystemForLanguage(lldb::LanguageType language,
}
error = llvm::make_error<llvm::StringError>(
"TypeSystem for language " +
llvm::toStringRef(Language::GetNameForLanguageType(language)) +
llvm::StringRef(Language::GetNameForLanguageType(language)) +
" doesn't exist",
llvm::inconvertibleErrorCode());
}
Expand Down Expand Up @@ -308,7 +308,7 @@ TypeSystemMap::GetTypeSystemForLanguage(lldb::LanguageType language,
}
error = llvm::make_error<llvm::StringError>(
"TypeSystem for language " +
llvm::toStringRef(Language::GetNameForLanguageType(language)) +
llvm::StringRef(Language::GetNameForLanguageType(language)) +
" doesn't exist",
llvm::inconvertibleErrorCode());
return std::move(error);
Expand All @@ -325,7 +325,7 @@ TypeSystemMap::GetTypeSystemForLanguage(lldb::LanguageType language,
}
error = llvm::make_error<llvm::StringError>(
"TypeSystem for language " +
llvm::toStringRef(Language::GetNameForLanguageType(language)) +
llvm::StringRef(Language::GetNameForLanguageType(language)) +
" doesn't exist",
llvm::inconvertibleErrorCode());
return std::move(error);
Expand All @@ -335,7 +335,7 @@ TypeSystemMap::GetTypeSystemForLanguage(lldb::LanguageType language,
if (!can_create) {
error = llvm::make_error<llvm::StringError>(
"Unable to find type system for language " +
llvm::toStringRef(Language::GetNameForLanguageType(language)),
llvm::StringRef(Language::GetNameForLanguageType(language)),
llvm::inconvertibleErrorCode());
} else {
// Cache even if we get a shared pointer that contains a null type system
Expand All @@ -348,7 +348,7 @@ TypeSystemMap::GetTypeSystemForLanguage(lldb::LanguageType language,
}
error = llvm::make_error<llvm::StringError>(
"TypeSystem for language " +
llvm::toStringRef(Language::GetNameForLanguageType(language)) +
llvm::StringRef(Language::GetNameForLanguageType(language)) +
" doesn't exist",
llvm::inconvertibleErrorCode());
}
Expand Down

0 comments on commit 574685b

Please sign in to comment.