diff options
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/AsmPrinter.h | 8 | ||||
-rw-r--r-- | include/llvm/CodeGen/DwarfWriter.h | 9 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineModuleInfo.h | 25 |
3 files changed, 22 insertions, 20 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h index 8ade1bd..6187447 100644 --- a/include/llvm/CodeGen/AsmPrinter.h +++ b/include/llvm/CodeGen/AsmPrinter.h @@ -136,6 +136,7 @@ namespace llvm { mutable const MachineInstr *LastMI; mutable const Function *LastFn; mutable unsigned Counter; + mutable unsigned SetCounter; // Private state for processDebugLoc() mutable const MDNode *PrevDLT; @@ -275,6 +276,13 @@ namespace llvm { /// EmitInt64 - Emit a long long directive and value. /// void EmitInt64(uint64_t Value) const; + + + /// EmitLabelDifference - Emit something like ".long Hi-Lo" where the size + /// in bytes of the directive is specified by Size and Hi/Lo specify the + /// labels. This implicitly uses .set if it is available. + void EmitLabelDifference(const MCSymbol *Hi, const MCSymbol *Lo, + unsigned Size) const; //===------------------------------------------------------------------===// diff --git a/include/llvm/CodeGen/DwarfWriter.h b/include/llvm/CodeGen/DwarfWriter.h index d59e22a..3c7f802 100644 --- a/include/llvm/CodeGen/DwarfWriter.h +++ b/include/llvm/CodeGen/DwarfWriter.h @@ -35,6 +35,7 @@ class Value; class Module; class MDNode; class MCAsmInfo; +class MCSymbol; class raw_ostream; class Instruction; class DICompileUnit; @@ -82,10 +83,10 @@ public: /// void EndFunction(const MachineFunction *MF); - /// RecordSourceLine - Register a source line with debug info. Returns a - /// unique label ID used to generate a label and provide correspondence to + /// RecordSourceLine - Register a source line with debug info. Returns the + /// unique label that was emitted and which provides correspondence to /// the source line list. - unsigned RecordSourceLine(unsigned Line, unsigned Col, MDNode *Scope); + MCSymbol *RecordSourceLine(unsigned Line, unsigned Col, MDNode *Scope); /// getRecordSourceLineCount - Count source lines. unsigned getRecordSourceLineCount(); @@ -94,7 +95,7 @@ public: /// be emitted. bool ShouldEmitDwarfDebug() const; - void BeginScope(const MachineInstr *MI, unsigned Label); + void BeginScope(const MachineInstr *MI, MCSymbol *Label); void EndScope(const MachineInstr *MI); }; diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h index 8eeac9f..fff8e83 100644 --- a/include/llvm/CodeGen/MachineModuleInfo.h +++ b/include/llvm/CodeGen/MachineModuleInfo.h @@ -217,26 +217,19 @@ public: /// MachineModuleInfo, for example because the code was deleted. void InvalidateLabel(unsigned LabelID) { // Remap to zero to indicate deletion. - RemapLabel(LabelID, 0); - } - - /// RemapLabel - Indicate that a label has been merged into another. - /// - void RemapLabel(unsigned OldLabelID, unsigned NewLabelID) { - assert(0 < OldLabelID && OldLabelID <= LabelIDList.size() && - "Old label ID out of range."); - assert(NewLabelID <= LabelIDList.size() && - "New label ID out of range."); - LabelIDList[OldLabelID - 1] = NewLabelID; + assert(0 < LabelID && LabelID <= LabelIDList.size() && + "Old label ID out of range."); + LabelIDList[LabelID - 1] = 0; } - /// MappedLabel - Find out the label's final ID. Zero indicates deletion. - /// ID != Mapped ID indicates that the label was folded into another label. - unsigned MappedLabel(unsigned LabelID) const { + /// isLabelDeleted - Return true if the label was deleted. + /// FIXME: This should eventually be eliminated and use the 'is emitted' bit + /// on MCSymbol. + bool isLabelDeleted(unsigned LabelID) const { assert(LabelID <= LabelIDList.size() && "Debug label ID out of range."); - return LabelID ? LabelIDList[LabelID - 1] : 0; + return LabelID == 0 || LabelIDList[LabelID - 1] == 0; } - + /// getFrameMoves - Returns a reference to a list of moves done in the current /// function's prologue. Used to construct frame maps for debug and exception /// handling comsumers. |