summaryrefslogtreecommitdiff
path: root/llvm/lib/IR/InlineAsm.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
commitcfca06d7963fa0909f90483b42a6d7d194d01e08 (patch)
tree209fb2a2d68f8f277793fc8df46c753d31bc853b /llvm/lib/IR/InlineAsm.cpp
parent706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff)
Notes
Diffstat (limited to 'llvm/lib/IR/InlineAsm.cpp')
-rw-r--r--llvm/lib/IR/InlineAsm.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/IR/InlineAsm.cpp b/llvm/lib/IR/InlineAsm.cpp
index fd732f9eda8b..ee30b92522d0 100644
--- a/llvm/lib/IR/InlineAsm.cpp
+++ b/llvm/lib/IR/InlineAsm.cpp
@@ -136,14 +136,14 @@ bool InlineAsm::ConstraintInfo::Parse(StringRef Str,
// Find the end of the register name.
StringRef::iterator ConstraintEnd = std::find(I+1, E, '}');
if (ConstraintEnd == E) return true; // "{foo"
- pCodes->push_back(StringRef(I, ConstraintEnd+1 - I));
+ pCodes->push_back(std::string(StringRef(I, ConstraintEnd + 1 - I)));
I = ConstraintEnd+1;
} else if (isdigit(static_cast<unsigned char>(*I))) { // Matching Constraint
// Maximal munch numbers.
StringRef::iterator NumStart = I;
while (I != E && isdigit(static_cast<unsigned char>(*I)))
++I;
- pCodes->push_back(StringRef(NumStart, I - NumStart));
+ pCodes->push_back(std::string(StringRef(NumStart, I - NumStart)));
unsigned N = atoi(pCodes->back().c_str());
// Check that this is a valid matching constraint!
if (N >= ConstraintsSoFar.size() || ConstraintsSoFar[N].Type != isOutput||
@@ -179,7 +179,7 @@ bool InlineAsm::ConstraintInfo::Parse(StringRef Str,
} else if (*I == '^') {
// Multi-letter constraint
// FIXME: For now assuming these are 2-character constraints.
- pCodes->push_back(StringRef(I+1, 2));
+ pCodes->push_back(std::string(StringRef(I + 1, 2)));
I += 3;
} else if (*I == '@') {
// Multi-letter constraint
@@ -189,11 +189,11 @@ bool InlineAsm::ConstraintInfo::Parse(StringRef Str,
int N = C - '0';
assert(N > 0 && "Found a zero letter constraint!");
++I;
- pCodes->push_back(StringRef(I, N));
+ pCodes->push_back(std::string(StringRef(I, N)));
I += N;
} else {
// Single letter constraint.
- pCodes->push_back(StringRef(I, 1));
+ pCodes->push_back(std::string(StringRef(I, 1)));
++I;
}
}