Skip to content

Commit

Permalink
[SelectionDAG] Move GlobalAddressSDNode and AddrSpaceCastSDNode const…
Browse files Browse the repository at this point in the history
…ructors into header. NFC

These constructors are no more complicated than any of the other
*SDNode constructors that are already in the header.
  • Loading branch information
topperc committed Apr 24, 2024
1 parent 11bd19a commit c5dcb52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
8 changes: 6 additions & 2 deletions llvm/include/llvm/CodeGen/SelectionDAGNodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,9 @@ class AddrSpaceCastSDNode : public SDNode {

public:
AddrSpaceCastSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs,
unsigned SrcAS, unsigned DestAS);
unsigned SrcAS, unsigned DestAS)
: SDNode(ISD::ADDRSPACECAST, Order, dl, VTs), SrcAddrSpace(SrcAS),
DestAddrSpace(DestAS) {}

unsigned getSrcAddressSpace() const { return SrcAddrSpace; }
unsigned getDestAddressSpace() const { return DestAddrSpace; }
Expand Down Expand Up @@ -1819,7 +1821,9 @@ class GlobalAddressSDNode : public SDNode {

GlobalAddressSDNode(unsigned Opc, unsigned Order, const DebugLoc &DL,
const GlobalValue *GA, SDVTList VTs, int64_t o,
unsigned TF);
unsigned TF)
: SDNode(Opc, Order, DL, VTs), TheGlobal(GA), Offset(o), TargetFlags(TF) {
}

public:
const GlobalValue *getGlobal() const { return TheGlobal; }
Expand Down
14 changes: 0 additions & 14 deletions llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11807,20 +11807,6 @@ HandleSDNode::~HandleSDNode() {
DropOperands();
}

GlobalAddressSDNode::GlobalAddressSDNode(unsigned Opc, unsigned Order,
const DebugLoc &DL,
const GlobalValue *GA, SDVTList VTs,
int64_t o, unsigned TF)
: SDNode(Opc, Order, DL, VTs), Offset(o), TargetFlags(TF) {
TheGlobal = GA;
}

AddrSpaceCastSDNode::AddrSpaceCastSDNode(unsigned Order, const DebugLoc &dl,
SDVTList VTs, unsigned SrcAS,
unsigned DestAS)
: SDNode(ISD::ADDRSPACECAST, Order, dl, VTs), SrcAddrSpace(SrcAS),
DestAddrSpace(DestAS) {}

MemSDNode::MemSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl,
SDVTList VTs, EVT memvt, MachineMemOperand *mmo)
: SDNode(Opc, Order, dl, VTs), MemoryVT(memvt), MMO(mmo) {
Expand Down

0 comments on commit c5dcb52

Please sign in to comment.