about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
AgeCommit message (Collapse)AuthorLines
2020-03-13Auto merge of #67502 - Mark-Simulacrum:opt-catch, r=Mark-Simulacrumbors-107/+78
Optimize catch_unwind to match C++ try/catch This refactors the implementation of catching unwinds to allow LLVM to inline the "try" closure directly into the happy path, avoiding indirection. This means that the catch_unwind implementation is (after this PR) zero-cost unless a panic is thrown. https://rust.godbolt.org/z/cZcUSB is an example of the current codegen in a simple case. Notably, the codegen is *exactly the same* if `-Cpanic=abort` is passed, which is clearly not great. This PR, on the other hand, generates the following assembly: ```asm # -Cpanic=unwind: push rbx mov ebx,0x2a call QWORD PTR [rip+0x1c53c] # <happy> mov eax,ebx pop rbx ret mov rdi,rax call QWORD PTR [rip+0x1c537] # cleanup function call call QWORD PTR [rip+0x1c539] # <unfortunate> mov ebx,0xd mov eax,ebx pop rbx ret # -Cpanic=abort: push rax call QWORD PTR [rip+0x20a1] # <happy> mov eax,0x2a pop rcx ret ``` Fixes #64224, and resolves #64222.
2020-03-13Auto merge of #69986 - JohnTitor:rollup-h0809mf, r=JohnTitorbors-6/+6
Rollup of 12 pull requests Successful merges: - #69403 (Implement `Copy` for `IoSlice`) - #69460 (Move some `build-pass` tests to `check-pass`) - #69723 (Added doc on keyword Pub.) - #69802 (fix more clippy findings) - #69809 (remove lifetimes that can be elided (clippy::needless_lifetimes)) - #69947 (Clean up E0423 explanation) - #69949 (triagebot.toml: add ping aliases) - #69954 (rename panic_if_ intrinsics to assert_) - #69960 (miri engine: fix treatment of abort intrinsic) - #69966 (Add more regression tests) - #69973 (Update stable-since version for const_int_conversion) - #69974 (Clean up E0434 explanation) Failed merges: r? @ghost
2020-03-14Rollup merge of #69809 - matthiaskrgr:lifetimes, r=eddybYuki Okushi-6/+6
remove lifetimes that can be elided (clippy::needless_lifetimes)
2020-03-13Auto merge of #69155 - chrissimpkins:llvm-globals, r=eddybbors-4/+7
Add support for LLVM globals corresponding to miri allocations should be named alloc123 Adds support for this request from @eddyb in #69134: > That is, if -Zfewer-names is false (usually only because of --emit=llvm-ir), we should use the same name for LLVM globals we generate out of miri allocs as #67133 does in MIR output (allocN). > >This way, we can easily see the mapping between MIR and LLVM IR (and it shouldn't be any costlier for regular compilation, which would continue to use unnamed globals). r? @eddyb cc @oli-obk
2020-03-12remove lifetimes that can be elided (clippy::needless_lifetimes)Matthias Krüger-6/+6
2020-03-12Rollup merge of #69747 - spastorino:rename-rustc-guide, r=pietroalbiniMazdak Farrokhzad-2/+2
Rename rustc guide This is in preparation for https://github.com/rust-lang/rustc-guide/issues/470 Needs to be merged after we actually rename the guide. Have used this to rename: `git grep -l 'rustc_guide' | xargs sed -i 's/rustc_guide/rustc_dev_guide/g'` `git grep -l 'rustc-guide' | xargs sed -i 's/rustc-guide/rustc-dev-guide/g'` `git grep -l 'rustc guide' | xargs sed -i 's/rustc guide/rustc dev guide/g'`
2020-03-12support LLVM globals corresponding to miri allocationsChris Simpkins-4/+7
2020-03-11librustc_codegen_llvm: Replace deprecated API usageTomasz Miąsko-16/+23
2020-03-11implement zeroed and uninitialized with MaybeUninitRalf Jung-20/+2
2020-03-11Rollup merge of #69893 - tmiasko:cstr, r=petrochenkovMazdak Farrokhzad-35/+36
librustc_codegen_llvm: Use slices instead of 0-terminated strings Changed functions: * LLVMRustGetOrInsertFunction * LLVMRustGetNamedValue * LLVMRustBuildCall (removed unused name argument) * LLVMRustInlineAsm * LLVMRustInlineAsmVerify * LLVMRustAppendModuleInlineAsm
2020-03-11librustc_codegen_llvm: Use slices instead of 0-terminated stringsTomasz Miąsko-35/+36
Changed functions: * LLVMRustGetOrInsertFunction * LLVMRustGetNamedValue * LLVMRustBuildCall (removed unused name argument) * LLVMRustInlineAsm * LLVMRustInlineAsmVerify * LLVMRustAppendModuleInlineAsm
2020-03-10rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.orgSantiago Pastorino-1/+1
2020-03-10Rename rustc guide to rustc dev guideSantiago Pastorino-2/+2
2020-03-10Rename rustc-guide to rustc-dev-guideSantiago Pastorino-1/+1
2020-03-10Rollup merge of #69836 - JohnTitor:immediate-outputs, r=nagisaMazdak Farrokhzad-2/+8
Check if output is immediate value Fixes #62046 r? @nagisa
2020-03-09Avoid unnecessary interning of enum variant part idTomasz Miąsko-4/+1
2020-03-09Use slices in preference to 0-terminated stringsTomasz Miąsko-128/+179
Additionally whenever possible match C API provided by the LLVM.
2020-03-09Check if output is immediate valueYuki Okushi-2/+8
2020-03-08Rollup merge of #69734 - tmiasko:di-enumerator, r=ecstatic-morseMazdak Farrokhzad-8/+19
Change DIBuilderCreateEnumerator signature to match LLVM 9 * Change DIBuilderCreateEnumerator signature to match LLVM 9 C API. * Use provided is unsigned flag when emitting enumerators.
2020-03-07Apply review feedbackAmanieu d'Antras-1/+1
2020-03-07Rollup merge of #69773 - matthiaskrgr:typos, r=petrochenkovMazdak Farrokhzad-5/+5
fix various typos
2020-03-07Rollup merge of #69667 - JohnTitor:no-debug, r=nikomatsakisMazdak Farrokhzad-12/+1
Remove the `no_debug` feature Context: https://github.com/rust-lang/rust/issues/29721#issuecomment-367642779 r? @nikomatsakis
2020-03-06Don't redundantly repeat field names (clippy::redundant_field_names)Matthias Krüger-1/+1
2020-03-06fix various typosMatthias Krüger-5/+5
2020-03-05Rollup merge of #69736 - matthiaskrgr:even_more_clippy, r=Dylan-DPCDylan DPC-1/+1
even more clippy cleanups * Don't pass &mut where immutable reference (&) is sufficient (clippy::unnecessary_mut_passed) * Use more efficient &&str to String conversion (clippy::inefficient_to_string) * Don't always eval arguments inside .expect(), use unwrap_or_else and closure. (clippy::expect_fun_call) * Use righthand '&' instead of lefthand "ref". (clippy::toplevel_ref_arg) * Use simple 'for i in x' loops instead of 'while let Some(i) = x.next()' loops on iterators. (clippy::while_let_on_iterator) * Const items have by default a static lifetime, there's no need to annotate it. (clippy::redundant_static_lifetimes) * Remove redundant patterns when matching ( x @ _ to x) (clippy::redundant_pattern)
2020-03-05debuginfo: Use is unsigned flag when emitting enumeratorsTomasz Miąsko-1/+6
2020-03-05debuginfo: Generators use u32 as discriminant type reprTomasz Miąsko-3/+3
2020-03-05Simplify the try intrinsic by using a callback in the catch blockAmanieu d'Antras-54/+46
2020-03-05Remove eh_unwind_resume lang itemAmanieu d'Antras-46/+1
2020-03-05Use more efficient &&str to String conversion (clippy::inefficient_to_string)Matthias Krüger-1/+1
2020-03-05Change DIBuilderCreateEnumerator signature to match LLVM 9Tomasz Miąsko-7/+13
No functional changes intended.
2020-03-04Don't use "if let" bindings to only check a value and not actually bind ↵Matthias Krüger-1/+1
anything. For example: `if let Some(_) = foo() {}` can be reduced to `if foo().is_some() {}` (clippy::redundant_pattern_matching)
2020-03-04Don't use .ok() before unwrapping via .expect() on a Result.Matthias Krüger-1/+0
The Result can be expect-unwrapped directly. (clippy::ok_expect)
2020-03-03Remove the `no_debug` featureYuki Okushi-12/+1
2020-03-03use conditions directlyMatthias Krüger-2/+1
2020-03-02Apply CPU attributes to __rust_tryAmanieu d'Antras-0/+2
2020-03-02Fix cross-DLL panics under MSVCAmanieu d'Antras-5/+25
2020-03-02Avoid over-aligning the return value in the -Cpanic=abort caseMark Rousskov-2/+4
2020-03-01Rollup merge of #69569 - matthiaskrgr:nonminimal_bool, r=mark-SimulacrumDylan DPC-1/+1
simplify boolean expressions
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-15/+15
2020-02-29Make it build againVadim Petrochenkov-1/+1
2020-02-29simplify boolean expressionsMatthias Krüger-1/+1
2020-02-29Rollup merge of #69551 - matthiaskrgr:len_zero, r=Mark-SimulacrumDylan DPC-2/+2
use is_empty() instead of len() == x to determine if structs are empty.
2020-02-28use is_empty() instead of len() == x to determine if structs are empty.Matthias Krüger-2/+2
2020-02-27use char instead of &str for single char patternsMatthias Krüger-1/+1
2020-02-26Use byte offsets when emitting debuginfo columnsTomasz Miąsko-45/+57
2020-02-26Emit 1-based column numbers in debuginfoTomasz Miąsko-2/+4
The debuginfo column numbers are 1-based. The value 0 indicates that no column has been specified. Translate 0-based column numbers to 1-based when emitting debug information.
2020-02-15Change `const_field` and `const_caller_location` to return `ConstValue` ↵Ben Lewis-2/+1
instead of `Const` as the type in the returned const isn't needed.
2020-02-15Change const eval to return `ConstValue`, instead of `Const` as the type ↵Ben Lewis-6/+5
inside it shouldn't be used.
2020-02-13add selfprofiling for new llvm passmanagerAndreas Jonson-2/+88