summaryrefslogtreecommitdiff
path: root/lib/Support/Triple.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-02-21 09:12:48 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-02-21 09:12:48 +0000
commitdac3d36584766a7c00972603598dcdff2f5314d5 (patch)
tree1dbffdd80ac07f33f009d3849ad9061489e46a60 /lib/Support/Triple.cpp
parent4fbf6581514a494c15b82ce2f9b6f79b24216c6f (diff)
downloadllvm-dac3d36584766a7c00972603598dcdff2f5314d5.tar.gz
llvm-dac3d36584766a7c00972603598dcdff2f5314d5.tar.bz2
llvm-dac3d36584766a7c00972603598dcdff2f5314d5.tar.xz
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
Diffstat (limited to 'lib/Support/Triple.cpp')
-rw-r--r--lib/Support/Triple.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp
index 11cbb5f6c1..72f3131451 100644
--- a/lib/Support/Triple.cpp
+++ b/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