forked from OSchip/llvm-project
[DebugInfo] Merge DebugInfoFinder::{processDeclare,processValue} into processVariable
The two functions are identical.
This commit is contained in:
parent
c4b4c0c47c
commit
ecd2aaee06
|
@ -24,8 +24,7 @@
|
|||
|
||||
namespace llvm {
|
||||
|
||||
class DbgDeclareInst;
|
||||
class DbgValueInst;
|
||||
class DbgVariableIntrinsic;
|
||||
class Instruction;
|
||||
class Module;
|
||||
|
||||
|
@ -77,10 +76,8 @@ public:
|
|||
/// Process a single instruction and collect debug info anchors.
|
||||
void processInstruction(const Module &M, const Instruction &I);
|
||||
|
||||
/// Process DbgDeclareInst.
|
||||
void processDeclare(const Module &M, const DbgDeclareInst *DDI);
|
||||
/// Process DbgValueInst.
|
||||
void processValue(const Module &M, const DbgValueInst *DVI);
|
||||
/// Process DbgVariableIntrinsic.
|
||||
void processVariable(const Module &M, const DbgVariableIntrinsic &DVI);
|
||||
/// Process debug info location.
|
||||
void processLocation(const Module &M, const DILocation *Loc);
|
||||
|
||||
|
|
|
@ -105,10 +105,8 @@ void DebugInfoFinder::processCompileUnit(DICompileUnit *CU) {
|
|||
|
||||
void DebugInfoFinder::processInstruction(const Module &M,
|
||||
const Instruction &I) {
|
||||
if (auto *DDI = dyn_cast<DbgDeclareInst>(&I))
|
||||
processDeclare(M, DDI);
|
||||
else if (auto *DVI = dyn_cast<DbgValueInst>(&I))
|
||||
processValue(M, DVI);
|
||||
if (auto *DVI = dyn_cast<DbgVariableIntrinsic>(&I))
|
||||
processVariable(M, *DVI);
|
||||
|
||||
if (auto DbgLoc = I.getDebugLoc())
|
||||
processLocation(M, DbgLoc.get());
|
||||
|
@ -194,24 +192,9 @@ void DebugInfoFinder::processSubprogram(DISubprogram *SP) {
|
|||
}
|
||||
}
|
||||
|
||||
void DebugInfoFinder::processDeclare(const Module &M,
|
||||
const DbgDeclareInst *DDI) {
|
||||
auto *N = dyn_cast<MDNode>(DDI->getVariable());
|
||||
if (!N)
|
||||
return;
|
||||
|
||||
auto *DV = dyn_cast<DILocalVariable>(N);
|
||||
if (!DV)
|
||||
return;
|
||||
|
||||
if (!NodesSeen.insert(DV).second)
|
||||
return;
|
||||
processScope(DV->getScope());
|
||||
processType(DV->getType());
|
||||
}
|
||||
|
||||
void DebugInfoFinder::processValue(const Module &M, const DbgValueInst *DVI) {
|
||||
auto *N = dyn_cast<MDNode>(DVI->getVariable());
|
||||
void DebugInfoFinder::processVariable(const Module &M,
|
||||
const DbgVariableIntrinsic &DVI) {
|
||||
auto *N = dyn_cast<MDNode>(DVI.getVariable());
|
||||
if (!N)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in New Issue