diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-02-21 09:12:48 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-02-21 09:12:48 +0000 |
commit | 6ea6de7cadfbf59f0bf2956dedceea0760aedae6 (patch) | |
tree | 93b86aa1f9b681b81948c372f80cb12013653acc /llvm/lib/Support | |
parent | aec9708988129d7e483bc01b419d612968fbf7ef (diff) | |
download | bcm5719-llvm-6ea6de7cadfbf59f0bf2956dedceea0760aedae6.tar.gz bcm5719-llvm-6ea6de7cadfbf59f0bf2956dedceea0760aedae6.zip |
Replace a hand rolled loop with a lovely StringRef helper we have these
days. No functionality changed.
llvm-svn: 151048
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r-- | llvm/lib/Support/Triple.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp index 11cbb5f6c1b..72f31314517 100644 --- a/llvm/lib/Support/Triple.cpp +++ b/llvm/lib/Support/Triple.cpp @@ -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 |