mirror of
https://github.com/exaloop/codon.git
synced 2025-06-03 15:03:52 +08:00
Better backtrace method names
This commit is contained in:
parent
0c897eaaec
commit
c20c5946fe
@ -700,9 +700,13 @@ llvm::DISubprogram *LLVMVisitor::getDISubprogramForFunc(const Func *x) {
|
|||||||
auto *derivedType = llvm::cast<llvm::DIDerivedType>(getDIType(x->getType()));
|
auto *derivedType = llvm::cast<llvm::DIDerivedType>(getDIType(x->getType()));
|
||||||
auto *subroutineType =
|
auto *subroutineType =
|
||||||
llvm::cast<llvm::DISubroutineType>(derivedType->getRawBaseType());
|
llvm::cast<llvm::DISubroutineType>(derivedType->getRawBaseType());
|
||||||
|
|
||||||
|
std::string baseName = x->getUnmangledName();
|
||||||
|
if (auto *parent = x->getParentType())
|
||||||
|
baseName = parent->getName() + "." + baseName;
|
||||||
llvm::DISubprogram *subprogram = db.builder->createFunction(
|
llvm::DISubprogram *subprogram = db.builder->createFunction(
|
||||||
file, x->getUnmangledName(), getNameForFunction(x), file, srcInfo->line,
|
file, baseName, getNameForFunction(x), file, srcInfo->line, subroutineType,
|
||||||
subroutineType, /*ScopeLine=*/0, llvm::DINode::FlagZero,
|
/*ScopeLine=*/0, llvm::DINode::FlagZero,
|
||||||
llvm::DISubprogram::toSPFlags(/*IsLocalToUnit=*/true,
|
llvm::DISubprogram::toSPFlags(/*IsLocalToUnit=*/true,
|
||||||
/*IsDefinition=*/true, /*IsOptimized=*/!db.debug));
|
/*IsDefinition=*/true, /*IsOptimized=*/!db.debug));
|
||||||
return subprogram;
|
return subprogram;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user