mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-30 16:17:05 +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:
@@ -2211,8 +2211,9 @@ SDValue SITargetLowering::CreateLiveInRegister(SelectionDAG &DAG,
|
|||||||
|
|
||||||
std::pair<unsigned, const TargetRegisterClass *>
|
std::pair<unsigned, const TargetRegisterClass *>
|
||||||
SITargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
|
SITargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
|
||||||
const std::string &Constraint,
|
const std::string &Constraint_,
|
||||||
MVT VT) const {
|
MVT VT) const {
|
||||||
|
StringRef Constraint(Constraint_);
|
||||||
if (Constraint == "r") {
|
if (Constraint == "r") {
|
||||||
switch(VT.SimpleTy) {
|
switch(VT.SimpleTy) {
|
||||||
default: llvm_unreachable("Unhandled type for 'r' inline asm constraint");
|
default: llvm_unreachable("Unhandled type for 'r' inline asm constraint");
|
||||||
@@ -2232,8 +2233,9 @@ SITargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (RC) {
|
if (RC) {
|
||||||
unsigned Idx = std::atoi(Constraint.substr(2).c_str());
|
uint32_t Idx;
|
||||||
if (Idx < RC->getNumRegs())
|
bool Failed = Constraint.substr(2).getAsInteger(10, Idx);
|
||||||
|
if (!Failed && Idx < RC->getNumRegs())
|
||||||
return std::make_pair(RC->getRegister(Idx), RC);
|
return std::make_pair(RC->getRegister(Idx), RC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user