Let backends access span information
Sometimes, a backend may need to emit warnings, errors, or otherwise need to know the span of the current item in a basic block. So, add a set_span method to give the backend that information.
This commit is contained in:
parent
5849a7eca9
commit
c5bc95676b
3 changed files with 6 additions and 1 deletions
|
@ -16,7 +16,7 @@ use rustc_data_structures::small_c_str::SmallCStr;
|
|||
use rustc_hir::def_id::DefId;
|
||||
use rustc_middle::ty::layout::TyAndLayout;
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt};
|
||||
use rustc_span::sym;
|
||||
use rustc_span::{sym, Span};
|
||||
use rustc_target::abi::{self, Align, Size};
|
||||
use rustc_target::spec::{HasTargetSpec, Target};
|
||||
use std::borrow::Cow;
|
||||
|
@ -139,6 +139,8 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
|
|||
unsafe { llvm::LLVMGetInsertBlock(self.llbuilder) }
|
||||
}
|
||||
|
||||
fn set_span(&self, _span: Span) {}
|
||||
|
||||
fn position_at_end(&mut self, llbb: &'ll BasicBlock) {
|
||||
unsafe {
|
||||
llvm::LLVMPositionBuilderAtEnd(self.llbuilder, llbb);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue