~ubuntu-branches/ubuntu/maverick/clamav/maverick-backports

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.h

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Gran, Stephen Gran, Michael Tautschnig
  • Date: 2010-04-26 21:41:18 UTC
  • mfrom: (2.1.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100426214118-i6lo606wnh7ywfj6
Tags: 0.96+dfsg-4
[ Stephen Gran ]
* Fixed typo in clamav-milter's postinst

[ Michael Tautschnig ]
* Fixed typo in clamav-freshclam's postinst (closes: #579271)
* Debconf translation updates
  - Portuguese (closes: #579068)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//===--- lib/CodeGen/DwarfPrinter.h - Dwarf Printer -------------*- C++ -*-===//
 
2
//
 
3
//                     The LLVM Compiler Infrastructure
 
4
//
 
5
// This file is distributed under the University of Illinois Open Source
 
6
// License. See LICENSE.TXT for details.
 
7
//
 
8
//===----------------------------------------------------------------------===//
 
9
//
 
10
// Emit general DWARF directives.
 
11
// 
 
12
//===----------------------------------------------------------------------===//
 
13
 
 
14
#ifndef CODEGEN_ASMPRINTER_DWARFPRINTER_H__
 
15
#define CODEGEN_ASMPRINTER_DWARFPRINTER_H__
 
16
 
 
17
#include "DwarfLabel.h"
 
18
#include "llvm/CodeGen/MachineLocation.h"
 
19
#include "llvm/Support/Compiler.h"
 
20
#include "llvm/Support/FormattedStream.h"
 
21
#include <vector>
 
22
 
 
23
namespace llvm {
 
24
class AsmPrinter;
 
25
class MachineFunction;
 
26
class MachineModuleInfo;
 
27
class Module;
 
28
class MCAsmInfo;
 
29
class TargetData;
 
30
class TargetRegisterInfo;
 
31
class GlobalValue;
 
32
class MCSymbol;
 
33
class Twine;
 
34
 
 
35
class DwarfPrinter {
 
36
protected:
 
37
  ~DwarfPrinter() {}
 
38
 
 
39
  //===-------------------------------------------------------------==---===//
 
40
  // Core attributes used by the DWARF printer.
 
41
  //
 
42
 
 
43
  /// O - Stream to .s file.
 
44
  raw_ostream &O;
 
45
 
 
46
  /// Asm - Target of Dwarf emission.
 
47
  AsmPrinter *Asm;
 
48
 
 
49
  /// MAI - Target asm information.
 
50
  const MCAsmInfo *MAI;
 
51
 
 
52
  /// TD - Target data.
 
53
  const TargetData *TD;
 
54
 
 
55
  /// RI - Register Information.
 
56
  const TargetRegisterInfo *RI;
 
57
 
 
58
  /// M - Current module.
 
59
  Module *M;
 
60
 
 
61
  /// MF - Current machine function.
 
62
  const MachineFunction *MF;
 
63
 
 
64
  /// MMI - Collected machine module information.
 
65
  MachineModuleInfo *MMI;
 
66
 
 
67
  /// SubprogramCount - The running count of functions being compiled.
 
68
  unsigned SubprogramCount;
 
69
 
 
70
  /// Flavor - A unique string indicating what dwarf producer this is, used to
 
71
  /// unique labels.
 
72
  const char * const Flavor;
 
73
 
 
74
  /// SetCounter - A unique number for each '.set' directive.
 
75
  unsigned SetCounter;
 
76
 
 
77
  DwarfPrinter(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T,
 
78
               const char *flavor);
 
79
public:
 
80
  
 
81
  //===------------------------------------------------------------------===//
 
82
  // Accessors.
 
83
  //
 
84
  const AsmPrinter *getAsm() const { return Asm; }
 
85
  MachineModuleInfo *getMMI() const { return MMI; }
 
86
  const MCAsmInfo *getMCAsmInfo() const { return MAI; }
 
87
  const TargetData *getTargetData() const { return TD; }
 
88
 
 
89
  /// SizeOfEncodedValue - Return the size of the encoding in bytes.
 
90
  unsigned SizeOfEncodedValue(unsigned Encoding) const;
 
91
 
 
92
  void PrintRelDirective(unsigned Encoding) const;
 
93
  void PrintRelDirective(bool Force32Bit = false,
 
94
                         bool isInSection = false) const;
 
95
 
 
96
  /// EOL - Print a newline character to asm stream.  If a comment is present
 
97
  /// then it will be printed first.  Comments should not contain '\n'.
 
98
  void EOL(const Twine &Comment) const;
 
99
  
 
100
  /// EmitEncodingByte - Emit a .byte 42 directive that corresponds to an
 
101
  /// encoding.  If verbose assembly output is enabled, we output comments
 
102
  /// describing the encoding.  Desc is a string saying what the encoding is
 
103
  /// specifying (e.g. "LSDA").
 
104
  void EmitEncodingByte(unsigned Val, const char *Desc);
 
105
  
 
106
  /// EmitCFAByte - Emit a .byte 42 directive for a DW_CFA_xxx value.
 
107
  void EmitCFAByte(unsigned Val);
 
108
  
 
109
  
 
110
  /// EmitSLEB128 - emit the specified signed leb128 value.
 
111
  void EmitSLEB128(int Value, const char *Desc) const;
 
112
 
 
113
  /// EmitULEB128 - emit the specified unsigned leb128 value.
 
114
  void EmitULEB128(unsigned Value, const char *Desc = 0,
 
115
                   unsigned PadTo = 0) const;
 
116
 
 
117
  
 
118
  /// PrintLabelName - Print label name in form used by Dwarf writer.
 
119
  ///
 
120
  void PrintLabelName(const DWLabel &Label) const {
 
121
    PrintLabelName(Label.getTag(), Label.getNumber());
 
122
  }
 
123
  void PrintLabelName(const char *Tag, unsigned Number) const;
 
124
  void PrintLabelName(const char *Tag, unsigned Number,
 
125
                      const char *Suffix) const;
 
126
 
 
127
  /// EmitLabel - Emit location label for internal use by Dwarf.
 
128
  ///
 
129
  void EmitLabel(const DWLabel &Label) const {
 
130
    EmitLabel(Label.getTag(), Label.getNumber());
 
131
  }
 
132
  void EmitLabel(const char *Tag, unsigned Number) const;
 
133
 
 
134
  /// EmitReference - Emit a reference to a label.
 
135
  ///
 
136
  void EmitReference(const DWLabel &Label, bool IsPCRelative = false,
 
137
                     bool Force32Bit = false) const {
 
138
    EmitReference(Label.getTag(), Label.getNumber(),
 
139
                  IsPCRelative, Force32Bit);
 
140
  }
 
141
  void EmitReference(const char *Tag, unsigned Number,
 
142
                     bool IsPCRelative = false,
 
143
                     bool Force32Bit = false) const;
 
144
  void EmitReference(const std::string &Name, bool IsPCRelative = false,
 
145
                     bool Force32Bit = false) const;
 
146
  void EmitReference(const MCSymbol *Sym, bool IsPCRelative = false,
 
147
                     bool Force32Bit = false) const;
 
148
 
 
149
  void EmitReference(const char *Tag, unsigned Number, unsigned Encoding) const;
 
150
  void EmitReference(const MCSymbol *Sym, unsigned Encoding) const;
 
151
  void EmitReference(const GlobalValue *GV, unsigned Encoding) const;
 
152
 
 
153
  /// EmitDifference - Emit the difference between two labels.
 
154
  void EmitDifference(const DWLabel &LabelHi, const DWLabel &LabelLo,
 
155
                      bool IsSmall = false) {
 
156
    EmitDifference(LabelHi.getTag(), LabelHi.getNumber(),
 
157
                   LabelLo.getTag(), LabelLo.getNumber(),
 
158
                   IsSmall);
 
159
  }
 
160
  void EmitDifference(const char *TagHi, unsigned NumberHi,
 
161
                      const char *TagLo, unsigned NumberLo,
 
162
                      bool IsSmall = false);
 
163
 
 
164
  void EmitSectionOffset(const char* Label, const char* Section,
 
165
                         unsigned LabelNumber, unsigned SectionNumber,
 
166
                         bool IsSmall = false, bool isEH = false,
 
167
                         bool useSet = true);
 
168
 
 
169
  /// EmitFrameMoves - Emit frame instructions to describe the layout of the
 
170
  /// frame.
 
171
  void EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID,
 
172
                      const std::vector<MachineMove> &Moves, bool isEH);
 
173
};
 
174
 
 
175
} // end llvm namespace
 
176
 
 
177
#endif