mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-16 08:08:01 +00:00
Replace a hand rolled loop with a lovely StringRef helper we have these
days. No functionality changed. llvm-svn: 151048
This commit is contained in:
parent
b2adf74ff3
commit
22537f932d
@ -335,10 +335,7 @@ Triple::Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr,
|
||||
std::string Triple::normalize(StringRef Str) {
|
||||
// Parse into components.
|
||||
SmallVector<StringRef, 4> Components;
|
||||
for (size_t First = 0, Last = 0; Last != StringRef::npos; First = Last + 1) {
|
||||
Last = Str.find('-', First);
|
||||
Components.push_back(Str.slice(First, Last));
|
||||
}
|
||||
Str.split(Components, "-");
|
||||
|
||||
// If the first component corresponds to a known architecture, preferentially
|
||||
// use it for the architecture. If the second component corresponds to a
|
||||
|
Loading…
Reference in New Issue
Block a user