From 4211e73c4905af413db7524f24414c16a7f69102 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 14 May 2005 06:20:08 +0000 Subject: [PATCH] Add a way to construct an arbitrary node, cleanly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22008 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/SelectionDAG.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h index 26e11b6591c..26e79222172 100644 --- a/include/llvm/CodeGen/SelectionDAG.h +++ b/include/llvm/CodeGen/SelectionDAG.h @@ -130,7 +130,8 @@ public: /// SDNode *getCall(std::vector &RetVals, SDOperand Chain, SDOperand Callee, bool isTailCall = false) { - SDNode *NN = new SDNode(isTailCall ? ISD::TAILCALL : ISD::CALL, Chain, Callee); + SDNode *NN = new SDNode(isTailCall ? ISD::TAILCALL : ISD::CALL, Chain, + Callee); NN->setValueTypes(RetVals); AllNodes.push_back(NN); return NN; @@ -140,7 +141,8 @@ public: /// where arguments are passed in physical registers. This destroys the /// RetVals and ArgsInRegs vectors. SDNode *getCall(std::vector &RetVals, SDOperand Chain, - SDOperand Callee, std::vector &ArgsInRegs, bool isTailCall = false) { + SDOperand Callee, std::vector &ArgsInRegs, + bool isTailCall = false) { ArgsInRegs.insert(ArgsInRegs.begin(), Callee); ArgsInRegs.insert(ArgsInRegs.begin(), Chain); SDNode *NN = new SDNode(isTailCall ? ISD::TAILCALL : ISD::CALL, ArgsInRegs); @@ -169,6 +171,8 @@ public: SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4); SDOperand getNode(unsigned Opcode, MVT::ValueType VT, std::vector &Children); + SDOperand getNode(unsigned Opcode, std::vector &ResultTys, + std::vector &Ops); // getNode - These versions take an extra value type for extending and // truncating loads, stores, rounds, extends etc. @@ -182,6 +186,7 @@ public: SDOperand N2, SDOperand N3, SDOperand N4, MVT::ValueType EVT); + /// getLoad - Loads are not normal binary operators: their result type is not /// determined by their operands, and they produce a value AND a token chain. /// @@ -220,6 +225,11 @@ private: std::map FrameIndices; std::map ConstantPoolIndices; std::map BBNodes; + std::map, + std::vector > >, + SDNode*> ArbitraryNodes; + std::map ExternalSymbols; struct EVTStruct { unsigned Opcode;