diff options
author | Chris Lattner <sabre@nondot.org> | 2006-10-31 20:01:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-10-31 20:01:56 +0000 |
commit | efa46ce87bd454d128c4429475fea805aa98a5f6 (patch) | |
tree | 6fe7e2d3ef6c586c29d3d99b73c0962cfef0a5cf | |
parent | 956a43193076fc71c578115c66962496ec75b33a (diff) | |
download | external_llvm-efa46ce87bd454d128c4429475fea805aa98a5f6.zip external_llvm-efa46ce87bd454d128c4429475fea805aa98a5f6.tar.gz external_llvm-efa46ce87bd454d128c4429475fea805aa98a5f6.tar.bz2 |
handle global address constant sdnodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31323 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index ad9bfef..cfc27a3 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp @@ -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; } |