[llvm] r237997 - SDAG: Cleanup initialization of SDDbgValue, NFC
Duncan P. N. Exon Smith
dexonsmith at apple.com
Thu May 21 22:35:53 PDT 2015
Author: dexonsmith
Date: Fri May 22 00:35:53 2015
New Revision: 237997
URL: http://llvm.org/viewvc/llvm-project?rev=237997&view=rev
Log:
SDAG: Cleanup initialization of SDDbgValue, NFC
Cleanup how `SDDbgValue` is initialized, and rearrange the fields to
save two pointers in the struct layout. No real functionality change
though (and I doubt the memory savings would show up in a profile).
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h?rev=237997&r1=237996&r2=237997&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h Fri May 22 00:35:53 2015
@@ -35,7 +35,6 @@ public:
FRAMEIX = 2 // value is contents of a stack location
};
private:
- enum DbgValueKind kind;
union {
struct {
SDNode *Node; // valid for expressions
@@ -46,17 +45,18 @@ private:
} u;
MDNode *Var;
MDNode *Expr;
- bool IsIndirect;
uint64_t Offset;
DebugLoc DL;
unsigned Order;
- bool Invalid;
+ enum DbgValueKind kind;
+ bool IsIndirect;
+ bool Invalid = false;
+
public:
// Constructor for non-constants.
SDDbgValue(MDNode *Var, MDNode *Expr, SDNode *N, unsigned R, bool indir,
uint64_t off, DebugLoc dl, unsigned O)
- : Var(Var), Expr(Expr), IsIndirect(indir), Offset(off), DL(dl), Order(O),
- Invalid(false) {
+ : Var(Var), Expr(Expr), Offset(off), DL(dl), Order(O), IsIndirect(indir) {
kind = SDNODE;
u.s.Node = N;
u.s.ResNo = R;
@@ -65,8 +65,7 @@ public:
// Constructor for constants.
SDDbgValue(MDNode *Var, MDNode *Expr, const Value *C, uint64_t off,
DebugLoc dl, unsigned O)
- : Var(Var), Expr(Expr), IsIndirect(false), Offset(off), DL(dl), Order(O),
- Invalid(false) {
+ : Var(Var), Expr(Expr), Offset(off), DL(dl), Order(O), IsIndirect(false) {
kind = CONST;
u.Const = C;
}
@@ -74,8 +73,7 @@ public:
// Constructor for frame indices.
SDDbgValue(MDNode *Var, MDNode *Expr, unsigned FI, uint64_t off, DebugLoc dl,
unsigned O)
- : Var(Var), Expr(Expr), IsIndirect(false), Offset(off), DL(dl), Order(O),
- Invalid(false) {
+ : Var(Var), Expr(Expr), Offset(off), DL(dl), Order(O), IsIndirect(false) {
kind = FRAMEIX;
u.FrameIx = FI;
}
More information about the llvm-commits
mailing list