1 use super::metadata::UNKNOWN_COLUMN_NUMBER;
2 use super::utils::{debug_context, span_start};
4 use crate::common::CodegenCx;
5 use crate::llvm::debuginfo::DIScope;
6 use crate::llvm::{self, Value};
7 use rustc_codegen_ssa::traits::*;
10 use rustc_span::{Pos, Span};
12 impl CodegenCx<'ll, '_> {
13 pub fn create_debug_loc(&self, scope: &'ll DIScope, span: Span) -> &'ll Value {
14 let loc = span_start(self, span);
16 // For MSVC, set the column number to zero.
17 // Otherwise, emit it. This mimics clang behaviour.
18 // See discussion in https://github.com/rust-lang/rust/issues/42921
19 let col_used = if self.sess().target.target.options.is_like_msvc {
22 loc.col.to_usize() as c_uint
26 llvm::LLVMRustDIBuilderCreateDebugLocation(
27 debug_context(self).llcontext,