2010-03-06 00:03:23 +00:00
|
|
|
//===-- llvm/CodeGen/SDDbgValue.h - SD dbg_value handling--------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares the SDDbgValue class.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CODEGEN_SDDBGVALUE_H
|
|
|
|
#define LLVM_CODEGEN_SDDBGVALUE_H
|
|
|
|
|
|
|
|
#include "llvm/ADT/SmallVector.h"
|
|
|
|
#include "llvm/Support/DebugLoc.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class MDNode;
|
|
|
|
class SDNode;
|
|
|
|
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 {
|
|
|
|
SDNode *Node; // valid for non-constants
|
|
|
|
unsigned ResNo; // valid for non-constants
|
|
|
|
Value *Const; // valid for constants
|
|
|
|
MDNode *mdPtr;
|
|
|
|
uint64_t Offset;
|
|
|
|
DebugLoc DL;
|
2010-03-08 05:39:50 +00:00
|
|
|
unsigned Order;
|
2010-03-06 00:03:23 +00:00
|
|
|
public:
|
|
|
|
// Constructor for non-constants.
|
2010-03-08 05:39:50 +00:00
|
|
|
SDDbgValue(MDNode *mdP, SDNode *N, unsigned R, uint64_t off, DebugLoc dl,
|
|
|
|
unsigned O) :
|
|
|
|
Node(N), ResNo(R), Const(0), mdPtr(mdP), Offset(off), DL(dl), Order(O) {}
|
2010-03-06 00:03:23 +00:00
|
|
|
|
|
|
|
// Constructor for constants.
|
2010-03-08 05:39:50 +00:00
|
|
|
SDDbgValue(MDNode *mdP, Value *C, uint64_t off, DebugLoc dl, unsigned O) :
|
|
|
|
Node(0), ResNo(0), Const(C), mdPtr(mdP), Offset(off), DL(dl), Order(O) {}
|
2010-03-06 00:03:23 +00:00
|
|
|
|
|
|
|
// Returns the MDNode pointer.
|
|
|
|
MDNode *getMDPtr() { return mdPtr; }
|
|
|
|
|
|
|
|
// Returns the SDNode* (valid for non-constants only).
|
|
|
|
SDNode *getSDNode() { assert (!Const); return Node; }
|
|
|
|
|
|
|
|
// Returns the ResNo (valid for non-constants only).
|
|
|
|
unsigned getResNo() { assert (!Const); return ResNo; }
|
|
|
|
|
|
|
|
// Returns the Value* for a constant (invalid for non-constants).
|
|
|
|
Value *getConst() { assert (!Node); return Const; }
|
|
|
|
|
|
|
|
// Returns the offset.
|
|
|
|
uint64_t getOffset() { return Offset; }
|
|
|
|
|
|
|
|
// Returns the DebugLoc.
|
|
|
|
DebugLoc getDebugLoc() { return DL; }
|
2010-03-08 05:39:50 +00:00
|
|
|
|
|
|
|
// Returns the SDNodeOrder. This is the order of the preceding node in the
|
|
|
|
// input.
|
|
|
|
unsigned getOrder() { return Order; }
|
2010-03-06 00:03:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end llvm namespace
|
|
|
|
|
|
|
|
#endif
|