mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 05:22:04 +00:00
Rename CreateRegForValue to CreateReg, and change its argument
from a Value to a Type, because it doesn't actually care about the Value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107383 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -176,23 +176,23 @@ unsigned FunctionLoweringInfo::MakeReg(EVT VT) {
|
||||
return RegInfo->createVirtualRegister(TLI.getRegClassFor(VT));
|
||||
}
|
||||
|
||||
/// CreateRegForValue - Allocate the appropriate number of virtual registers of
|
||||
/// CreateReg - Allocate the appropriate number of virtual registers of
|
||||
/// the correctly promoted or expanded types. Assign these registers
|
||||
/// consecutive vreg numbers and return the first assigned number.
|
||||
///
|
||||
/// In the case that the given value has struct or array type, this function
|
||||
/// will assign registers for each member or element.
|
||||
///
|
||||
unsigned FunctionLoweringInfo::CreateRegForValue(const Value *V) {
|
||||
unsigned FunctionLoweringInfo::CreateReg(const Type *Ty) {
|
||||
SmallVector<EVT, 4> ValueVTs;
|
||||
ComputeValueVTs(TLI, V->getType(), ValueVTs);
|
||||
ComputeValueVTs(TLI, Ty, ValueVTs);
|
||||
|
||||
unsigned FirstReg = 0;
|
||||
for (unsigned Value = 0, e = ValueVTs.size(); Value != e; ++Value) {
|
||||
EVT ValueVT = ValueVTs[Value];
|
||||
EVT RegisterVT = TLI.getRegisterType(V->getContext(), ValueVT);
|
||||
EVT RegisterVT = TLI.getRegisterType(Ty->getContext(), ValueVT);
|
||||
|
||||
unsigned NumRegs = TLI.getNumRegisters(V->getContext(), ValueVT);
|
||||
unsigned NumRegs = TLI.getNumRegisters(Ty->getContext(), ValueVT);
|
||||
for (unsigned i = 0; i != NumRegs; ++i) {
|
||||
unsigned R = MakeReg(RegisterVT);
|
||||
if (!FirstReg) FirstReg = R;
|
||||
|
||||
Reference in New Issue
Block a user