[llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c
Chris Lattner
lattner at cs.uiuc.edu
Tue Nov 30 11:59:33 PST 2004
Changes in directory llvm-gcc/gcc:
llvm-expand.c updated: 1.70 -> 1.71
---
Log message:
Fix the missing symbols problem for 252.eon and the failure of
C++Frontend/2004-09-27-DidntEmitTemplate.cpp.tr
---
Diffs of the changes: (+10 -2)
Index: llvm-gcc/gcc/llvm-expand.c
diff -u llvm-gcc/gcc/llvm-expand.c:1.70 llvm-gcc/gcc/llvm-expand.c:1.71
--- llvm-gcc/gcc/llvm-expand.c:1.70 Sun Nov 28 01:54:45 2004
+++ llvm-gcc/gcc/llvm-expand.c Tue Nov 30 13:59:19 2004
@@ -89,6 +89,11 @@
*/
static llvm_value *append_inst(llvm_function *Fn, llvm_instruction *I) {
llvm_basicblock *BB;
+ int i;
+
+ for (i = 0; i != I->NumOperands; ++i)
+ if (I->Operands[i] && llvm_value_is_global(I->Operands[i]))
+ MarkLLVMNameAsUsed(I->Operands[i]);
/* If the instruction allows the ConstantExpr optimization... */
if (I->Opcode == O_Cast || I->Opcode == O_GetElementPtr ||
@@ -3068,18 +3073,21 @@
llvm_type_get_pointer(CalledFuncType));
}
- append_inst(Fn, Call);
+ if (!ExceptBlock) {
+ append_inst(Fn, Call);
- if (ExceptBlock) {
+ } else {
llvm_basicblock *NormalDest = llvm_basicblock_new("invoke_cont");
Call->Operands[1] = D2V(NormalDest);
if (Fn->ExpandInfo->ThrownExceptionsCallTerminate) {
/* This should just go directly to the terminate block. */
Call->Operands[2] = D2V(ExceptBlock);
+ append_inst(Fn, Call);
} else {
llvm_basicblock *CleanupDest = llvm_basicblock_new("invoke_catch");
Call->Operands[2] = D2V(CleanupDest);
+ append_inst(Fn, Call);
llvm_emit_label(Fn, CleanupDest);
llvm_expand_goto_internal(Fn, ExceptBlock, 0, 1);
}
More information about the llvm-commits
mailing list