mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Do not clone llvm.dbg.func.start and corresponding llvm.dbg.region.end during inlining.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64209 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "llvm/Constants.h"
|
||||
#include "llvm/DerivedTypes.h"
|
||||
#include "llvm/Instructions.h"
|
||||
#include "llvm/IntrinsicInst.h"
|
||||
#include "llvm/GlobalVariable.h"
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/Support/CFG.h"
|
||||
@@ -181,7 +182,7 @@ namespace {
|
||||
const char *NameSuffix;
|
||||
ClonedCodeInfo *CodeInfo;
|
||||
const TargetData *TD;
|
||||
|
||||
Value *DbgFnStart;
|
||||
public:
|
||||
PruningFunctionCloner(Function *newFunc, const Function *oldFunc,
|
||||
DenseMap<const Value*, Value*> &valueMap,
|
||||
@@ -190,7 +191,7 @@ namespace {
|
||||
ClonedCodeInfo *codeInfo,
|
||||
const TargetData *td)
|
||||
: NewFunc(newFunc), OldFunc(oldFunc), ValueMap(valueMap), Returns(returns),
|
||||
NameSuffix(nameSuffix), CodeInfo(codeInfo), TD(td) {
|
||||
NameSuffix(nameSuffix), CodeInfo(codeInfo), TD(td), DbgFnStart(NULL) {
|
||||
}
|
||||
|
||||
/// CloneBlock - The specified block is found to be reachable, clone it and
|
||||
@@ -231,7 +232,17 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB,
|
||||
ValueMap[II] = C;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Do not clone llvm.dbg.func.start and corresponding llvm.dbg.region.end.
|
||||
if (const DbgFuncStartInst *DFSI = dyn_cast<DbgFuncStartInst>(II)) {
|
||||
DbgFnStart = DFSI->getSubprogram();
|
||||
continue;
|
||||
}
|
||||
if (const DbgRegionEndInst *DREIS = dyn_cast<DbgRegionEndInst>(II)) {
|
||||
if (DREIS->getContext() == DbgFnStart)
|
||||
continue;
|
||||
}
|
||||
|
||||
Instruction *NewInst = II->clone();
|
||||
if (II->hasName())
|
||||
NewInst->setName(II->getName()+NameSuffix);
|
||||
|
Reference in New Issue
Block a user