aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-24 23:00:29 +0000
committerChris Lattner <sabre@nondot.org>2005-08-24 23:00:29 +0000
commit7651fa4a7ed1c81abb004847af1eeb3beb9c88fd (patch)
tree13f33419db003751c4c7620b16ca427e0d66df8b
parentfb0c964364ba9f2c54ea28e0b7f404e18f7327b4 (diff)
add a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23027 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/SelectionDAG.h1
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp6
2 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h
index e1826de8ec..32049688eb 100644
--- a/include/llvm/CodeGen/SelectionDAG.h
+++ b/include/llvm/CodeGen/SelectionDAG.h
@@ -221,6 +221,7 @@ public:
/// specified node to have the specified return type, Target opcode, and
/// operands. Note that target opcodes are stored as
/// ISD::BUILTIN_OP_END+TargetOpcode in the node opcode field.
+ void SelectNodeTo(SDNode *N, MVT::ValueType VT, unsigned TargetOpc);
void SelectNodeTo(SDNode *N, MVT::ValueType VT, unsigned TargetOpc,
SDOperand Op1);
void SelectNodeTo(SDNode *N, MVT::ValueType VT, unsigned TargetOpc,
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 8188449592..97c28521c7 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1882,6 +1882,12 @@ SDOperand SelectionDAG::getNode(unsigned Opcode,
/// operands. Note that target opcodes are stored as
/// ISD::BUILTIN_OP_END+TargetOpcode in the node opcode field.
void SelectionDAG::SelectNodeTo(SDNode *N, MVT::ValueType VT,
+ unsigned TargetOpc) {
+ RemoveNodeFromCSEMaps(N);
+ N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
+ N->setValueTypes(VT);
+}
+void SelectionDAG::SelectNodeTo(SDNode *N, MVT::ValueType VT,
unsigned TargetOpc, SDOperand Op1) {
RemoveNodeFromCSEMaps(N);
N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);