[llvm-commits] [llvm] r49876 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Dan Gohman
gohman at apple.com
Thu Apr 17 16:02:12 PDT 2008
Author: djg
Date: Thu Apr 17 18:02:12 2008
New Revision: 49876
URL: http://llvm.org/viewvc/llvm-project?rev=49876&view=rev
Log:
Remove the implicit conversion from SDOperandPtr to SDOperand*; this
may fix a build error on Visual Studio.
Modified:
llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=49876&r1=49875&r2=49876&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Thu Apr 17 18:02:12 2008
@@ -968,6 +968,8 @@
const SDOperand *ptr; // The pointer to the SDOperand object
int object_size; // The size of the object containg the SDOperand
public:
+ SDOperandPtr() : ptr(0), object_size(0) {}
+
SDOperandPtr(SDUse * use_ptr) {
ptr = &use_ptr->getSDOperand();
object_size = sizeof(SDUse);
@@ -978,12 +980,6 @@
object_size = sizeof(SDOperand);
}
- operator const SDOperand *() const {
- assert(object_size == sizeof(SDOperand) &&
- "Only SDOperand can be converted");
- return ptr;
- }
-
const SDOperand operator *() { return *ptr; }
const SDOperand *operator ->() { return ptr; }
SDOperandPtr operator ++ () {
@@ -1300,7 +1296,7 @@
/// opcode, types, and operands to the specified value. This should only be
/// used by the SelectionDAG class.
void MorphNodeTo(unsigned Opc, SDVTList L,
- const SDOperand *Ops, unsigned NumOps);
+ SDOperandPtr Ops, unsigned NumOps);
void addUser(unsigned i, SDNode *User) {
assert(User->OperandList[i].getUser() && "Node without parent");
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=49876&r1=49875&r2=49876&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Apr 17 18:02:12 2008
@@ -337,7 +337,7 @@
static void AddNodeIDNode(FoldingSetNodeID &ID,
unsigned short OpC, SDVTList VTList,
- const SDOperand *OpList, unsigned N) {
+ SDOperandPtr OpList, unsigned N) {
AddNodeIDOpcode(ID, OpC);
AddNodeIDValueTypes(ID, VTList);
AddNodeIDOperands(ID, OpList, N);
@@ -3342,7 +3342,7 @@
/// opcode, types, and operands to the specified value. This should only be
/// used by the SelectionDAG class.
void SDNode::MorphNodeTo(unsigned Opc, SDVTList L,
- const SDOperand *Ops, unsigned NumOps) {
+ SDOperandPtr Ops, unsigned NumOps) {
NodeType = Opc;
ValueList = L.VTs;
NumValues = L.NumVTs;
@@ -3393,7 +3393,7 @@
RemoveNodeFromCSEMaps(N);
- N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs, 0, 0);
+ N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs, SDOperandPtr(), 0);
CSEMap.InsertNode(N, IP);
return N;
@@ -3951,7 +3951,7 @@
HandleSDNode::~HandleSDNode() {
SDVTList VTs = { 0, 0 };
- MorphNodeTo(ISD::HANDLENODE, VTs, 0, 0); // Drops operand uses.
+ MorphNodeTo(ISD::HANDLENODE, VTs, SDOperandPtr(), 0); // Drops operand uses.
}
GlobalAddressSDNode::GlobalAddressSDNode(bool isTarget, const GlobalValue *GA,
More information about the llvm-commits
mailing list