handle global address constant sdnodes

llvm-svn: 31323
This commit is contained in:
Chris Lattner 2006-10-31 20:01:56 +00:00
parent 8b20fa42da
commit 1fd360e13a
1 changed files with 7 additions and 2 deletions

View File

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