Skip to content

Commit

Permalink
Deprecate LLVM::Module#write_bitcode_with_summary_to_file
Browse files Browse the repository at this point in the history
  • Loading branch information
HertzDevil committed May 20, 2023
1 parent 0410331 commit f6e5e48
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 21 deletions.
2 changes: 0 additions & 2 deletions man/crystal.1
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ Generate the output with symbolic debug symbols.
These are read when debugging the built program with tools like lldb, gdb, valgrind etc. and provide mappings to the original source code for those tools.
.It Fl -no-debug
Generate the output without any symbolic debug symbols.
.It Fl -lto Ar FLAG
Use ThinLTO --lto=thin.
.It Fl D Ar FLAG, Fl -define Ar FLAG
Define a compile-time flag. This is useful to conditionally define types, methods, or commands based on flags available at compile time. The default flags are from the target triple given with --target-triple or the hosts default, if none is given.
.It Fl -emit Op asm|llvm-bc|llvm-ir|obj
Expand Down
16 changes: 0 additions & 16 deletions src/llvm/ext/llvm_ext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,6 @@ LLVMValueRef LLVMExtBuildInvoke2(
Bundles, Name));
}

void LLVMExtWriteBitcodeWithSummaryToFile(LLVMModuleRef mref, const char *File) {
// https://github.com/ldc-developers/ldc/pull/1840/files
Module *m = unwrap(mref);

std::error_code EC;
#if LLVM_VERSION_GE(13, 0)
raw_fd_ostream OS(File, EC, sys::fs::OF_None);
#else
raw_fd_ostream OS(File, EC, sys::fs::F_None);
#endif
if (EC) return;

llvm::ModuleSummaryIndex moduleSummaryIndex = llvm::buildModuleSummaryIndex(*m, nullptr, nullptr);
llvm::WriteBitcodeToFile(*m, OS, true, &moduleSummaryIndex, true);
}

static TargetMachine *unwrap(LLVMTargetMachineRef P) {
return reinterpret_cast<TargetMachine *>(P);
}
Expand Down
2 changes: 0 additions & 2 deletions src/llvm/lib_llvm_ext.cr
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ lib LibLLVMExt
bundle : LibLLVMExt::OperandBundleDefRef,
name : LibC::Char*) : LibLLVM::ValueRef

fun write_bitcode_with_summary_to_file = LLVMExtWriteBitcodeWithSummaryToFile(module : LibLLVM::ModuleRef, path : UInt8*) : Void

fun target_machine_enable_global_isel = LLVMExtTargetMachineEnableGlobalIsel(machine : LibLLVM::TargetMachineRef, enable : Bool)
fun create_mc_jit_compiler_for_module = LLVMExtCreateMCJITCompilerForModule(jit : LibLLVM::ExecutionEngineRef*, m : LibLLVM::ModuleRef, options : LibLLVM::JITCompilerOptions*, options_length : UInt32, enable_global_isel : Bool, error : UInt8**) : Int32
end
3 changes: 2 additions & 1 deletion src/llvm/module.cr
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ class LLVM::Module
LibLLVM.write_bitcode_to_file self, filename
end

@[Deprecated("ThinLTO is no longer supported; use `#write_bitcode_to_file` instead")]
def write_bitcode_with_summary_to_file(filename : String)
LibLLVMExt.write_bitcode_with_summary_to_file self, filename
LibLLVM.write_bitcode_to_file self, filename
end

def write_bitcode_to_memory_buffer
Expand Down

0 comments on commit f6e5e48

Please sign in to comment.