about summary refs log tree commit diff
path: root/src/librustc_trans/context.rs
AgeCommit message (Collapse)AuthorLines
2018-05-17Rename trans to codegen everywhere.Irina Popa-666/+0
2018-04-27Rename InternedString to LocalInternedString and introduce a new thread-safe ↵John Kåre Alsaker-3/+3
InternedString
2018-04-26rustc_trans: generalize cabi_* to any context type.Irina Popa-0/+7
2018-04-26rustc_target: move LayoutOf's type parameter to an associated type.Irina Popa-1/+2
2018-04-24Make Binder's field private and clean up its usageTyler Mandry-1/+1
2018-04-10Make Session.crate_types thread-safeJohn Kåre Alsaker-1/+1
2018-03-13refactor `ParamEnv::empty(Reveal)` into two distinct methodsNiko Matsakis-3/+2
- `ParamEnv::empty()` -- does not reveal all, good for typeck - `ParamEnv::reveal_all()` -- does, good for trans - `param_env.with_reveal_all()` -- converts an existing parameter environment
2018-03-07Rollup merge of #48651 - PramodBisht:issues/48425, r=oli-obkAlex Crichton-1/+1
Fixed #48425 : Various functions taking a `TyCtxt` and a `Span` should be taking a `TyCtxtAt` Hi @oli-obk I have done some code refactoring to fix #48425, Please let me know if anything else is required on this.
2018-03-04Fixed #48425Pramod Bisht-1/+1
2018-02-28Add bitreverse intrinsicAmanieu d'Antras-0/+6
2018-02-01rustc: prefer ParamEnvAnd and LayoutCx over tuples for LayoutOf.Eduard-Mihai Burtescu-2/+1
2018-01-14rustc_trans: rename ccx to cx.Eduard-Mihai Burtescu-24/+24
2018-01-14rustc_trans: rename CrateContext to CodegenCx.Eduard-Mihai Burtescu-12/+12
2018-01-14rustc_trans: access fields directly on CrateContext.Eduard-Mihai Burtescu-123/+28
2018-01-14rustc_trans: remove unused `TargetDataRef` accessor.Eduard-Mihai Burtescu-4/+0
2018-01-14rustc_trans: collapse {Local,Shared}CrateContext.Eduard-Mihai Burtescu-200/+75
2018-01-08Shorten names of some compiler generated artifacts.Michael Woerister-1/+1
2018-01-05Use name-discarding LLVM contextSimonas Kazlauskas-1/+1
This is only applicable when neither of --emit=llvm-ir or --emit=llvm-bc are not requested. In case either of these outputs are wanted, but the benefits of such context are desired as well, -Zfewer_names option provides the same functionality regardless of the outputs requested.
2017-12-18Move partitioning.rs to rustc_mirMaik Klein-1/+1
2017-12-18Move has_metadata back to context.rsMaik Klein-1/+11
2017-12-18Move meta_data into TySMaik Klein-2/+1
2017-12-18Refactor paths to middle::trans to mir::monoMaik Klein-1/+1
2017-11-19rustc: encode scalar pairs in layout ABI.Eduard-Mihai Burtescu-3/+4
2017-11-19rustc_trans: generate LLVM pointee types based on alignment.Eduard-Mihai Burtescu-0/+7
2017-11-19rustc_trans: go through layouts uniformly for fat pointers and variants.Eduard-Mihai Burtescu-27/+17
2017-11-19rustc_trans: query LLVM types from a layout instead of a Ty.Eduard-Mihai Burtescu-1/+3
2017-11-19rustc: re-complicate the TyLayout API and use better names.Eduard-Mihai Burtescu-22/+18
2017-11-19rustc_trans: always insert alignment padding, even before the first field.Eduard-Mihai Burtescu-5/+7
2017-11-19rustc_trans: use *[T; 0] for slice data pointers instead of *T.Eduard-Mihai Burtescu-1/+3
2017-11-19rustc_trans: remove obsolete Type methods.Eduard-Mihai Burtescu-7/+4
2017-11-06Move tls-model to a -Z option since it is unstableAmanieu d'Antras-1/+1
2017-11-03Cache the TLS model in the crate contextAmanieu d'Antras-1/+9
2017-11-03Add support for specifying the TLS modelAmanieu d'Antras-0/+18
2017-11-03Fix error message for invalid code/reloc modelsAmanieu d'Antras-3/+1
2017-10-27Move type_has_metadata to trans_utilsPaul Liétar-1/+2
2017-10-27Implement RFC 1861: Extern typesPaul Lietar-0/+4
2017-10-21trans_ -> fully_ prefixMarco Concetto Rudilosso-1/+1
2017-10-21added trans_ prefix and pluralised types. Solved failing test on the ↵Marco Concetto Rudilosso-1/+1
incremental test-suite.
2017-10-21Create NormalizeTy queryMarco Concetto Rudilosso-1/+1
2017-09-30rustc: Enable LTO and multiple codegen unitsAlex Crichton-11/+2
This commit is a refactoring of the LTO backend in Rust to support compilations with multiple codegen units. The immediate result of this PR is to remove the artificial error emitted by rustc about `-C lto -C codegen-units-8`, but longer term this is intended to lay the groundwork for LTO with incremental compilation and ultimately be the underpinning of ThinLTO support. The problem here that needed solving is that when rustc is producing multiple codegen units in one compilation LTO needs to merge them all together. Previously only upstream dependencies were merged and it was inherently relied on that there was only one local codegen unit. Supporting this involved refactoring the optimization backend architecture for rustc, namely splitting the `optimize_and_codegen` function into `optimize` and `codegen`. After an LLVM module has been optimized it may be blocked and queued up for LTO, and only after LTO are modules code generated. Non-LTO compilations should look the same as they do today backend-wise, we'll spin up a thread for each codegen unit and optimize/codegen in that thread. LTO compilations will, however, send the LLVM module back to the coordinator thread once optimizations have finished. When all LLVM modules have finished optimizing the coordinator will invoke the LTO backend, producing a further list of LLVM modules. Currently this is always a list of one LLVM module. The coordinator then spawns further work to run LTO and code generation passes over each module. In the course of this refactoring a number of other pieces were refactored: * Management of the bytecode encoding in rlibs was centralized into one module instead of being scattered across LTO and linking. * Some internal refactorings on the link stage of the compiler was done to work directly from `CompiledModule` structures instead of lists of paths. * The trans time-graph output was tweaked a little to include a name on each bar and inflate the size of the bars a little
2017-09-18incr.comp.: Fix rebase fallout.Michael Woerister-2/+1
2017-09-18incr.comp.: Remove tcx from StableHashingContext.Michael Woerister-2/+2
2017-09-18incr.comp.: Move result fingerprinting to DepGraph::with_task().Michael Woerister-0/+14
This makes sure that we don't introduce strange cases where we have nodes outside the query system that could break red/green tracking and it will allow to keep red/green neatly encapsulated within the DepGraph implementation.
2017-09-17rustc: Move codegen to a queryAlex Crichton-48/+10
This commit moves the actual code generation in the compiler behind a query keyed by a codegen unit's name. This ended up entailing quite a few internal refactorings to enable this, along with a few cut corners: * The `OutputFilenames` structure is now tracked in the `TyCtxt` as it affects a whole bunch of trans and such. This is now behind a query and threaded into the construction of the `TyCtxt`. * The `TyCtxt` now has a channel "out the back" intended to send data to worker threads in rustc_trans. This is used as a sort of side effect of the codegen query but morally what's happening here is the return value of the query (currently unit but morally a path) is only valid once the background threads have all finished. * Dispatching work items to the codegen threads was refactored to only rely on data in `TyCtxt`, which mostly just involved refactoring where data was stored, moving it from the translation thread to the controller thread's `CodegenContext` or the like. * A new thread locals was introduced in trans to work around the query system. This is used in the implementation of `assert_module_sources` which looks like an artifact of the old query system and will presumably go away once red/green is up and running.
2017-09-17rustc: Remove another global map from transAlex Crichton-12/+2
This commit removes the `crate_trans_items` field from the `CrateContext` of trans. This field, a big map, was calculated during partioning and was a set of all translation items. This isn't quite incremental-friendly because the map may change a lot but not have much effect on downstream consumers. Instead a new query was added for the one location this map was needed, along with a new comment explaining what the location is doing!
2017-09-17rustc: Mostly remove `ExportedSymbols`Alex Crichton-11/+1
This is a big map that ends up inside of a `CrateContext` during translation for all codegen units. This means that any change to the map may end up causing an incremental recompilation of a codegen unit! In order to reduce the amount of dependencies here between codegen units and the actual input crate this commit refactors dealing with exported symbols and such into various queries. The new queries are largely based on existing queries with filled out implementations for the local crate in addition to external crates, but the main idea is that while translating codegen untis no unit needs the entire set of exported symbols, instead they only need queries about particulare `DefId` instances every now and then. The linking stage, however, still generates a full list of all exported symbols from all crates, but that's going to always happen unconditionally anyway, so no news there!
2017-09-17rustc: Make trans collect/partition a queryAlex Crichton-4/+4
This commit moves the `collect_and_partition_translation_items` function into a query on `TyCtxt` instead of a free function in trans, allowing us to track dependencies and such of the function.
2017-09-17rustc: Calculate `ExportedSymbols` in a queryAlex Crichton-1/+1
This commit moves the definition of the `ExportedSymbols` structure to the `rustc` crate and then creates a query that'll be used to construct the `ExportedSymbols` set. This in turn uses the reachablity query exposed in the previous commit.
2017-09-17rustc_trans: Refactor collection to use tcxAlex Crichton-4/+4
This commit refactors the `collect_crate_translation_items` function to only require the `TyCtxt` instead of a `SharedCrateContext` in preparation for query-ifying this portion of trans.
2017-09-14bring Ty into scopeDouglas Campos-2/+2