[ms-inline asm] Extend the MC AsmParser API to match MCInsts (but not emit).
[oota-llvm.git] / include / llvm / MC / MCDwarf.h
index 56d732c4971d28cd10579c689aac9bdb87ac75ac..fdb7ab23c09ff2b34672576e1c48c621356848ac 100644 (file)
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/MC/MachineLocation.h"
-#include "llvm/MC/MCObjectWriter.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/Dwarf.h"
 #include <vector>
 
 namespace llvm {
   class MCContext;
-  class MCExpr;
+  class MCObjectWriter;
   class MCSection;
-  class MCSectionData;
   class MCStreamer;
   class MCSymbol;
-  class MCObjectStreamer;
-  class raw_ostream;
   class SourceMgr;
   class SMLoc;
 
@@ -212,7 +208,7 @@ namespace llvm {
     //
     // This emits the Dwarf file and the line tables.
     //
-    static void Emit(MCStreamer *MCOS);
+    static const MCSymbol *Emit(MCStreamer *MCOS);
   };
 
   class MCDwarfLineAddr {
@@ -235,12 +231,12 @@ namespace llvm {
     // When generating dwarf for assembly source files this emits the Dwarf
     // sections.
     //
-    static void Emit(MCStreamer *MCOS);
+    static void Emit(MCStreamer *MCOS, const MCSymbol *LineSectionSymbol);
   };
 
   // When generating dwarf for assembly source files this is the info that is
-  // needed to be gathered for each symbol that will have a dwarf2_subprogram.
-  class MCGenDwarfSubprogramEntry {
+  // needed to be gathered for each symbol that will have a dwarf label.
+  class MCGenDwarfLabelEntry {
   private:
     // Name of the symbol without a leading underbar, if any.
     StringRef Name;
@@ -248,14 +244,12 @@ namespace llvm {
     unsigned FileNumber;
     // The line number this symbol is at.
     unsigned LineNumber;
-    // The low_pc for the dwarf2_subprogram is taken from this symbol.  The
-    // high_pc is taken from the next symbol's value or the end of the section
-    // for the last symbol
+    // The low_pc for the dwarf label is taken from this symbol.
     MCSymbol *Label;
 
   public:
-    MCGenDwarfSubprogramEntry(StringRef name, unsigned fileNumber,
-                              unsigned lineNumber, MCSymbol *label) :
+    MCGenDwarfLabelEntry(StringRef name, unsigned fileNumber,
+                         unsigned lineNumber, MCSymbol *label) :
       Name(name), FileNumber(fileNumber), LineNumber(lineNumber), Label(label){}
 
     StringRef getName() const { return Name; }
@@ -271,7 +265,8 @@ namespace llvm {
 
   class MCCFIInstruction {
   public:
-    enum OpType { SameValue, RememberState, RestoreState, Move, RelMove, Escape };
+    enum OpType { SameValue, RememberState, RestoreState, Move, RelMove, Escape,
+                  Restore};
   private:
     OpType Operation;
     MCSymbol *Label;
@@ -286,7 +281,7 @@ namespace llvm {
     }
     MCCFIInstruction(OpType Op, MCSymbol *L, unsigned Register)
       : Operation(Op), Label(L), Destination(Register) {
-      assert(Op == SameValue);
+      assert(Op == SameValue || Op == Restore);
     }
     MCCFIInstruction(MCSymbol *L, const MachineLocation &D,
                      const MachineLocation &S)
@@ -313,7 +308,8 @@ namespace llvm {
   struct MCDwarfFrameInfo {
     MCDwarfFrameInfo() : Begin(0), End(0), Personality(0), Lsda(0),
                          Function(0), Instructions(), PersonalityEncoding(),
-                         LsdaEncoding(0), CompactUnwindEncoding(0) {}
+                         LsdaEncoding(0), CompactUnwindEncoding(0),
+                         IsSignalFrame(false) {}
     MCSymbol *Begin;
     MCSymbol *End;
     const MCSymbol *Personality;
@@ -323,6 +319,7 @@ namespace llvm {
     unsigned PersonalityEncoding;
     unsigned LsdaEncoding;
     uint32_t CompactUnwindEncoding;
+    bool IsSignalFrame;
   };
 
   class MCDwarfFrameEmitter {