Removes the serde dependency in rustc_codegen_llvm

This commit is contained in:
dianqk 2025-12-28 15:51:10 +08:00
parent 23d01cd241
commit fe075ad212
No known key found for this signature in database
5 changed files with 7 additions and 30 deletions

View file

@ -1572,16 +1572,8 @@ extern "C" uint64_t LLVMRustModuleCost(LLVMModuleRef M) {
return std::distance(std::begin(f), std::end(f));
}
extern "C" void LLVMRustModuleInstructionStats(LLVMModuleRef M,
RustStringRef Str) {
auto OS = RawRustStringOstream(Str);
auto JOS = llvm::json::OStream(OS);
auto Module = unwrap(M);
JOS.object([&] {
JOS.attribute("module", Module->getName());
JOS.attribute("total", Module->getInstructionCount());
});
extern "C" uint64_t LLVMRustModuleInstructionStats(LLVMModuleRef M) {
return unwrap(M)->getInstructionCount();
}
// Transfers ownership of DiagnosticHandler unique_ptr to the caller.