1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Implement a method for inline asm support

llvm-svn: 25660
This commit is contained in:
Chris Lattner 2006-01-26 20:37:03 +00:00
parent 27ca00bcf7
commit 800999ca4b

View File

@ -13,7 +13,9 @@
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/MRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/ADT/StringExtras.h"
using namespace llvm;
TargetLowering::TargetLowering(TargetMachine &tm)
@ -132,3 +134,18 @@ bool TargetLowering::isMaskedValueZeroForTargetNode(const SDOperand &Op,
uint64_t Mask) const {
return false;
}
std::vector<unsigned> TargetLowering::
getRegForInlineAsmConstraint(const std::string &Constraint) const {
// Scan to see if this constraint is a register name.
const MRegisterInfo *RI = TM.getRegisterInfo();
for (unsigned i = 1, e = RI->getNumRegs(); i != e; ++i) {
if (const char *Name = RI->get(i).Name)
if (StringsEqualNoCase(Constraint, Name))
return std::vector<unsigned>(1, i);
}
// Not a physreg, must not be a register reference or something.
return std::vector<unsigned>();
}