[llvm-commits] [llvm] r98202 - in /llvm/trunk/lib/CodeGen/SelectionDAG: InstrEmitter.cpp SDDbgValue.h
Dale Johannesen
dalej at apple.com
Wed Mar 10 15:37:24 PST 2010
Author: johannes
Date: Wed Mar 10 17:37:24 2010
New Revision: 98202
URL: http://llvm.org/viewvc/llvm-project?rev=98202&view=rev
Log:
Cosmetic: lengthen names and improve comments.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SDDbgValue.h
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp?rev=98202&r1=98201&r2=98202&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Wed Mar 10 17:37:24 2010
@@ -508,7 +508,7 @@
return;
if (!sd)
return;
- assert(sd->getKind() == SDDbgValue::SD);
+ assert(sd->getKind() == SDDbgValue::SDNODE);
unsigned VReg = getVR(SDValue(sd->getSDNode(), sd->getResNo()), VRBaseMap);
const TargetInstrDesc &II = TII->get(TargetOpcode::DBG_VALUE);
DebugLoc DL = sd->getDebugLoc();
@@ -537,7 +537,7 @@
SDDbgValue::DbgValueKind kind = sd->getKind();
DebugLoc DL = sd->getDebugLoc();
MachineInstr* MI;
- if (kind == SDDbgValue::CNST) {
+ if (kind == SDDbgValue::CONST) {
Value *V = sd->getConst();
if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
MI = BuildMI(*MF, DL, II).addImm(CI->getZExtValue()).
@@ -551,7 +551,7 @@
MI = BuildMI(*MF, DL, II).addReg(0U).
addImm(Offset).addMetadata(mdPtr);
}
- } else if (kind == SDDbgValue::FX) {
+ } else if (kind == SDDbgValue::FRAMEIX) {
unsigned FrameIx = sd->getFrameIx();
// Stack address; this needs to be lowered in target-dependent fashion.
// FIXME test that the target supports this somehow; if not emit Undef.
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SDDbgValue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SDDbgValue.h?rev=98202&r1=98201&r2=98202&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SDDbgValue.h (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SDDbgValue.h Wed Mar 10 17:37:24 2010
@@ -24,22 +24,21 @@
class Value;
/// 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.
class SDDbgValue {
public:
enum DbgValueKind {
- SD = 0,
- CNST = 1,
- FX = 2
+ SDNODE = 0, // value is the result of an expression
+ CONST = 1, // value is a constant
+ FRAMEIX = 2 // value is contents of a stack location
};
private:
enum DbgValueKind kind;
union {
struct {
- SDNode *Node; // valid for non-constants
- unsigned ResNo; // valid for non-constants
+ SDNode *Node; // valid for expressions
+ unsigned ResNo; // valid for expressions
} s;
Value *Const; // valid for constants
unsigned FrameIx; // valid for stack objects
@@ -52,7 +51,7 @@
// Constructor for non-constants.
SDDbgValue(MDNode *mdP, SDNode *N, unsigned R, uint64_t off, DebugLoc dl,
unsigned O) : mdPtr(mdP), Offset(off), DL(dl), Order(O) {
- kind = SD;
+ kind = SDNODE;
u.s.Node = N;
u.s.ResNo = R;
}
@@ -60,14 +59,14 @@
// Constructor for constants.
SDDbgValue(MDNode *mdP, Value *C, uint64_t off, DebugLoc dl, unsigned O) :
mdPtr(mdP), Offset(off), DL(dl), Order(O) {
- kind = CNST;
+ kind = CONST;
u.Const = C;
}
// Constructor for frame indices.
SDDbgValue(MDNode *mdP, unsigned FI, uint64_t off, DebugLoc dl, unsigned O) :
mdPtr(mdP), Offset(off), DL(dl), Order(O) {
- kind = FX;
+ kind = FRAMEIX;
u.FrameIx = FI;
}
@@ -78,16 +77,16 @@
MDNode *getMDPtr() { return mdPtr; }
// 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
- unsigned getResNo() { assert (kind==SD); return u.s.ResNo; }
+ unsigned getResNo() { assert (kind==SDNODE); return u.s.ResNo; }
// 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
- unsigned getFrameIx() { assert (kind==FX); return u.FrameIx; }
+ unsigned getFrameIx() { assert (kind==FRAMEIX); return u.FrameIx; }
// Returns the offset.
uint64_t getOffset() { return Offset; }
More information about the llvm-commits
mailing list