aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/SelectionDAGNodes.h
diff options
context:
space:
mode:
authorjohannes <johannes@91177308-0d34-0410-b5e6-96231b3b80d8>2009-01-27 21:41:04 +0000
committerjohannes <johannes@91177308-0d34-0410-b5e6-96231b3b80d8>2009-01-27 21:41:04 +0000
commit1d9b80d687b78326c31f507ef57994eb44008303 (patch)
treeef8a2f424a0484686e134d30eed851d09a00c8bc /include/llvm/CodeGen/SelectionDAGNodes.h
parentc611f1d881c25889d6343c0bd41ea73a5157ae66 (diff)
downloadexternal_llvm-1d9b80d687b78326c31f507ef57994eb44008303.zip
external_llvm-1d9b80d687b78326c31f507ef57994eb44008303.tar.gz
external_llvm-1d9b80d687b78326c31f507ef57994eb44008303.tar.bz2
Add DebugLoc field and simple accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63136 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAGNodes.h')
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h47
1 files changed, 44 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index 7a5cd3b..f1cd6c0 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -30,6 +30,7 @@
#include "llvm/Support/Allocator.h"
#include "llvm/Support/RecyclingAllocator.h"
#include "llvm/Support/DataTypes.h"
+#include "llvm/CodeGen/DebugLoc.h"
#include <cassert>
namespace llvm {
@@ -901,6 +902,7 @@ public:
inline bool isTargetOpcode() const;
inline bool isMachineOpcode() const;
inline unsigned getMachineOpcode() const;
+ inline DebugLoc getDebugLoc() const;
/// reachesChainWithoutSideEffects - Return true if this operand (which must
@@ -1077,6 +1079,9 @@ private:
/// NodeId - Unique id per SDNode in the DAG.
int NodeId;
+ /// debugLoc - source line information.
+ DebugLoc debugLoc;
+
/// OperandList - The values that are used by this operation.
///
SDUse *OperandList;
@@ -1146,6 +1151,12 @@ public:
/// setNodeId - Set unique node id.
void setNodeId(int Id) { NodeId = Id; }
+ /// getDebugLoc - Return the source location info.
+ DebugLoc getDebugLoc() const { return debugLoc; }
+
+ /// setDebugLoc - Set source location info.
+ void setDebugLoc(DebugLoc sl) { debugLoc = sl; }
+
/// use_iterator - This class provides iterator support for SDUse
/// operands that use a specific SDNode.
class use_iterator
@@ -1326,9 +1337,11 @@ protected:
return Ret;
}
+ /// The constructors that supply DebugLoc explicitly should be preferred
+ /// for new code.
SDNode(unsigned Opc, SDVTList VTs, const SDValue *Ops, unsigned NumOps)
: NodeType(Opc), OperandsNeedDelete(true), SubclassData(0),
- NodeId(-1),
+ NodeId(-1), debugLoc(DebugLoc::getNoDebugLoc()),
OperandList(NumOps ? new SDUse[NumOps] : 0),
ValueList(VTs.VTs),
NumOperands(NumOps), NumValues(VTs.NumVTs),
@@ -1343,8 +1356,33 @@ protected:
/// set later with InitOperands.
SDNode(unsigned Opc, SDVTList VTs)
: NodeType(Opc), OperandsNeedDelete(false), SubclassData(0),
- NodeId(-1), OperandList(0), ValueList(VTs.VTs),
- NumOperands(0), NumValues(VTs.NumVTs),
+ NodeId(-1), debugLoc(DebugLoc::getNoDebugLoc()), OperandList(0),
+ ValueList(VTs.VTs), NumOperands(0), NumValues(VTs.NumVTs),
+ UseList(NULL) {}
+
+ /// The next two constructors specify DebugLoc explicitly; the intent
+ /// is that they will replace the above two over time, and eventually
+ /// the ones above can be removed.
+ SDNode(unsigned Opc, SDVTList VTs, const SDValue *Ops, unsigned NumOps,
+ DebugLoc sl)
+ : NodeType(Opc), OperandsNeedDelete(true), SubclassData(0),
+ NodeId(-1), debugLoc(sl),
+ OperandList(NumOps ? new SDUse[NumOps] : 0),
+ ValueList(VTs.VTs),
+ NumOperands(NumOps), NumValues(VTs.NumVTs),
+ UseList(NULL) {
+ for (unsigned i = 0; i != NumOps; ++i) {
+ OperandList[i].setUser(this);
+ OperandList[i].setInitial(Ops[i]);
+ }
+ }
+
+ /// This constructor adds no operands itself; operands can be
+ /// set later with InitOperands.
+ SDNode(unsigned Opc, SDVTList VTs, DebugLoc sl)
+ : NodeType(Opc), OperandsNeedDelete(false), SubclassData(0),
+ NodeId(-1), debugLoc(sl), OperandList(0),
+ ValueList(VTs.VTs), NumOperands(0), NumValues(VTs.NumVTs),
UseList(NULL) {}
/// InitOperands - Initialize the operands list of this with 1 operand.
@@ -1441,6 +1479,9 @@ inline bool SDValue::use_empty() const {
inline bool SDValue::hasOneUse() const {
return Node->hasNUsesOfValue(1, ResNo);
}
+inline DebugLoc SDValue::getDebugLoc() const {
+ return Node->getDebugLoc();
+}
// Define inline functions from the SDUse class.