mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
Replace a hand rolled loop with a lovely StringRef helper we have these
days. No functionality changed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151048 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4fbf658151
commit
dac3d36584
@ -335,10 +335,7 @@ Triple::Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr,
|
|||||||
std::string Triple::normalize(StringRef Str) {
|
std::string Triple::normalize(StringRef Str) {
|
||||||
// Parse into components.
|
// Parse into components.
|
||||||
SmallVector<StringRef, 4> Components;
|
SmallVector<StringRef, 4> Components;
|
||||||
for (size_t First = 0, Last = 0; Last != StringRef::npos; First = Last + 1) {
|
Str.split(Components, "-");
|
||||||
Last = Str.find('-', First);
|
|
||||||
Components.push_back(Str.slice(First, Last));
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the first component corresponds to a known architecture, preferentially
|
// If the first component corresponds to a known architecture, preferentially
|
||||||
// use it for the architecture. If the second component corresponds to a
|
// use it for the architecture. If the second component corresponds to a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user