mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
Cosmetic: lengthen names and improve comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98202 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fbacc888ee
commit
e3b8533e71
@ -508,7 +508,7 @@ InstrEmitter::EmitDbgValue(SDNode *Node,
|
|||||||
return;
|
return;
|
||||||
if (!sd)
|
if (!sd)
|
||||||
return;
|
return;
|
||||||
assert(sd->getKind() == SDDbgValue::SD);
|
assert(sd->getKind() == SDDbgValue::SDNODE);
|
||||||
unsigned VReg = getVR(SDValue(sd->getSDNode(), sd->getResNo()), VRBaseMap);
|
unsigned VReg = getVR(SDValue(sd->getSDNode(), sd->getResNo()), VRBaseMap);
|
||||||
const TargetInstrDesc &II = TII->get(TargetOpcode::DBG_VALUE);
|
const TargetInstrDesc &II = TII->get(TargetOpcode::DBG_VALUE);
|
||||||
DebugLoc DL = sd->getDebugLoc();
|
DebugLoc DL = sd->getDebugLoc();
|
||||||
@ -537,7 +537,7 @@ InstrEmitter::EmitDbgValue(SDDbgValue *sd,
|
|||||||
SDDbgValue::DbgValueKind kind = sd->getKind();
|
SDDbgValue::DbgValueKind kind = sd->getKind();
|
||||||
DebugLoc DL = sd->getDebugLoc();
|
DebugLoc DL = sd->getDebugLoc();
|
||||||
MachineInstr* MI;
|
MachineInstr* MI;
|
||||||
if (kind == SDDbgValue::CNST) {
|
if (kind == SDDbgValue::CONST) {
|
||||||
Value *V = sd->getConst();
|
Value *V = sd->getConst();
|
||||||
if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
|
if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
|
||||||
MI = BuildMI(*MF, DL, II).addImm(CI->getZExtValue()).
|
MI = BuildMI(*MF, DL, II).addImm(CI->getZExtValue()).
|
||||||
@ -551,7 +551,7 @@ InstrEmitter::EmitDbgValue(SDDbgValue *sd,
|
|||||||
MI = BuildMI(*MF, DL, II).addReg(0U).
|
MI = BuildMI(*MF, DL, II).addReg(0U).
|
||||||
addImm(Offset).addMetadata(mdPtr);
|
addImm(Offset).addMetadata(mdPtr);
|
||||||
}
|
}
|
||||||
} else if (kind == SDDbgValue::FX) {
|
} else if (kind == SDDbgValue::FRAMEIX) {
|
||||||
unsigned FrameIx = sd->getFrameIx();
|
unsigned FrameIx = sd->getFrameIx();
|
||||||
// Stack address; this needs to be lowered in target-dependent fashion.
|
// Stack address; this needs to be lowered in target-dependent fashion.
|
||||||
// FIXME test that the target supports this somehow; if not emit Undef.
|
// FIXME test that the target supports this somehow; if not emit Undef.
|
||||||
|
@ -24,22 +24,21 @@ class SDNode;
|
|||||||
class Value;
|
class Value;
|
||||||
|
|
||||||
/// SDDbgValue - Holds the information from a dbg_value node through SDISel.
|
/// SDDbgValue - Holds the information from a dbg_value node through SDISel.
|
||||||
/// Either Const or Node is nonzero, but not both.
|
|
||||||
/// We do not use SDValue here to avoid including its header.
|
/// We do not use SDValue here to avoid including its header.
|
||||||
|
|
||||||
class SDDbgValue {
|
class SDDbgValue {
|
||||||
public:
|
public:
|
||||||
enum DbgValueKind {
|
enum DbgValueKind {
|
||||||
SD = 0,
|
SDNODE = 0, // value is the result of an expression
|
||||||
CNST = 1,
|
CONST = 1, // value is a constant
|
||||||
FX = 2
|
FRAMEIX = 2 // value is contents of a stack location
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
enum DbgValueKind kind;
|
enum DbgValueKind kind;
|
||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
SDNode *Node; // valid for non-constants
|
SDNode *Node; // valid for expressions
|
||||||
unsigned ResNo; // valid for non-constants
|
unsigned ResNo; // valid for expressions
|
||||||
} s;
|
} s;
|
||||||
Value *Const; // valid for constants
|
Value *Const; // valid for constants
|
||||||
unsigned FrameIx; // valid for stack objects
|
unsigned FrameIx; // valid for stack objects
|
||||||
@ -52,7 +51,7 @@ public:
|
|||||||
// Constructor for non-constants.
|
// Constructor for non-constants.
|
||||||
SDDbgValue(MDNode *mdP, SDNode *N, unsigned R, uint64_t off, DebugLoc dl,
|
SDDbgValue(MDNode *mdP, SDNode *N, unsigned R, uint64_t off, DebugLoc dl,
|
||||||
unsigned O) : mdPtr(mdP), Offset(off), DL(dl), Order(O) {
|
unsigned O) : mdPtr(mdP), Offset(off), DL(dl), Order(O) {
|
||||||
kind = SD;
|
kind = SDNODE;
|
||||||
u.s.Node = N;
|
u.s.Node = N;
|
||||||
u.s.ResNo = R;
|
u.s.ResNo = R;
|
||||||
}
|
}
|
||||||
@ -60,14 +59,14 @@ public:
|
|||||||
// Constructor for constants.
|
// Constructor for constants.
|
||||||
SDDbgValue(MDNode *mdP, Value *C, uint64_t off, DebugLoc dl, unsigned O) :
|
SDDbgValue(MDNode *mdP, Value *C, uint64_t off, DebugLoc dl, unsigned O) :
|
||||||
mdPtr(mdP), Offset(off), DL(dl), Order(O) {
|
mdPtr(mdP), Offset(off), DL(dl), Order(O) {
|
||||||
kind = CNST;
|
kind = CONST;
|
||||||
u.Const = C;
|
u.Const = C;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Constructor for frame indices.
|
// Constructor for frame indices.
|
||||||
SDDbgValue(MDNode *mdP, unsigned FI, uint64_t off, DebugLoc dl, unsigned O) :
|
SDDbgValue(MDNode *mdP, unsigned FI, uint64_t off, DebugLoc dl, unsigned O) :
|
||||||
mdPtr(mdP), Offset(off), DL(dl), Order(O) {
|
mdPtr(mdP), Offset(off), DL(dl), Order(O) {
|
||||||
kind = FX;
|
kind = FRAMEIX;
|
||||||
u.FrameIx = FI;
|
u.FrameIx = FI;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,16 +77,16 @@ public:
|
|||||||
MDNode *getMDPtr() { return mdPtr; }
|
MDNode *getMDPtr() { return mdPtr; }
|
||||||
|
|
||||||
// Returns the SDNode* for a register ref
|
// Returns the SDNode* for a register ref
|
||||||
SDNode *getSDNode() { assert (kind==SD); return u.s.Node; }
|
SDNode *getSDNode() { assert (kind==SDNODE); return u.s.Node; }
|
||||||
|
|
||||||
// Returns the ResNo for a register ref
|
// Returns the ResNo for a register ref
|
||||||
unsigned getResNo() { assert (kind==SD); return u.s.ResNo; }
|
unsigned getResNo() { assert (kind==SDNODE); return u.s.ResNo; }
|
||||||
|
|
||||||
// Returns the Value* for a constant
|
// Returns the Value* for a constant
|
||||||
Value *getConst() { assert (kind==CNST); return u.Const; }
|
Value *getConst() { assert (kind==CONST); return u.Const; }
|
||||||
|
|
||||||
// Returns the FrameIx for a stack object
|
// Returns the FrameIx for a stack object
|
||||||
unsigned getFrameIx() { assert (kind==FX); return u.FrameIx; }
|
unsigned getFrameIx() { assert (kind==FRAMEIX); return u.FrameIx; }
|
||||||
|
|
||||||
// Returns the offset.
|
// Returns the offset.
|
||||||
uint64_t getOffset() { return Offset; }
|
uint64_t getOffset() { return Offset; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user