diff options
author | Kevin Enderby <enderby@apple.com> | 2010-08-24 20:32:42 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2010-08-24 20:32:42 +0000 |
commit | c1840b3da25222680b51f853697a871fedda51d5 (patch) | |
tree | 3e8ead8c25c2fc13a34f9fea476aa8def72545cb /include/llvm/MC/MCDwarf.h | |
parent | a15a1336478ffe16f3165c99e5c0e434eb6c53a2 (diff) |
First bit of support for the dwarf .loc directive. This patch updates the
needed parsing for the .loc directive and saves the current info from that
into the context. The next patch will take the current loc info after an
instruction is assembled and save that info into a vector for each section for
use to build the line number tables. The patch after that will encode the info
from those vectors into the output file as the dwarf line tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111956 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCDwarf.h')
-rw-r--r-- | include/llvm/MC/MCDwarf.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/include/llvm/MC/MCDwarf.h b/include/llvm/MC/MCDwarf.h index e21b42f7bb..4f39f79397 100644 --- a/include/llvm/MC/MCDwarf.h +++ b/include/llvm/MC/MCDwarf.h @@ -57,6 +57,50 @@ namespace llvm { void dump() const; }; + /// MCDwarfLoc - Instances of this class represent the information from a + /// dwarf .loc directive. + class MCDwarfLoc { + // FileNum - the file number. + unsigned FileNum; + // Line - the line number. + unsigned Line; + // Column - the column position. + unsigned Column; + // Flags (see #define's below) + unsigned Flags; + // Isa + unsigned Isa; + +#define DWARF2_FLAG_IS_STMT (1 << 0) +#define DWARF2_FLAG_BASIC_BLOCK (1 << 1) +#define DWARF2_FLAG_PROLOGUE_END (1 << 2) +#define DWARF2_FLAG_EPILOGUE_BEGIN (1 << 3) + + private: // MCContext manages these + friend class MCContext; + MCDwarfLoc(unsigned fileNum, unsigned line, unsigned column, unsigned flags, + unsigned isa) + : FileNum(fileNum), Line(line), Column(column), Flags(flags), Isa(isa) {} + + MCDwarfLoc(const MCDwarfLoc&); // DO NOT IMPLEMENT + void operator=(const MCDwarfLoc&); // DO NOT IMPLEMENT + public: + /// setFileNum - Set the FileNum of this MCDwarfLoc. + void setFileNum(unsigned fileNum) { FileNum = fileNum; } + + /// setLine - Set the Line of this MCDwarfLoc. + void setLine(unsigned line) { Line = line; } + + /// setColumn - Set the Column of this MCDwarfLoc. + void setColumn(unsigned column) { Column = column; } + + /// setFlags - Set the Flags of this MCDwarfLoc. + void setFlags(unsigned flags) { Flags = flags; } + + /// setIsa - Set the Isa of this MCDwarfLoc. + void setIsa(unsigned isa) { Isa = isa; } + }; + inline raw_ostream &operator<<(raw_ostream &OS, const MCDwarfFile &DwarfFile){ DwarfFile.print(OS); return OS; |