[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Chris Lattner
sabre at nondot.org
Thu Apr 26 18:20:31 PDT 2007
Changes in directory llvm/lib/CodeGen/SelectionDAG:
SelectionDAGISel.cpp updated: 1.430 -> 1.431
---
Log message:
improve EH global handling, patch by Duncan Sands.
---
Diffs of the changes: (+10 -6)
SelectionDAGISel.cpp | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.430 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.431
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.430 Thu Apr 26 16:09:43 2007
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Apr 26 20:20:11 2007
@@ -2610,14 +2610,18 @@
// MachineModuleInfo.
std::vector<GlobalVariable *> TyInfo;
for (unsigned i = 3, N = I.getNumOperands(); i < N; ++i) {
- ConstantExpr *CE = dyn_cast<ConstantExpr>(I.getOperand(i));
- if (CE && CE->getOpcode() == Instruction::BitCast &&
- isa<GlobalVariable>(CE->getOperand(0))) {
+ Constant *C = cast<Constant>(I.getOperand(i));
+ if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
+ TyInfo.push_back(GV);
+ } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) {
+ assert(CE->getOpcode() == Instruction::BitCast &&
+ isa<GlobalVariable>(CE->getOperand(0))
+ && "TypeInfo must be a global variable or NULL");
TyInfo.push_back(cast<GlobalVariable>(CE->getOperand(0)));
} else {
- ConstantInt *CI = dyn_cast<ConstantInt>(I.getOperand(i));
- assert(CI && CI->getZExtValue() == 0 &&
- "TypeInfo must be a global variable typeinfo or NULL");
+ ConstantInt *CI = dyn_cast<ConstantInt>(C);
+ assert(CI && CI->isNullValue() &&
+ "TypeInfo must be a global variable or NULL");
TyInfo.push_back(NULL);
}
}
More information about the llvm-commits
mailing list