about summary refs log tree commit diff
path: root/src/librustc_codegen_utils
AgeCommit message (Collapse)AuthorLines
2018-12-25Remove licensesMark Rousskov-50/+0
2018-12-08Auto merge of #56578 - alexreg:cosmetic-1, r=alexregbors-1/+1
Various minor/cosmetic improvements to code r? @Centril 😄
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-12-07Auto merge of #56258 - euclio:fs-read-write, r=eucliobors-9/+4
use top level `fs` functions where appropriate This commit replaces many usages of `File::open` and reading or writing with `fs::read_to_string`, `fs::read` and `fs::write`. This reduces code complexity, and will improve performance for most reads, since the functions allocate the buffer to be the size of the file. I believe that this commit will not impact behavior in any way, so some matches will check the error kind in case the file was not valid UTF-8. Some of these cases may not actually care about the error.
2018-12-07Auto merge of #56502 - Zoxc:hir-func, r=eddybbors-5/+5
Use a function to access the Hir map to be able to turn it into a query later r? @eddyb
2018-12-07use top level `fs` functions where appropriateAndy Russell-9/+4
This commit replaces many usages of `File::open` and reading or writing with `fs::read_to_string`, `fs::read` and `fs::write`. This reduces code complexity, and will improve performance for most reads, since the functions allocate the buffer to be the size of the file. I believe that this commit will not impact behavior in any way, so some matches will check the error kind in case the file was not valid UTF-8. Some of these cases may not actually care about the error.
2018-12-06codegen_utils, driver: fix clippy errorsljedrz-12/+9
2018-12-06Use a function to access the Hir map to be able to turn it into a query laterJohn KÃ¥re Alsaker-5/+5
2018-12-04cleanup: remove static lifetimes from constsljedrz-1/+1
2018-12-02Auto merge of #56198 - bjorn3:cg_ssa_refactor, r=eddybbors-2/+0
Refactor rustc_codegen_ssa cc #56108 (not all things are done yet) This removes an unsafe method from cg_ssa. r? @eddyb cc @sunfishcode
2018-11-30proc_macro: introduce a "bridge" between clients (proc macros) and servers ↵Eduard-Mihai Burtescu-2/+2
(compiler front-ends).
2018-11-29Remove __build_diagnostic_array! from cg_utilsbjorn3-2/+0
2018-11-16[eddyb] rustc_codegen_utils: remove extraneous `#![allow(dead_code)]`.Eduard-Mihai Burtescu-1/+0
2018-11-16Separating the back folder between backend-agnostic and LLVM-specific codeDenis Merigoux-1689/+0
2018-11-16Beginning of moving all backend-agnostic code to rustc_codegen_ssaDenis Merigoux-307/+0
2018-11-16Moved Backend interface into rustc_codegen_utilsDenis Merigoux-16/+192
2018-11-16[eddyb/rebase cleanup] move type_{needs_drop,is_sized,is_freeze} to ↵Eduard-Mihai Burtescu-1/+16
rustc_codegen_utils
2018-11-16Moved common.rs enumsDenis Merigoux-0/+78
2018-11-16Starting to move backend-agnostic code into codegen_utilsDenis Merigoux-0/+23
IntPredicate moved
2018-11-15Rollup merge of #55901 - euclio:speling, r=petrochenkovPietro Albini-1/+1
fix various typos in doc comments
2018-11-14xLTO: Don't pass --plugin-opt=thin to LLD. That's not supported anymore.Michael Woerister-11/+0
2018-11-13fix various typos in doc commentsAndy Russell-1/+1
2018-11-11Fix typos.Bruce Mitchener-1/+1
2018-11-10codegen_llvm_back: use mem::replace instead of swap where more conciseljedrz-12/+5
2018-11-10codegen_llvm_back: use to_owned instead of to_string with string literalsljedrz-1/+1
2018-11-10codegen_llvm_back: improve common patternsljedrz-11/+7
2018-11-10codegen_llvm_back: whitespace & formatting fixesljedrz-12/+10
2018-11-10Auto merge of #55626 - nikic:update-emscripten, r=alexcrichtonbors-0/+10
Update emscripten This updates emscripten to 1.38.15, which is based on LLVM 6.0.1 and would allow us to drop code for handling LLVM 4. The main issue I ran into is that exporting statics through `EXPORTED_FUNCTIONS` no longer works. As far as I understand exporting non-functions doesn't really make sense under emscripten anyway, so I've modified the symbol export code to not even try. Closes #52323.
2018-11-07Rollup merge of #55734 - teresy:shorthand-fields, r=davidtwcokennytm-1/+1
refactor: use shorthand fields refactor: use shorthand for single fields everywhere (excluding tests).
2018-11-06refactor: use shorthand fieldsteresy-1/+1
2018-11-04Don't export non-function symbols with emscriptenNikita Popov-0/+10
Emscripten only provides an export mechanism for functions. Exporting statics does not make sense conceptually in this case, and will result in emcc undefined function errors.
2018-11-03Remove rustc_metadata_utils, which contains only one functionbjorn3-4/+3
2018-11-03Move cg_llvm::back::linker to cg_utilsbjorn3-0/+1719
2018-10-27Auto merge of #54183 - qnighy:by-value-object-safety, r=oli-obkbors-1/+12
Implement by-value object safety This PR implements **by-value object safety**, which is part of unsized rvalues #48055. That means, with `#![feature(unsized_locals)]`, you can call a method `fn foo(self, ...)` on trait objects. One aim of this is to enable `Box<FnOnce>` in the near future. The difficulty here is this: when constructing a vtable for a trait `Foo`, we can't just put the function `<T as Foo>::foo` into the table. If `T` is no larger than `usize`, `self` is usually passed directly. However, as the caller of the vtable doesn't know the concrete `Self` type, we want a variant of `<T as Foo>::foo` where `self` is always passed by reference. Therefore, when the compiler encounters such a method to be generated as a vtable entry, it produces a newly introduced instance called `InstanceDef::VtableShim(def_id)` (that wraps the original instance). the shim just derefs the receiver and calls the original method. We give different symbol names for the shims by appending `::{{vtable-shim}}` to the symbol path (and also adding vtable-shimness as an ingredient to the symbol hash). r? @eddyb
2018-10-26Remove redundant cloneShotaro Yamada-1/+1
2018-10-24Include InstanceDef's discriminant in the symbol hash.Masaki Hara-2/+4
2018-10-24Distinguish vtable shims in symbol paths.Masaki Hara-1/+10
2018-10-20Auto merge of #55014 - ljedrz:lazyboye_unwraps, r=matthewjasperbors-1/+1
Prefer unwrap_or_else to unwrap_or in case of function calls/allocations The contents of `unwrap_or` are evaluated eagerly, so it's not a good pick in case of function calls and allocations. This PR also changes a few `unwrap_or`s with `unwrap_or_default`. An added bonus is that in some cases this change also reveals if the object it's called on is an `Option` or a `Result` (based on whether the closure takes an argument).
2018-10-19Prefer `Default::default` over `FxHash*::default` in struct constructorsOliver Scherer-3/+1
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-1/+1
2018-10-19Prefer unwrap_or_else to unwrap_or in case of function calls/allocationsljedrz-1/+1
2018-10-02Attempt to resolve linking issues.David Wood-1/+1
This commit takes a different approach to add the `crate::` prefix to item paths than previous commits. Previously, recursion was stopped after a prelude crate name was pushed to the path. It is theorized that this was the cause of the linking issues since the same path logic is used for symbol names and that not recursing meant that details were being missed that affect symbol names. As of this commit, instead of ceasing recursion, a flag is passed through to any subsequent recursive calls so that the same effect can be achieved by checking that flag.
2018-10-02Add `crate::` to trait suggestions in Rust 2018.David Wood-0/+1
In the 2018 edition, when suggesting traits to import that implement a given method that is being invoked, suggestions will now include the `crate::` prefix if the suggested trait is local to the current crate.
2018-09-30Auto merge of #54601 - cuviper:prep-1.31, r=Mark-Simulacrumbors-1/+1
Bump to 1.31.0 and bootstrap from 1.30 beta Closes #54594.
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-1/+1
2018-09-28Move `filename_for_metadata` to codegen_utilsIgor Matuszewski-0/+13
This function isn't strictly tied to LLVM (it's more of a utility) and it's now near an analogous, almost identical `filename_for_input` (for rlibs and so forth). Also this means not depending on the backend when one wants to know the accurate .rmeta output filename.
2018-09-11stabalize infer outlives requirements (RFC 2093).toidiu-1/+0
Co-authored-by: nikomatsakis
2018-08-27Rename hir::map::NodeKind to hir::Nodevarkor-2/+2
2018-08-27Remove path prefixes from NodeKindvarkor-2/+2
2018-08-27Rename hir::map::Node to hir::map::NodeKindvarkor-1/+1