-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Allow loading of llvm plugins on nightly #86267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,13 +3,16 @@ use crate::{llvm, llvm_util}; | |||||
use libc::c_int; | ||||||
use rustc_codegen_ssa::target_features::supported_target_features; | ||||||
use rustc_data_structures::fx::FxHashSet; | ||||||
use rustc_metadata::dynamic_lib::DynamicLibrary; | ||||||
use rustc_middle::bug; | ||||||
use rustc_session::config::PrintRequest; | ||||||
use rustc_session::Session; | ||||||
use rustc_span::symbol::Symbol; | ||||||
use rustc_target::spec::{MergeFunctions, PanicStrategy}; | ||||||
use std::ffi::{CStr, CString}; | ||||||
use tracing::debug; | ||||||
|
||||||
use std::path::Path; | ||||||
use std::ptr; | ||||||
use std::slice; | ||||||
use std::str; | ||||||
|
@@ -129,6 +132,15 @@ unsafe fn configure_llvm(sess: &Session) { | |||||
|
||||||
llvm::LLVMInitializePasses(); | ||||||
|
||||||
for plugin in &sess.opts.debugging_opts.llvm_plugins { | ||||||
let path = Path::new(plugin); | ||||||
let res = DynamicLibrary::open(path); | ||||||
match res { | ||||||
Ok(_) => debug!("configure_llvm: {}", plugin), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: tracing already includes information about functions and modules that the debug call is in. This should perhaps say more about what's being done here precisely:
Suggested change
Or something along those lines. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, I will update it in this case. But how about this section, is it outdated? https://rustc-dev-guide.rust-lang.org/compiler-debugging.html#logging-etiquette-and-conventions
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Huh, I wonder if that convention predates the use of tracing for logging. @oli-obk do you know? |
||||||
Err(e) => bug!("couldn't load plugin: {}", e), | ||||||
} | ||||||
} | ||||||
|
||||||
rustc_llvm::initialize_available_targets(); | ||||||
|
||||||
llvm::LLVMRustSetLLVMOptions(llvm_args.len() as c_int, llvm_args.as_ptr()); | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.