aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2015-11-29 11:12:40 -0700
committerAndrew Kelley <superjoe30@gmail.com>2015-11-29 11:12:40 -0700
commit855d51840dbb14888b4a727c495e01f96027985a (patch)
tree03b7c52c0bf4c7ca455149261ed960577a7773e4 /src/zig_llvm.cpp
parente5d1f0eea592e6efc4c4665eb473de95ef106e8a (diff)
downloadzig-855d51840dbb14888b4a727c495e01f96027985a.tar.gz
zig-855d51840dbb14888b4a727c495e01f96027985a.zip
remove LLVMZigTargetMachineEmitToFile
The llvm C API provided function is adequate.
Diffstat (limited to 'src/zig_llvm.cpp')
-rw-r--r--src/zig_llvm.cpp52
1 files changed, 0 insertions, 52 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
index cde28c13b5..78f4d81544 100644
--- a/src/zig_llvm.cpp
+++ b/src/zig_llvm.cpp
@@ -115,58 +115,6 @@ void LLVMZigOptimizeModule(LLVMTargetMachineRef targ_machine_ref, LLVMModuleRef
MPM->run(*module);
}
-static LLVMBool LLVMZigTargetMachineEmit(LLVMTargetMachineRef targ_machine_ref, LLVMModuleRef module_ref,
- raw_pwrite_stream &out_stream, LLVMCodeGenFileType codegen, char **err_msg)
-{
- TargetMachine* target_machine = reinterpret_cast<TargetMachine*>(targ_machine_ref);
- Module* module = unwrap(module_ref);
- TargetLibraryInfoImpl tlii(Triple(module->getTargetTriple()));
-
- legacy::PassManager pass;
-
- pass.add(new TargetLibraryInfoWrapperPass(tlii));
-
- const DataLayout *td = target_machine->getDataLayout();
-
- if (!td) {
- *err_msg = strdup("No DataLayout in TargetMachine");
- return true;
- }
- module->setDataLayout(*td);
-
-
- TargetMachine::CodeGenFileType ft;
- switch (codegen) {
- case LLVMAssemblyFile:
- ft = TargetMachine::CGFT_AssemblyFile;
- break;
- default:
- ft = TargetMachine::CGFT_ObjectFile;
- break;
- }
- if (target_machine->addPassesToEmitFile(pass, out_stream, ft)) {
- *err_msg = strdup("TargetMachine can't emit a file of this type");
- return true;
- }
-
- pass.run(*module);
-
- out_stream.flush();
- return false;
-}
-
-LLVMBool LLVMZigTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMModuleRef module_ref,
- const char* filename, LLVMCodeGenFileType codegen, char** err_msg)
-{
- std::error_code error_code;
- raw_fd_ostream dest(filename, error_code, sys::fs::F_None);
- if (error_code) {
- *err_msg = strdup(error_code.message().c_str());
- return true;
- }
- return LLVMZigTargetMachineEmit(targ_machine_ref, module_ref, dest, codegen, err_msg);
-}
-
LLVMValueRef LLVMZigBuildCall(LLVMBuilderRef B, LLVMValueRef Fn, LLVMValueRef *Args,
unsigned NumArgs, unsigned CC, const char *Name)
{