about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/consts.rs
AgeCommit message (Collapse)AuthorLines
2020-04-30Add a convenience function for testing whether a static is `#[thread_local]`Oliver Scherer-0/+1
2020-04-23Address comments from reviewmarmeladema-3/+2
2020-04-23Modify `as_local_hir_id` to return a bare `HirId`marmeladema-1/+1
2020-04-23Modify `as_local_hir_id` to accept a `LocalDefId` instead of a `DefId`marmeladema-1/+3
2020-04-03Rollup merge of #70720 - ecstatic-morse:issue-70637, r=oli-obkMazdak Farrokhzad-16/+13
Place TLS initializers with relocations in .tdata Should fix #70673, although I'm not sure how to test this. Perhaps @joshlf could find a MCVE? Also adds more context to the FIXME. r? @oli-obk
2020-04-02Place TLS initializers with relocations in .tdataDylan MacKenzie-16/+13
2020-04-02nix rustc_target::abi::* reexport in ty::layoutMazdak Farrokhzad-3/+2
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-5/+7
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-6/+6
2020-03-11librustc_codegen_llvm: Replace deprecated API usageTomasz Miąsko-2/+2
2020-02-15Change const eval to return `ConstValue`, instead of `Const` as the type ↵Ben Lewis-5/+3
inside it shouldn't be used.
2020-01-06Auto merge of #67886 - Centril:rustc_hir_canon_imports, r=nagisabors-2/+3
Nix `rustc_hir` reexports in rustc::hir r? @Zoxc cc @Mark-Simulacrum
2020-01-05Rename Instance.ty to Instance.monomorphic_tyAaron Hill-2/+2
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-2/+3
2020-01-04extract rustc::middle::codegen_fn_attrsMazdak Farrokhzad-5/+3
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-1/+1
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-1/+1
2019-12-24x.py fmt after previous deignoreMark Rousskov-73/+59
2019-12-22Rollup merge of #66877 - skinny121:const-eval-entry-points, r=oli-obkMazdak Farrokhzad-8/+2
Add simpler entry points to const eval for common usages. I found the `tcx.const_eval` API to be complex/awkward to work with, because of the inherent complexity from all of the different situations it is called from. Though it mainly used in one of the following ways: - Evaluates the value of a constant without any substitutions, e.g. evaluating a static, discriminant, etc. - Evaluates the value of a resolved instance of a constant. this happens when evaluating unevaluated constants or normalising trait constants. - Evaluates a promoted constant. This PR adds three new functions `const_eval_mono`, `const_eval_resolve`, and `const_eval_promoted` to `TyCtxt`, which each cater to one of the three ways `tcx.const_eval` is normally used.
2019-12-21Handle Attributes in arena.Camille GILLOT-2/+2
2019-12-22Add simpler entry points to const eval for common usages.Ben Lewis-8/+2
2019-12-11Remove unused importAaron Hill-1/+0
2019-12-11rustc: Link LLVM directly into rustc againAlex Crichton-0/+3
This commit builds on #65501 continue to simplify the build system and compiler now that we no longer have multiple LLVM backends to ship by default. Here this switches the compiler back to what it once was long long ago, which is linking LLVM directly to the compiler rather than dynamically loading it at runtime. The `codegen-backends` directory of the sysroot no longer exists and all relevant support in the build system is removed. Note that `rustc` still supports a dynamically loaded codegen backend as it did previously, it just no longer supports dynamically loaded codegen backends in its own sysroot. Additionally as part of this the `librustc_codegen_llvm` crate now once again explicitly depends on all of its crates instead of implicitly loading them through the sysroot. This involved filling out its `Cargo.toml` and deleting all the now-unnecessary `extern crate` annotations in the header of the crate. (this in turn required adding a number of imports for names of macros too). The end results of this change are: * Rustbuild's build process for the compiler as all the "oh don't forget the codegen backend" checks can be easily removed. * Building `rustc_codegen_llvm` is much simpler since it's simply another compiler crate. * Managing the dependencies of `rustc_codegen_llvm` is much simpler since it's "just another `Cargo.toml` to edit" * The build process should be a smidge faster because there's more parallelism in the main rustc build step rather than splitting `librustc_codegen_llvm` out to its own step. * The compiler is expected to be slightly faster by default because the codegen backend does not need to be dynamically loaded. * Disabling LLVM as part of rustbuild is still supported, supporting multiple codegen backends is still supported, and dynamic loading of a codegen backend is still supported.
2019-12-04Migrate to LLVM{Get,Set}ValueName2Josh Stone-6/+4
The deprecated `LLVM{Get,Set}ValueName` only work with NUL-terminated strings, but the `2` variants use explicit lengths, which fits better with Rust strings and slices. We now use these in new helper functions `llvm::{get,set}_value_name` that convert to/from `&[u8]`.
2019-11-18Allow different global references to the same nameStephen Crane-3/+5
Combining CGUs can result in code that references a static variable through both an Item and a ForeignItem with the same name. We don't care that the global was already created by a ForeignItem reference when we see the Item reference, as long as the LLVM types of the ForeignItem and Item match. Fixes #66464
2019-11-12Rename in librustc_codegen_llvm.Camille GILLOT-2/+2
2019-10-21Change `SymbolName::name` from `InternedString` to `Symbol`.Nicholas Nethercote-1/+1
This requires changing the `PartialOrd`/`Ord` implementations to look at the chars rather than the symbol index.
2019-10-05Replaces some instances of `as *[const | mut] _` with `.cast()`memoryruins-3/+3
2019-09-26Rename `ForeignItem.node` to `ForeignItem.kind`varkor-1/+1
2019-09-26Rename `Item.node` to `Item.kind`varkor-1/+1
2019-09-25Rename `sty` to `kind`varkor-1/+1
2019-09-05Rollup merge of #64141 - nnethercote:minimize-LocalInternedString, ↵Mazdak Farrokhzad-7/+8
r=petrochenkov Minimize uses of `LocalInternedString` `LocalInternedString` is described as "An alternative to `Symbol` and `InternedString`, useful when the chars within the symbol need to be accessed. It is best used for temporary values." This PR makes the code match that comment, by removing all non-local uses of `LocalInternedString`. This allows the removal of a number of operations on `LocalInternedString` and a couple of uses of `unsafe`.
2019-09-04Remove `LocalInternedString` uses from `librustc_codegen_llvm/consts.rs`.Nicholas Nethercote-7/+8
2019-09-04Remove `LocalInternedString` uses from `librustc/ty/`.Nicholas Nethercote-1/+1
This is not a compelling change in isolation, but it is a necessary step.
2019-08-30Fixup remaining direct relocation field referencesAndreas Molzer-4/+4
2019-08-28Address naming and comments from reviewsAndreas Molzer-3/+3
2019-08-21Fix codegen with explicit allocation byte accessAndreas Molzer-7/+48
2019-08-02CTFE: simplify Value type by not checking for alignmentRalf Jung-2/+2
2019-06-22Rollup merge of #61984 - ljedrz:more_node_id_pruning, r=ZoxcMazdak Farrokhzad-1/+1
More NodeId pruning Just another round of the `HirId`ification initiative. r? @Zoxc
2019-06-20rename hir::map::get_by_hir_id to getljedrz-1/+1
2019-06-19Pacify tidyOliver Scherer-1/+3
2019-06-19Change `ByRef` to a struct variant to clarify its fields via namesOliver Scherer-1/+1
2019-06-19Remove the `AllocId` from `ByRef` valuesOliver Scherer-1/+1
`ByRef` const values have no identity beyond their value, we should not treat them as having identity. The `AllocId` often differed between equal constants, because of the way that the miri-engine evaluates constants.
2019-06-19Weave the alignment through `ByRef`Oliver Scherer-1/+3
2019-06-02remove unneeded depsMark Mansi-1/+0
2019-06-02remove reexports of mir::mono::{MonoItem,CodegenUnit}Mark Mansi-0/+1
2019-06-02remove reexport of rustc::ty::InstanceMark Mansi-2/+1
2019-05-27Refine the message to at least *mention* the attribute itself.Felix S. Klock II-1/+2
Update pre-existing test's diagnostic output accordingly.
2019-05-27Always supply span to check_and_apply_linkage, sidestepping need to add ↵Felix S. Klock II-16/+6
`bug!`s to rustc.
2019-05-13Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.Nicholas Nethercote-1/+2