summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-06-30 20:59:49 +0000
committerDan Gohman <gohman@apple.com>2008-06-30 20:59:49 +0000
commit5c73a886b49a4d2c5bee50d1b247400392a8b44d (patch)
tree3c1de578d253ce881a1fc5d5544bdac5464914b6 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent0711d68fa77df0cd4e4882d98b27541cccbb4468 (diff)
downloadbcm5719-llvm-5c73a886b49a4d2c5bee50d1b247400392a8b44d.tar.gz
bcm5719-llvm-5c73a886b49a4d2c5bee50d1b247400392a8b44d.zip
Rename ISD::LOCATION to ISD::DBG_STOPPOINT to better reflect its
purpose, and give it a custom SDNode subclass so that it doesn't need to have line number, column number, filename string, and directory string, all existing as individual SDNodes to be the operands. This was the only user of ISD::STRING, StringSDNode, etc., so remove those and some associated code. This makes stop-points considerably easier to read in -view-legalize-dags output, and reduces overhead (creating new nodes and copying std::strings into them) on code containing debugging information. llvm-svn: 52924
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp42
1 files changed, 27 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 6456fa30e3f..c364e1f737d 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -382,6 +382,13 @@ static void AddNodeIDNode(FoldingSetNodeID &ID, SDNode *N) {
case ISD::Register:
ID.AddInteger(cast<RegisterSDNode>(N)->getReg());
break;
+ case ISD::DBG_STOPPOINT: {
+ const DbgStopPointSDNode *DSP = cast<DbgStopPointSDNode>(N);
+ ID.AddInteger(DSP->getLine());
+ ID.AddInteger(DSP->getColumn());
+ ID.AddPointer(DSP->getCompileUnit());
+ break;
+ }
case ISD::SRCVALUE:
ID.AddPointer(cast<SrcValueSDNode>(N)->getValue());
break;
@@ -575,9 +582,6 @@ void SelectionDAG::RemoveNodeFromCSEMaps(SDNode *N) {
bool Erased = false;
switch (N->getOpcode()) {
case ISD::HANDLENODE: return; // noop.
- case ISD::STRING:
- Erased = StringNodes.erase(cast<StringSDNode>(N)->getValue());
- break;
case ISD::CONDCODE:
assert(CondCodeNodes[cast<CondCodeSDNode>(N)->get()] &&
"Cond code doesn't exist!");
@@ -738,15 +742,6 @@ SDOperand SelectionDAG::getZeroExtendInReg(SDOperand Op, MVT VT) {
getConstant(Imm, Op.getValueType()));
}
-SDOperand SelectionDAG::getString(const std::string &Val) {
- StringSDNode *&N = StringNodes[Val];
- if (!N) {
- N = new StringSDNode(Val);
- AllNodes.push_back(N);
- }
- return SDOperand(N, 0);
-}
-
SDOperand SelectionDAG::getConstant(uint64_t Val, MVT VT, bool isT) {
MVT EltVT = VT.isVector() ? VT.getVectorElementType() : VT;
return getConstant(APInt(EltVT.getSizeInBits(), Val), VT, isT);
@@ -1005,6 +1000,24 @@ SDOperand SelectionDAG::getRegister(unsigned RegNo, MVT VT) {
return SDOperand(N, 0);
}
+SDOperand SelectionDAG::getDbgStopPoint(SDOperand Root,
+ unsigned Line, unsigned Col,
+ const CompileUnitDesc *CU) {
+ FoldingSetNodeID ID;
+ SDOperand Ops[] = { Root };
+ AddNodeIDNode(ID, ISD::DBG_STOPPOINT, getVTList(MVT::Other), &Ops[0], 1);
+ ID.AddInteger(Line);
+ ID.AddInteger(Col);
+ ID.AddPointer(CU);
+ void *IP = 0;
+ if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
+ return SDOperand(E, 0);
+ SDNode *N = new DbgStopPointSDNode(Root, Line, Col, CU);
+ CSEMap.InsertNode(N, IP);
+ AllNodes.push_back(N);
+ return SDOperand(N, 0);
+}
+
SDOperand SelectionDAG::getSrcValue(const Value *V) {
assert((!V || isa<PointerType>(V->getType())) &&
"SrcValue is not a pointer?");
@@ -4178,7 +4191,6 @@ void UnarySDNode::ANCHOR() {}
void BinarySDNode::ANCHOR() {}
void TernarySDNode::ANCHOR() {}
void HandleSDNode::ANCHOR() {}
-void StringSDNode::ANCHOR() {}
void ConstantSDNode::ANCHOR() {}
void ConstantFPSDNode::ANCHOR() {}
void GlobalAddressSDNode::ANCHOR() {}
@@ -4189,6 +4201,7 @@ void BasicBlockSDNode::ANCHOR() {}
void SrcValueSDNode::ANCHOR() {}
void MemOperandSDNode::ANCHOR() {}
void RegisterSDNode::ANCHOR() {}
+void DbgStopPointSDNode::ANCHOR() {}
void ExternalSymbolSDNode::ANCHOR() {}
void CondCodeSDNode::ANCHOR() {}
void ARG_FLAGSSDNode::ANCHOR() {}
@@ -4463,7 +4476,6 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const {
case ISD::AssertSext: return "AssertSext";
case ISD::AssertZext: return "AssertZext";
- case ISD::STRING: return "String";
case ISD::BasicBlock: return "BasicBlock";
case ISD::ARG_FLAGS: return "ArgFlags";
case ISD::VALUETYPE: return "ValueType";
@@ -4624,7 +4636,7 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const {
case ISD::CTLZ: return "ctlz";
// Debug info
- case ISD::LOCATION: return "location";
+ case ISD::DBG_STOPPOINT: return "dbg_stoppoint";
case ISD::DEBUG_LOC: return "debug_loc";
// Trampolines
OpenPOWER on IntegriCloud