mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-12 13:30:51 +00:00
AMDGPU: Use getAsInteger instead of atoi
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240365 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c49542e5bb
commit
080d72c9a5
@ -2211,8 +2211,9 @@ SDValue SITargetLowering::CreateLiveInRegister(SelectionDAG &DAG,
|
||||
|
||||
std::pair<unsigned, const TargetRegisterClass *>
|
||||
SITargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
|
||||
const std::string &Constraint,
|
||||
const std::string &Constraint_,
|
||||
MVT VT) const {
|
||||
StringRef Constraint(Constraint_);
|
||||
if (Constraint == "r") {
|
||||
switch(VT.SimpleTy) {
|
||||
default: llvm_unreachable("Unhandled type for 'r' inline asm constraint");
|
||||
@ -2232,8 +2233,9 @@ SITargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
|
||||
}
|
||||
|
||||
if (RC) {
|
||||
unsigned Idx = std::atoi(Constraint.substr(2).c_str());
|
||||
if (Idx < RC->getNumRegs())
|
||||
uint32_t Idx;
|
||||
bool Failed = Constraint.substr(2).getAsInteger(10, Idx);
|
||||
if (!Failed && Idx < RC->getNumRegs())
|
||||
return std::make_pair(RC->getRegister(Idx), RC);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user