if (FPC->getType() == Type::DoubleTy)
Out << " const ConstantDoubleTy FloatConstant" << FPCounter++
<< " = 0x" << std::hex << *(unsigned long long*)&Val << std::dec
- << "; /* " << Val << " */\n";
+ << "ULL; /* " << Val << " */\n";
else if (FPC->getType() == Type::FloatTy) {
float fVal = Val;
Out << " const ConstantFloatTy FloatConstant" << FPCounter++
<< " = 0x" << std::hex << *(unsigned*)&fVal << std::dec
- << "; /* " << Val << " */\n";
+ << "U; /* " << Val << " */\n";
} else
assert(0 && "Unknown float type!");
}
BasicBlock *Prev = BB->getPrev();
// Don't print the label for the basic block if there are no uses, or if the
- // only terminator use is the precessor basic block's terminator. We have
+ // only terminator use is the predecessor basic block's terminator. We have
// to scan the use list because PHI nodes use basic blocks too but do not
// require a label to be generated.
//
// instruction is found. In this context, we code generated the invoke
// instruction to add an entry to the top of the jmpbuf_list. Thus, here we
// just have to longjmp to the specified handler.
- Out << " if (__llvm_jmpbuf_list == 0) { /* llvm.unwind */\n"
- << " printf(\"throw found with no handler!\\n\"); abort();\n"
+ Out << " if (__llvm_jmpbuf_list == 0) { /* unwind */\n"
+ << " extern write();\n"
+ << " ((void (*)(int, void*, unsigned))write)(2,\n"
+ << " \"throw found with no handler!\\n\", 31); abort();\n"
<< " }\n"
<< " longjmp(__llvm_jmpbuf_list->buf, 1);\n";
emittedInvoke = true;
}
}
-// Brach instruction printing - Avoid printing out a brach to a basic block that
-// immediately succeeds the current one.
+// Branch instruction printing - Avoid printing out a branch to a basic block
+// that immediately succeeds the current one.
//
void CWriter::visitBranchInst(BranchInst &I) {
if (I.isConditional()) {
switch (ID) {
default: assert(0 && "Unknown LLVM intrinsic!");
case LLVMIntrinsic::va_start:
- Out << "va_start((va_list)*";
+ Out << "va_start(*(va_list*)";
writeOperand(I.getOperand(1));
Out << ", ";
// Output the last argument to the enclosing function...
Out << ")";
return;
case LLVMIntrinsic::va_end:
- Out << "va_end((va_list)*";
+ Out << "va_end(*(va_list*)";
writeOperand(I.getOperand(1));
Out << ")";
return;
case LLVMIntrinsic::va_copy:
- Out << "va_copy((va_list)*";
+ Out << "va_copy(*(va_list*)";
writeOperand(I.getOperand(1));
Out << ", (va_list)";
writeOperand(I.getOperand(2));
case LLVMIntrinsic::setjmp:
case LLVMIntrinsic::sigsetjmp:
- // This instrinsic should never exist in the program, but until we get
+ // This intrinsic should never exist in the program, but until we get
// setjmp/longjmp transformations going on, we should codegen it to
// something reasonable. This will allow code that never calls longjmp
// to work.