if (I->hasDLLImportLinkage()) {
O << "__imp_";
}
if (I->hasDLLImportLinkage()) {
O << "__imp_";
}
- // Microsoft sticks an extra _ in front of "_write" (whether LLVM should
- // hard-code usage of a Unix API is another question).
- if (Name == "_write")
- Name = "__write";
O << Name << ":near\n";
}
O << Name << ":near\n";
}
// We need the 'write' and 'abort' functions for both models.
AbortFn = M.getOrInsertFunction("abort", Type::VoidTy, (Type *)0);
// We need the 'write' and 'abort' functions for both models.
AbortFn = M.getOrInsertFunction("abort", Type::VoidTy, (Type *)0);
+#if 0 // "write" is Unix-specific.. code is going away soon anyway.
WriteFn = M.getOrInsertFunction("write", Type::VoidTy, Type::Int32Ty,
VoidPtrTy, Type::Int32Ty, (Type *)0);
WriteFn = M.getOrInsertFunction("write", Type::VoidTy, Type::Int32Ty,
VoidPtrTy, Type::Int32Ty, (Type *)0);
+#else
+ WriteFn = 0;
+#endif
void LowerInvoke::writeAbortMessage(Instruction *IB) {
void LowerInvoke::writeAbortMessage(Instruction *IB) {
if (AbortMessage == 0)
createAbortMessage(IB->getParent()->getParent()->getParent());
if (AbortMessage == 0)
createAbortMessage(IB->getParent()->getParent()->getParent());
Args[1] = AbortMessage;
Args[2] = ConstantInt::get(Type::Int32Ty, AbortMessageLength);
(new CallInst(WriteFn, Args, 3, "", IB))->setTailCall();
Args[1] = AbortMessage;
Args[2] = ConstantInt::get(Type::Int32Ty, AbortMessageLength);
(new CallInst(WriteFn, Args, 3, "", IB))->setTailCall();
}
bool LowerInvoke::insertCheapEHSupport(Function &F) {
}
bool LowerInvoke::insertCheapEHSupport(Function &F) {