Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 6e76a23

Browse files
committed
Put back SelectionDAG::getTargetIndex.
While technically this is untested dead code, it has out-of-tree users. This reverts a part of r250434. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250717 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent a4b30b5 commit 6e76a23

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,6 +1398,24 @@ SDValue SelectionDAG::getConstantPool(MachineConstantPoolValue *C, EVT VT,
13981398
return SDValue(N, 0);
13991399
}
14001400

1401+
SDValue SelectionDAG::getTargetIndex(int Index, EVT VT, int64_t Offset,
1402+
unsigned char TargetFlags) {
1403+
FoldingSetNodeID ID;
1404+
AddNodeIDNode(ID, ISD::TargetIndex, getVTList(VT), None);
1405+
ID.AddInteger(Index);
1406+
ID.AddInteger(Offset);
1407+
ID.AddInteger(TargetFlags);
1408+
void *IP = nullptr;
1409+
if (SDNode *E = FindNodeOrInsertPos(ID, IP))
1410+
return SDValue(E, 0);
1411+
1412+
SDNode *N =
1413+
new (NodeAllocator) TargetIndexSDNode(Index, VT, Offset, -TargetFlags);
1414+
CSEMap.InsertNode(N, IP);
1415+
InsertNode(N);
1416+
return SDValue(N, 0);
1417+
}
1418+
14011419
SDValue SelectionDAG::getBasicBlock(MachineBasicBlock *MBB) {
14021420
FoldingSetNodeID ID;
14031421
AddNodeIDNode(ID, ISD::BasicBlock, getVTList(MVT::Other), None);

0 commit comments

Comments
 (0)