mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-16 05:01:56 +00:00
Simplify string operations. NFC.
llvm-svn: 262569
This commit is contained in:
parent
05a6333842
commit
6b500dc5f9
@ -35,22 +35,15 @@ StringRef getLLDRevision() {
|
||||
}
|
||||
|
||||
std::string getLLDRepositoryVersion() {
|
||||
std::string buf;
|
||||
llvm::raw_string_ostream OS(buf);
|
||||
std::string Path = getLLDRepositoryPath();
|
||||
std::string Revision = getLLDRevision();
|
||||
if (!Path.empty() || !Revision.empty()) {
|
||||
OS << '(';
|
||||
if (!Path.empty())
|
||||
OS << Path;
|
||||
if (!Revision.empty()) {
|
||||
if (!Path.empty())
|
||||
OS << ' ';
|
||||
OS << Revision;
|
||||
}
|
||||
OS << ')';
|
||||
}
|
||||
return OS.str();
|
||||
std::string S = getLLDRepositoryPath();
|
||||
std::string T = getLLDRevision();
|
||||
if (S.empty() && T.empty())
|
||||
return "";
|
||||
if (!S.empty() && !T.empty())
|
||||
return "(" + S + " " + T + ")";
|
||||
if (!S.empty())
|
||||
return "(" + S + ")";
|
||||
return "(" + T + ")";
|
||||
}
|
||||
|
||||
StringRef getLLDVersion() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user