let cstr = llvm::LLVMRustGetLastError();
if cstr == ptr::null() {
sess.fatal(msg);
- } else { sess.fatal(msg + ": " + str::unsafe::from_c_str(cstr)); }
+ } else { sess.fatal(msg + ~": " + str::unsafe::from_c_str(cstr)); }
}
+ fn WriteOutputFile(sess:session,
+ PM: lib::llvm::PassManagerRef, M: ModuleRef,
+ Triple: *c_char,
+ // FIXME: When #2334 is fixed, change
+ // c_uint to FileType
+ Output: *c_char, FileType: c_uint,
+ OptLevel: c_int,
+ EnableSegmentedStacks: bool) {
+ let result = llvm::LLVMRustWriteOutputFile(
+ PM, M, Triple, Output, FileType, OptLevel, EnableSegmentedStacks);
+ if (!result) {
+ llvm_err(sess, "Could not write output");
+ }
+ }
+
mod write {
fn is_object_or_assembly_or_exe(ot: output_type) -> bool {
if ot == output_type_assembly || ot == output_type_object ||