mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
While inlining, clone llvm.dbg.func.start intrinsic and adjust
llvm.dbg.region.end instrinsic. This nested llvm.dbg.func.start/llvm.dbg.region.end pair now enables DW_TAG_inlined_subroutine support in code generator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69118 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -24,6 +24,7 @@
|
||||
#include "llvm/Support/Compiler.h"
|
||||
#include "llvm/Transforms/Utils/ValueMapper.h"
|
||||
#include "llvm/Analysis/ConstantFolding.h"
|
||||
#include "llvm/Analysis/DebugInfo.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include <map>
|
||||
using namespace llvm;
|
||||
@ -233,10 +234,13 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB,
|
||||
continue;
|
||||
}
|
||||
|
||||
// Do not clone llvm.dbg.func.start and corresponding llvm.dbg.region.end.
|
||||
// Do not clone llvm.dbg.region.end. It will be adjusted by the inliner.
|
||||
if (const DbgFuncStartInst *DFSI = dyn_cast<DbgFuncStartInst>(II)) {
|
||||
DbgFnStart = DFSI->getSubprogram();
|
||||
continue;
|
||||
if (DbgFnStart == NULL) {
|
||||
DISubprogram SP(cast<GlobalVariable>(DFSI->getSubprogram()));
|
||||
if (SP.describes(BB->getParent()))
|
||||
DbgFnStart = DFSI->getSubprogram();
|
||||
}
|
||||
}
|
||||
if (const DbgRegionEndInst *DREIS = dyn_cast<DbgRegionEndInst>(II)) {
|
||||
if (DREIS->getContext() == DbgFnStart)
|
||||
|
Reference in New Issue
Block a user