Rebase to the llvm-project monorepo
The new git submodule src/llvm-project is a monorepo replacing src/llvm and src/tools/{clang,lld,lldb}. This also serves as a rebase for these projects to the new 8.x branch from trunk. The src/llvm-emscripten fork is unchanged for now.
This commit is contained in:
parent
bf669d1e32
commit
df0466d0bb
18 changed files with 166 additions and 65 deletions
|
@ -12,7 +12,7 @@ use self::source_loc::InternalDebugLocation::{self, UnknownLocation};
|
|||
|
||||
use llvm;
|
||||
use llvm::debuginfo::{DIFile, DIType, DIScope, DIBuilder, DISubprogram, DIArray, DIFlags,
|
||||
DILexicalBlock};
|
||||
DISPFlags, DILexicalBlock};
|
||||
use rustc::hir::CodegenFnAttrFlags;
|
||||
use rustc::hir::def_id::{DefId, CrateNum, LOCAL_CRATE};
|
||||
use rustc::ty::subst::{Substs, UnpackedKind};
|
||||
|
@ -283,7 +283,6 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
|
|||
let linkage_name = mangled_name_of_instance(self, instance);
|
||||
|
||||
let scope_line = span_start(self, span).line;
|
||||
let is_local_to_unit = is_node_local_to_unit(self, def_id);
|
||||
|
||||
let function_name = CString::new(name).unwrap();
|
||||
let linkage_name = SmallCStr::new(&linkage_name.as_str());
|
||||
|
@ -300,6 +299,14 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
|
|||
flags |= DIFlags::FlagNoReturn;
|
||||
}
|
||||
|
||||
let mut spflags = DISPFlags::SPFlagDefinition;
|
||||
if is_node_local_to_unit(self, def_id) {
|
||||
spflags |= DISPFlags::SPFlagLocalToUnit;
|
||||
}
|
||||
if self.sess().opts.optimize != config::OptLevel::No {
|
||||
spflags |= DISPFlags::SPFlagOptimized;
|
||||
}
|
||||
|
||||
let fn_metadata = unsafe {
|
||||
llvm::LLVMRustDIBuilderCreateFunction(
|
||||
DIB(self),
|
||||
|
@ -309,11 +316,9 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
|
|||
file_metadata,
|
||||
loc.line as c_uint,
|
||||
function_type_metadata,
|
||||
is_local_to_unit,
|
||||
true,
|
||||
scope_line as c_uint,
|
||||
flags,
|
||||
self.sess().opts.optimize != config::OptLevel::No,
|
||||
spflags,
|
||||
llfn,
|
||||
template_parameters,
|
||||
None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue