diff options
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 10 | ||||
-rw-r--r-- | lib/CodeGen/BranchFolding.cpp | 8 | ||||
-rw-r--r-- | lib/CodeGen/MachineDebugInfo.cpp | 5 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 12 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 1 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 6 |
7 files changed, 24 insertions, 20 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 12a824c8ca..e2935804fc 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -1029,6 +1029,16 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const { O << "\n\t" << TAI->getInlineAsmEnd() << "\n"; } +/// printLabel - This method prints a local label used by debug and +/// exception handling tables. +void AsmPrinter::printLabel(const MachineInstr *MI) const { + if (AsmVerbose) O << "\n"; + O << TAI->getPrivateGlobalPrefix() + << "debug_loc" + << MI->getOperand(0).getImmedValue() + << ":\n"; +} + /// PrintAsmOperand - Print the specified operand of MI, an INLINEASM /// instruction, using the specified assembler variant. Targets should /// overried this to format as appropriate. diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp index 69c6f4e62e..efc382bcfa 100644 --- a/lib/CodeGen/BranchFolding.cpp +++ b/lib/CodeGen/BranchFolding.cpp @@ -74,16 +74,12 @@ void BranchFolder::RemoveDeadBlock(MachineBasicBlock *MBB) { while (!MBB->succ_empty()) MBB->removeSuccessor(MBB->succ_end()-1); - // If there is DWARF info to active, check to see if there are any DWARF_LABEL + // If there is DWARF info to active, check to see if there are any LABEL // records in the basic block. If so, unregister them from MachineDebugInfo. if (MDI && !MBB->empty()) { - unsigned DWARF_LABELOpc = TII->getDWARF_LABELOpcode(); - assert(DWARF_LABELOpc && - "Target supports dwarf but didn't implement getDWARF_LABELOpcode!"); - for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); I != E; ++I) { - if ((unsigned)I->getOpcode() == DWARF_LABELOpc) { + if ((unsigned)I->getOpcode() == TargetInstrInfo::LABEL) { // The label ID # is always operand #0, an immediate. MDI->InvalidateLabel(I->getOperand(0).getImm()); } diff --git a/lib/CodeGen/MachineDebugInfo.cpp b/lib/CodeGen/MachineDebugInfo.cpp index 2ad1ba0ada..45e7fa2a6b 100644 --- a/lib/CodeGen/MachineDebugInfo.cpp +++ b/lib/CodeGen/MachineDebugInfo.cpp @@ -1649,9 +1649,6 @@ bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) { // Get target instruction info. const TargetInstrInfo *TII = MF.getTarget().getInstrInfo(); if (!TII) return false; - // Get target version of the debug label opcode. - unsigned DWARF_LABELOpc = TII->getDWARF_LABELOpcode(); - if (!DWARF_LABELOpc) return false; // Track if change is made. bool MadeChange = false; @@ -1664,7 +1661,7 @@ bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) { // Iterate through instructions. for (MachineBasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) { // Is it a debug label. - if ((unsigned)I->getOpcode() == DWARF_LABELOpc) { + if ((unsigned)I->getOpcode() == TargetInstrInfo::LABEL) { // The label ID # is always operand #0, an immediate. unsigned NextLabel = I->getOperand(0).getImm(); diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index c8804e907a..3a8fe7a5e6 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -737,9 +737,9 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { case TargetLowering::Expand: { MachineDebugInfo *DebugInfo = DAG.getMachineDebugInfo(); bool useDEBUG_LOC = TLI.isOperationLegal(ISD::DEBUG_LOC, MVT::Other); - bool useDEBUG_LABEL = TLI.isOperationLegal(ISD::DEBUG_LABEL, MVT::Other); + bool useLABEL = TLI.isOperationLegal(ISD::LABEL, MVT::Other); - if (DebugInfo && (useDEBUG_LOC || useDEBUG_LABEL)) { + if (DebugInfo && (useDEBUG_LOC || useLABEL)) { const std::string &FName = cast<StringSDNode>(Node->getOperand(3))->getValue(); const std::string &DirName = @@ -761,7 +761,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { unsigned Col = cast<ConstantSDNode>(ColOp)->getValue(); unsigned ID = DebugInfo->RecordLabel(Line, Col, SrcFile); Ops.push_back(DAG.getConstant(ID, MVT::i32)); - Result = DAG.getNode(ISD::DEBUG_LABEL, MVT::Other,&Ops[0],Ops.size()); + Result = DAG.getNode(ISD::LABEL, MVT::Other,&Ops[0],Ops.size()); } } else { Result = Tmp1; // chain @@ -803,9 +803,9 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { } break; - case ISD::DEBUG_LABEL: - assert(Node->getNumOperands() == 2 && "Invalid DEBUG_LABEL node!"); - switch (TLI.getOperationAction(ISD::DEBUG_LABEL, MVT::Other)) { + case ISD::LABEL: + assert(Node->getNumOperands() == 2 && "Invalid LABEL node!"); + switch (TLI.getOperationAction(ISD::LABEL, MVT::Other)) { default: assert(0 && "This action is not supported yet!"); case TargetLowering::Legal: Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain. diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index eeea70d297..33227ad4e0 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp @@ -452,6 +452,7 @@ void ScheduleDAG::EmitNode(SDNode *Node, assert(0 && "This target-independent node should have been selected!"); case ISD::EntryToken: // fall thru case ISD::TokenFactor: + case ISD::LABEL: break; case ISD::CopyToReg: { unsigned InReg; diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 5f92df3f2d..97fb8c5a04 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2691,6 +2691,7 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const { case ISD::UNDEF: return "undef"; case ISD::MERGE_VALUES: return "mergevalues"; case ISD::INLINEASM: return "inlineasm"; + case ISD::LABEL: return "label"; case ISD::HANDLENODE: return "handlenode"; case ISD::FORMAL_ARGUMENTS: return "formal_arguments"; case ISD::CALL: return "call"; @@ -2811,7 +2812,6 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const { // Debug info case ISD::LOCATION: return "location"; case ISD::DEBUG_LOC: return "debug_loc"; - case ISD::DEBUG_LABEL: return "debug_label"; case ISD::CONDCODE: switch (cast<CondCodeSDNode>(this)->get()) { diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index bf163270b5..748dae8789 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1980,7 +1980,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { DbgRegionStartInst &RSI = cast<DbgRegionStartInst>(I); if (DebugInfo && RSI.getContext() && DebugInfo->Verify(RSI.getContext())) { unsigned LabelID = DebugInfo->RecordRegionStart(RSI.getContext()); - DAG.setRoot(DAG.getNode(ISD::DEBUG_LABEL, MVT::Other, getRoot(), + DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other, getRoot(), DAG.getConstant(LabelID, MVT::i32))); } @@ -1991,7 +1991,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { DbgRegionEndInst &REI = cast<DbgRegionEndInst>(I); if (DebugInfo && REI.getContext() && DebugInfo->Verify(REI.getContext())) { unsigned LabelID = DebugInfo->RecordRegionEnd(REI.getContext()); - DAG.setRoot(DAG.getNode(ISD::DEBUG_LABEL, MVT::Other, + DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other, getRoot(), DAG.getConstant(LabelID, MVT::i32))); } @@ -2003,7 +2003,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { if (DebugInfo && FSI.getSubprogram() && DebugInfo->Verify(FSI.getSubprogram())) { unsigned LabelID = DebugInfo->RecordRegionStart(FSI.getSubprogram()); - DAG.setRoot(DAG.getNode(ISD::DEBUG_LABEL, MVT::Other, + DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other, getRoot(), DAG.getConstant(LabelID, MVT::i32))); } |