handle global address constant sdnodes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31323 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-10-31 20:01:56 +00:00
parent 956a431930
commit efa46ce87b

View File

@ -544,8 +544,13 @@ void ScheduleDAG::EmitNode(SDNode *Node,
break;
case 3: { // Immediate.
assert(NumVals == 1 && "Unknown immediate value!");
uint64_t Val = cast<ConstantSDNode>(Node->getOperand(i))->getValue();
MI->addImmOperand(Val);
if (ConstantSDNode *CS=dyn_cast<ConstantSDNode>(Node->getOperand(i))){
MI->addImmOperand(CS->getValue());
} else {
GlobalAddressSDNode *GA =
cast<GlobalAddressSDNode>(Node->getOperand(i));
MI->addGlobalAddressOperand(GA->getGlobal(), GA->getOffset());
}
++i;
break;
}