-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[LLVM 4.0] Fix CreateCompileUnit #39747
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 1 commit
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 |
---|---|---|
|
@@ -787,17 +787,20 @@ pub fn compile_unit_metadata(scc: &SharedCrateContext, | |
(option_env!("CFG_VERSION")).expect("CFG_VERSION")); | ||
|
||
let compile_unit_name = compile_unit_name.as_ptr(); | ||
let work_dir = path2cstr(&work_dir); | ||
let producer = CString::new(producer).unwrap(); | ||
let work_dir = path2cstr(&work_dir).as_ptr(); | ||
let producer = CString::new(producer).unwrap().as_ptr(); | ||
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. This line is wrong: it will drop the (The line above may have the same problem depending on what 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. Ah, I was wondering why the |
||
let flags = "\0"; | ||
let split_name = "\0"; | ||
return unsafe { | ||
llvm::LLVMRustDIBuilderCreateCompileUnit( | ||
|
||
unsafe { | ||
let file_metadata = llvm::LLVMRustDIBuilderCreateFile( | ||
debug_context.builder, compile_unit_name, work_dir); | ||
|
||
return llvm::LLVMRustDIBuilderCreateCompileUnit( | ||
debug_context.builder, | ||
DW_LANG_RUST, | ||
compile_unit_name, | ||
work_dir.as_ptr(), | ||
producer.as_ptr(), | ||
file_metadata, | ||
producer, | ||
sess.opts.optimize != config::OptLevel::No, | ||
flags.as_ptr() as *const _, | ||
0, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really nice!