mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-19 02:25:01 +00:00
Stay within 80 columns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137283 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -64,8 +64,8 @@ public:
|
|||||||
/// getCurrentFunctionScope - Return lexical scope for the current function.
|
/// getCurrentFunctionScope - Return lexical scope for the current function.
|
||||||
LexicalScope *getCurrentFunctionScope() const { return CurrentFnLexicalScope;}
|
LexicalScope *getCurrentFunctionScope() const { return CurrentFnLexicalScope;}
|
||||||
|
|
||||||
/// getMachineBasicBlocks - Populate given set using machine basic blocks which
|
/// getMachineBasicBlocks - Populate given set using machine basic blocks
|
||||||
/// have machine instructions that belong to lexical scope identified by
|
/// which have machine instructions that belong to lexical scope identified by
|
||||||
/// DebugLoc.
|
/// DebugLoc.
|
||||||
void getMachineBasicBlocks(DebugLoc DL,
|
void getMachineBasicBlocks(DebugLoc DL,
|
||||||
SmallPtrSet<const MachineBasicBlock*, 4> &MBBs);
|
SmallPtrSet<const MachineBasicBlock*, 4> &MBBs);
|
||||||
|
@@ -199,7 +199,8 @@ DIE *DwarfDebug::createSubprogramDIE(DISubprogram SP) {
|
|||||||
|
|
||||||
StringRef LinkageName = SP.getLinkageName();
|
StringRef LinkageName = SP.getLinkageName();
|
||||||
if (!LinkageName.empty())
|
if (!LinkageName.empty())
|
||||||
SPCU->addString(SPDie, dwarf::DW_AT_MIPS_linkage_name, dwarf::DW_FORM_string,
|
SPCU->addString(SPDie, dwarf::DW_AT_MIPS_linkage_name,
|
||||||
|
dwarf::DW_FORM_string,
|
||||||
getRealLinkageName(LinkageName));
|
getRealLinkageName(LinkageName));
|
||||||
|
|
||||||
// If this DIE is going to refer declaration info using AT_specification
|
// If this DIE is going to refer declaration info using AT_specification
|
||||||
@@ -372,7 +373,8 @@ DIE *DwarfDebug::constructLexicalScopeDIE(LexicalScope *Scope) {
|
|||||||
// .debug_range as a uint, size 4, for now. emitDIE will handle
|
// .debug_range as a uint, size 4, for now. emitDIE will handle
|
||||||
// DW_AT_ranges appropriately.
|
// DW_AT_ranges appropriately.
|
||||||
TheCU->addUInt(ScopeDIE, dwarf::DW_AT_ranges, dwarf::DW_FORM_data4,
|
TheCU->addUInt(ScopeDIE, dwarf::DW_AT_ranges, dwarf::DW_FORM_data4,
|
||||||
DebugRangeSymbols.size() * Asm->getTargetData().getPointerSize());
|
DebugRangeSymbols.size()
|
||||||
|
* Asm->getTargetData().getPointerSize());
|
||||||
for (SmallVector<InsnRange, 4>::const_iterator RI = Ranges.begin(),
|
for (SmallVector<InsnRange, 4>::const_iterator RI = Ranges.begin(),
|
||||||
RE = Ranges.end(); RI != RE; ++RI) {
|
RE = Ranges.end(); RI != RE; ++RI) {
|
||||||
DebugRangeSymbols.push_back(getLabelBeforeInsn(RI->first));
|
DebugRangeSymbols.push_back(getLabelBeforeInsn(RI->first));
|
||||||
@@ -439,7 +441,8 @@ DIE *DwarfDebug::constructInlinedScopeDIE(LexicalScope *Scope) {
|
|||||||
// .debug_range as a uint, size 4, for now. emitDIE will handle
|
// .debug_range as a uint, size 4, for now. emitDIE will handle
|
||||||
// DW_AT_ranges appropriately.
|
// DW_AT_ranges appropriately.
|
||||||
TheCU->addUInt(ScopeDIE, dwarf::DW_AT_ranges, dwarf::DW_FORM_data4,
|
TheCU->addUInt(ScopeDIE, dwarf::DW_AT_ranges, dwarf::DW_FORM_data4,
|
||||||
DebugRangeSymbols.size() * Asm->getTargetData().getPointerSize());
|
DebugRangeSymbols.size()
|
||||||
|
* Asm->getTargetData().getPointerSize());
|
||||||
for (SmallVector<InsnRange, 4>::const_iterator RI = Ranges.begin(),
|
for (SmallVector<InsnRange, 4>::const_iterator RI = Ranges.begin(),
|
||||||
RE = Ranges.end(); RI != RE; ++RI) {
|
RE = Ranges.end(); RI != RE; ++RI) {
|
||||||
DebugRangeSymbols.push_back(getLabelBeforeInsn(RI->first));
|
DebugRangeSymbols.push_back(getLabelBeforeInsn(RI->first));
|
||||||
@@ -448,8 +451,10 @@ DIE *DwarfDebug::constructInlinedScopeDIE(LexicalScope *Scope) {
|
|||||||
DebugRangeSymbols.push_back(NULL);
|
DebugRangeSymbols.push_back(NULL);
|
||||||
DebugRangeSymbols.push_back(NULL);
|
DebugRangeSymbols.push_back(NULL);
|
||||||
} else {
|
} else {
|
||||||
TheCU->addLabel(ScopeDIE, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr, StartLabel);
|
TheCU->addLabel(ScopeDIE, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr,
|
||||||
TheCU->addLabel(ScopeDIE, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr, EndLabel);
|
StartLabel);
|
||||||
|
TheCU->addLabel(ScopeDIE, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr,
|
||||||
|
EndLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
InlinedSubprogramDIEs.insert(OriginDIE);
|
InlinedSubprogramDIEs.insert(OriginDIE);
|
||||||
@@ -550,7 +555,8 @@ DIE *DwarfDebug::constructVariableDIE(DbgVariable *DV, LexicalScope *Scope) {
|
|||||||
|
|
||||||
unsigned Offset = DV->getDotDebugLocOffset();
|
unsigned Offset = DV->getDotDebugLocOffset();
|
||||||
if (Offset != ~0U) {
|
if (Offset != ~0U) {
|
||||||
VariableCU->addLabel(VariableDie, dwarf::DW_AT_location, dwarf::DW_FORM_data4,
|
VariableCU->addLabel(VariableDie, dwarf::DW_AT_location,
|
||||||
|
dwarf::DW_FORM_data4,
|
||||||
Asm->GetTempSymbol("debug_loc", Offset));
|
Asm->GetTempSymbol("debug_loc", Offset));
|
||||||
DV->setDIE(VariableDie);
|
DV->setDIE(VariableDie);
|
||||||
UseDotDebugLocEntry.insert(VariableDie);
|
UseDotDebugLocEntry.insert(VariableDie);
|
||||||
@@ -749,7 +755,8 @@ void DwarfDebug::constructCompileUnit(const MDNode *N) {
|
|||||||
|
|
||||||
StringRef Flags = DIUnit.getFlags();
|
StringRef Flags = DIUnit.getFlags();
|
||||||
if (!Flags.empty())
|
if (!Flags.empty())
|
||||||
NewCU->addString(Die, dwarf::DW_AT_APPLE_flags, dwarf::DW_FORM_string, Flags);
|
NewCU->addString(Die, dwarf::DW_AT_APPLE_flags, dwarf::DW_FORM_string,
|
||||||
|
Flags);
|
||||||
|
|
||||||
unsigned RVer = DIUnit.getRunTimeVersion();
|
unsigned RVer = DIUnit.getRunTimeVersion();
|
||||||
if (RVer)
|
if (RVer)
|
||||||
@@ -874,7 +881,8 @@ void DwarfDebug::constructGlobalVariableDIE(const MDNode *N) {
|
|||||||
TheCU->addDIEEntry(VariableSpecDIE, dwarf::DW_AT_specification,
|
TheCU->addDIEEntry(VariableSpecDIE, dwarf::DW_AT_specification,
|
||||||
dwarf::DW_FORM_ref4, VariableDIE);
|
dwarf::DW_FORM_ref4, VariableDIE);
|
||||||
TheCU->addBlock(VariableSpecDIE, dwarf::DW_AT_location, 0, Block);
|
TheCU->addBlock(VariableSpecDIE, dwarf::DW_AT_location, 0, Block);
|
||||||
TheCU->addUInt(VariableDIE, dwarf::DW_AT_declaration, dwarf::DW_FORM_flag, 1);
|
TheCU->addUInt(VariableDIE, dwarf::DW_AT_declaration, dwarf::DW_FORM_flag,
|
||||||
|
1);
|
||||||
TheCU->addDie(VariableSpecDIE);
|
TheCU->addDie(VariableSpecDIE);
|
||||||
} else {
|
} else {
|
||||||
TheCU->addBlock(VariableDIE, dwarf::DW_AT_location, 0, Block);
|
TheCU->addBlock(VariableDIE, dwarf::DW_AT_location, 0, Block);
|
||||||
@@ -1035,7 +1043,8 @@ void DwarfDebug::endModule() {
|
|||||||
if (!NMD) continue;
|
if (!NMD) continue;
|
||||||
unsigned E = NMD->getNumOperands();
|
unsigned E = NMD->getNumOperands();
|
||||||
if (!E) continue;
|
if (!E) continue;
|
||||||
LexicalScope *Scope = new LexicalScope(NULL, DIDescriptor(SP), NULL, false);
|
LexicalScope *Scope = new LexicalScope(NULL, DIDescriptor(SP), NULL,
|
||||||
|
false);
|
||||||
DeadFnScopeMap[SP] = Scope;
|
DeadFnScopeMap[SP] = Scope;
|
||||||
SmallVector<DbgVariable *, 8> Variables;
|
SmallVector<DbgVariable *, 8> Variables;
|
||||||
for (unsigned I = 0; I != E; ++I) {
|
for (unsigned I = 0; I != E; ++I) {
|
||||||
@@ -1428,10 +1437,10 @@ void DwarfDebug::endInstruction(const MachineInstr *MI) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// identifyScopeMarkers() -
|
/// identifyScopeMarkers() -
|
||||||
/// Each LexicalScope has first instruction and last instruction to mark beginning
|
/// Each LexicalScope has first instruction and last instruction to mark
|
||||||
/// and end of a scope respectively. Create an inverse map that list scopes
|
/// beginning and end of a scope respectively. Create an inverse map that list
|
||||||
/// starts (and ends) with an instruction. One instruction may start (or end)
|
/// scopes starts (and ends) with an instruction. One instruction may start (or
|
||||||
/// multiple scopes. Ignore scopes that are not reachable.
|
/// end) multiple scopes. Ignore scopes that are not reachable.
|
||||||
void DwarfDebug::identifyScopeMarkers() {
|
void DwarfDebug::identifyScopeMarkers() {
|
||||||
SmallVector<LexicalScope *, 4> WorkList;
|
SmallVector<LexicalScope *, 4> WorkList;
|
||||||
WorkList.push_back(LScopes.getCurrentFunctionScope());
|
WorkList.push_back(LScopes.getCurrentFunctionScope());
|
||||||
@@ -1617,7 +1626,8 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
|
|||||||
const MachineInstr *Prev = History.back();
|
const MachineInstr *Prev = History.back();
|
||||||
if (Prev->isDebugValue() && isDbgValueInDefinedReg(Prev)) {
|
if (Prev->isDebugValue() && isDbgValueInDefinedReg(Prev)) {
|
||||||
const MachineBasicBlock *PrevMBB = Prev->getParent();
|
const MachineBasicBlock *PrevMBB = Prev->getParent();
|
||||||
MachineBasicBlock::const_iterator LastMI = PrevMBB->getLastNonDebugInstr();
|
MachineBasicBlock::const_iterator LastMI =
|
||||||
|
PrevMBB->getLastNonDebugInstr();
|
||||||
if (LastMI == PrevMBB->end())
|
if (LastMI == PrevMBB->end())
|
||||||
// Drop DBG_VALUE for empty range.
|
// Drop DBG_VALUE for empty range.
|
||||||
History.pop_back();
|
History.pop_back();
|
||||||
@@ -1698,8 +1708,8 @@ void DwarfDebug::endFunction(const MachineFunction *MF) {
|
|||||||
|
|
||||||
if (!DisableFramePointerElim(*MF)) {
|
if (!DisableFramePointerElim(*MF)) {
|
||||||
LexicalScope *FnScope = LScopes.getCurrentFunctionScope();
|
LexicalScope *FnScope = LScopes.getCurrentFunctionScope();
|
||||||
getCompileUnit(FnScope->getScopeNode())->addUInt(CurFnDIE,
|
CompileUnit *TheCU = getCompileUnit(FnScope->getScopeNode());
|
||||||
dwarf::DW_AT_APPLE_omit_frame_ptr,
|
TheCU->addUInt(CurFnDIE, dwarf::DW_AT_APPLE_omit_frame_ptr,
|
||||||
dwarf::DW_FORM_flag, 1);
|
dwarf::DW_FORM_flag, 1);
|
||||||
}
|
}
|
||||||
DebugFrames.push_back(FunctionDebugFrameInfo(Asm->getFunctionNumber(),
|
DebugFrames.push_back(FunctionDebugFrameInfo(Asm->getFunctionNumber(),
|
||||||
|
@@ -221,11 +221,12 @@ void LexicalScopes::constructScopeNest(LexicalScope *Scope) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// assignInstructionRanges - Find ranges of instructions covered by each lexical
|
/// assignInstructionRanges - Find ranges of instructions covered by each
|
||||||
/// scope.
|
/// lexical scope.
|
||||||
void LexicalScopes::
|
void LexicalScopes::
|
||||||
assignInstructionRanges(SmallVectorImpl<InsnRange> &MIRanges,
|
assignInstructionRanges(SmallVectorImpl<InsnRange> &MIRanges,
|
||||||
DenseMap<const MachineInstr *, LexicalScope *> &MI2ScopeMap) {
|
DenseMap<const MachineInstr *, LexicalScope *> &MI2ScopeMap)
|
||||||
|
{
|
||||||
|
|
||||||
LexicalScope *PrevLexicalScope = NULL;
|
LexicalScope *PrevLexicalScope = NULL;
|
||||||
for (SmallVectorImpl<InsnRange>::const_iterator RI = MIRanges.begin(),
|
for (SmallVectorImpl<InsnRange>::const_iterator RI = MIRanges.begin(),
|
||||||
@@ -248,7 +249,8 @@ assignInstructionRanges(SmallVectorImpl<InsnRange> &MIRanges,
|
|||||||
/// have machine instructions that belong to lexical scope identified by
|
/// have machine instructions that belong to lexical scope identified by
|
||||||
/// DebugLoc.
|
/// DebugLoc.
|
||||||
void LexicalScopes::
|
void LexicalScopes::
|
||||||
getMachineBasicBlocks(DebugLoc DL, SmallPtrSet<const MachineBasicBlock*, 4> &MBBs) {
|
getMachineBasicBlocks(DebugLoc DL,
|
||||||
|
SmallPtrSet<const MachineBasicBlock*, 4> &MBBs) {
|
||||||
MBBs.clear();
|
MBBs.clear();
|
||||||
LexicalScope *Scope = getOrCreateLexicalScope(DL);
|
LexicalScope *Scope = getOrCreateLexicalScope(DL);
|
||||||
if (!Scope)
|
if (!Scope)
|
||||||
|
Reference in New Issue
Block a user