diff options
| author | Denis Merigoux <denis.merigoux@gmail.com> | 2018-09-06 13:52:15 -0700 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-11-16 14:11:59 +0200 |
| commit | e224f063e8b7ea16302d0b048b9272dfe8465734 (patch) | |
| tree | 0b52a6127d62aea4cf8ab5545aab28b8db210e72 /src/librustc_codegen_llvm/back | |
| parent | 6d42574b7a22831de97a6ca458f22d011561be56 (diff) | |
| download | rust-e224f063e8b7ea16302d0b048b9272dfe8465734.tar.gz rust-e224f063e8b7ea16302d0b048b9272dfe8465734.zip | |
Prefixed type methods & removed trait impl for write::CodegenContext
Diffstat (limited to 'src/librustc_codegen_llvm/back')
| -rw-r--r-- | src/librustc_codegen_llvm/back/write.rs | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/src/librustc_codegen_llvm/back/write.rs b/src/librustc_codegen_llvm/back/write.rs index 9eaafb1c21d..6977b128509 100644 --- a/src/librustc_codegen_llvm/back/write.rs +++ b/src/librustc_codegen_llvm/back/write.rs @@ -24,7 +24,7 @@ use rustc::session::config::{self, OutputFilenames, OutputType, Passes, Sanitize use rustc::session::Session; use rustc::util::nodemap::FxHashMap; use time_graph::{self, TimeGraph, Timeline}; -use llvm::{self, DiagnosticInfo, PassManager, SMDiagnostic, BasicBlock}; +use llvm::{self, DiagnosticInfo, PassManager, SMDiagnostic}; use llvm_util; use {CodegenResults, ModuleCodegen, CompiledModule, ModuleKind, // ModuleLlvm, CachedModuleCodegen}; @@ -46,7 +46,6 @@ use syntax_pos::MultiSpan; use syntax_pos::symbol::Symbol; use type_::Type; use context::{is_pie_binary, get_reloc_model}; -use interfaces::{Backend, CommonWriteMethods}; use common; use jobserver::{Client, Acquired}; use rustc_demangle; @@ -429,15 +428,8 @@ impl CodegenContext<'ll> { } } -impl<'ll> Backend for CodegenContext<'ll> { - type Value = &'ll Value; - type BasicBlock = &'ll BasicBlock; - type Type = &'ll Type; - type Context = &'ll llvm::Context; - type TypeKind = llvm::TypeKind; -} -impl CommonWriteMethods for CodegenContext<'ll> { +impl CodegenContext<'ll> { fn val_ty(&self, v: &'ll Value) -> &'ll Type { common::val_ty(v) } @@ -446,18 +438,7 @@ impl CommonWriteMethods for CodegenContext<'ll> { common::const_bytes_in_context(llcx, bytes) } - fn const_struct_in_context( - &self, - llcx: &'a llvm::Context, - elts: &[&'a Value], - packed: bool, - ) -> &'a Value { - common::const_struct_in_context(llcx, elts, packed) - } -} - -impl CodegenContext<'ll> { - pub fn ptr_to(&self, ty: &'ll Type) -> &'ll Type { + pub fn type_ptr_to(&self, ty: &'ll Type) -> &'ll Type { unsafe { llvm::LLVMPointerType(ty, 0) } |
