mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-08 03:30:22 +00:00
Simplify. Compile unit check inside hasValidLocation() did not add any value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135118 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6a86feafa8
commit
0cd0c248cc
@ -1614,26 +1614,6 @@ DbgScope *DwarfDebug::getOrCreateDbgScope(const MDNode *Scope,
|
|||||||
return WScope;
|
return WScope;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// hasValidLocation - Return true if debug location entry attached with
|
|
||||||
/// machine instruction encodes valid location info.
|
|
||||||
static bool hasValidLocation(LLVMContext &Ctx,
|
|
||||||
const MachineInstr *MInsn,
|
|
||||||
const MDNode *&Scope, const MDNode *&InlinedAt) {
|
|
||||||
DebugLoc DL = MInsn->getDebugLoc();
|
|
||||||
if (DL.isUnknown()) return false;
|
|
||||||
|
|
||||||
const MDNode *S = DL.getScope(Ctx);
|
|
||||||
|
|
||||||
// There is no need to create another DIE for compile unit. For all
|
|
||||||
// other scopes, create one DbgScope now. This will be translated
|
|
||||||
// into a scope DIE at the end.
|
|
||||||
if (DIScope(S).isCompileUnit()) return false;
|
|
||||||
|
|
||||||
Scope = S;
|
|
||||||
InlinedAt = DL.getInlinedAt(Ctx);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// calculateDominanceGraph - Calculate dominance graph for DbgScope
|
/// calculateDominanceGraph - Calculate dominance graph for DbgScope
|
||||||
/// hierarchy.
|
/// hierarchy.
|
||||||
static void calculateDominanceGraph(DbgScope *Scope) {
|
static void calculateDominanceGraph(DbgScope *Scope) {
|
||||||
@ -1674,11 +1654,13 @@ void printDbgScopeInfo(LLVMContext &Ctx, const MachineFunction *MF,
|
|||||||
for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
|
for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
|
||||||
II != IE; ++II) {
|
II != IE; ++II) {
|
||||||
const MachineInstr *MInsn = II;
|
const MachineInstr *MInsn = II;
|
||||||
const MDNode *Scope = NULL;
|
MDNode *Scope = NULL;
|
||||||
const MDNode *InlinedAt = NULL;
|
MDNode *InlinedAt = NULL;
|
||||||
|
|
||||||
// Check if instruction has valid location information.
|
// Check if instruction has valid location information.
|
||||||
if (hasValidLocation(Ctx, MInsn, Scope, InlinedAt)) {
|
DebugLoc MIDL = MInsn->getDebugLoc();
|
||||||
|
if (!MIDL.isUnknown()) {
|
||||||
|
MIDL.getScopeAndInlinedAt(Scope, InlinedAt, Ctx);
|
||||||
dbgs() << " [ ";
|
dbgs() << " [ ";
|
||||||
if (InlinedAt)
|
if (InlinedAt)
|
||||||
dbgs() << "*";
|
dbgs() << "*";
|
||||||
@ -1720,14 +1702,16 @@ bool DwarfDebug::extractScopeInformation() {
|
|||||||
for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
|
for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
|
||||||
II != IE; ++II) {
|
II != IE; ++II) {
|
||||||
const MachineInstr *MInsn = II;
|
const MachineInstr *MInsn = II;
|
||||||
const MDNode *Scope = NULL;
|
MDNode *Scope = NULL;
|
||||||
const MDNode *InlinedAt = NULL;
|
MDNode *InlinedAt = NULL;
|
||||||
|
|
||||||
// Check if instruction has valid location information.
|
// Check if instruction has valid location information.
|
||||||
if (!hasValidLocation(Ctx, MInsn, Scope, InlinedAt)) {
|
const DebugLoc MIDL = MInsn->getDebugLoc();
|
||||||
|
if (MIDL.isUnknown()) {
|
||||||
PrevMI = MInsn;
|
PrevMI = MInsn;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
MIDL.getScopeAndInlinedAt(Scope, InlinedAt, Ctx);
|
||||||
|
|
||||||
// If scope has not changed then skip this instruction.
|
// If scope has not changed then skip this instruction.
|
||||||
if (Scope == PrevScope && PrevInlinedAt == InlinedAt) {
|
if (Scope == PrevScope && PrevInlinedAt == InlinedAt) {
|
||||||
|
Loading…
Reference in New Issue
Block a user