Fix comments according to the LLVM coding guidelines.

llvm-svn: 286610
This commit is contained in:
Adrian Prantl 2016-11-11 18:22:51 +00:00
parent 359fafe74c
commit 6285f5b441
1 changed files with 42 additions and 56 deletions

View File

@ -39,74 +39,68 @@ class MCSymbol;
class raw_ostream; class raw_ostream;
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIEAbbrevData - Dwarf abbreviation data, describes one attribute of a /// Dwarf abbreviation data, describes one attribute of a Dwarf abbreviation.
/// Dwarf abbreviation.
class DIEAbbrevData { class DIEAbbrevData {
/// Attribute - Dwarf attribute code. /// Dwarf attribute code.
///
dwarf::Attribute Attribute; dwarf::Attribute Attribute;
/// Form - Dwarf form code. /// Dwarf form code.
///
dwarf::Form Form; dwarf::Form Form;
public: public:
DIEAbbrevData(dwarf::Attribute A, dwarf::Form F) : Attribute(A), Form(F) {} DIEAbbrevData(dwarf::Attribute A, dwarf::Form F) : Attribute(A), Form(F) {}
// Accessors. /// Accessors.
/// @{
dwarf::Attribute getAttribute() const { return Attribute; } dwarf::Attribute getAttribute() const { return Attribute; }
dwarf::Form getForm() const { return Form; } dwarf::Form getForm() const { return Form; }
/// @}
/// Profile - Used to gather unique data for the abbreviation folding set. /// Used to gather unique data for the abbreviation folding set.
///
void Profile(FoldingSetNodeID &ID) const; void Profile(FoldingSetNodeID &ID) const;
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIEAbbrev - Dwarf abbreviation, describes the organization of a debug /// Dwarf abbreviation, describes the organization of a debug information
/// information object. /// object.
class DIEAbbrev : public FoldingSetNode { class DIEAbbrev : public FoldingSetNode {
/// Unique number for node. /// Unique number for node.
///
unsigned Number; unsigned Number;
/// Tag - Dwarf tag code. /// Dwarf tag code.
///
dwarf::Tag Tag; dwarf::Tag Tag;
/// Children - Whether or not this node has children. /// Whether or not this node has children.
/// ///
// This cheats a bit in all of the uses since the values in the standard /// This cheats a bit in all of the uses since the values in the standard
// are 0 and 1 for no children and children respectively. /// are 0 and 1 for no children and children respectively.
bool Children; bool Children;
/// Data - Raw data bytes for abbreviation. /// Raw data bytes for abbreviation.
///
SmallVector<DIEAbbrevData, 12> Data; SmallVector<DIEAbbrevData, 12> Data;
public: public:
DIEAbbrev(dwarf::Tag T, bool C) : Tag(T), Children(C) {} DIEAbbrev(dwarf::Tag T, bool C) : Tag(T), Children(C) {}
// Accessors. /// Accessors.
/// @{
dwarf::Tag getTag() const { return Tag; } dwarf::Tag getTag() const { return Tag; }
unsigned getNumber() const { return Number; } unsigned getNumber() const { return Number; }
bool hasChildren() const { return Children; } bool hasChildren() const { return Children; }
const SmallVectorImpl<DIEAbbrevData> &getData() const { return Data; } const SmallVectorImpl<DIEAbbrevData> &getData() const { return Data; }
void setChildrenFlag(bool hasChild) { Children = hasChild; } void setChildrenFlag(bool hasChild) { Children = hasChild; }
void setNumber(unsigned N) { Number = N; } void setNumber(unsigned N) { Number = N; }
/// @}
/// AddAttribute - Adds another set of attribute information to the /// Adds another set of attribute information to the abbreviation.
/// abbreviation.
void AddAttribute(dwarf::Attribute Attribute, dwarf::Form Form) { void AddAttribute(dwarf::Attribute Attribute, dwarf::Form Form) {
Data.push_back(DIEAbbrevData(Attribute, Form)); Data.push_back(DIEAbbrevData(Attribute, Form));
} }
/// Profile - Used to gather unique data for the abbreviation folding set. /// Used to gather unique data for the abbreviation folding set.
///
void Profile(FoldingSetNodeID &ID) const; void Profile(FoldingSetNodeID &ID) const;
/// Emit - Print the abbreviation using the specified asm printer. /// Print the abbreviation using the specified asm printer.
///
void Emit(const AsmPrinter *AP) const; void Emit(const AsmPrinter *AP) const;
void print(raw_ostream &O); void print(raw_ostream &O);
@ -114,7 +108,7 @@ public:
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIEInteger - An integer value DIE. /// An integer value DIE.
/// ///
class DIEInteger { class DIEInteger {
uint64_t Integer; uint64_t Integer;
@ -122,8 +116,7 @@ class DIEInteger {
public: public:
explicit DIEInteger(uint64_t I) : Integer(I) {} explicit DIEInteger(uint64_t I) : Integer(I) {}
/// BestForm - Choose the best form for integer. /// Choose the best form for integer.
///
static dwarf::Form BestForm(bool IsSigned, uint64_t Int) { static dwarf::Form BestForm(bool IsSigned, uint64_t Int) {
if (IsSigned) { if (IsSigned) {
const int64_t SignedInt = Int; const int64_t SignedInt = Int;
@ -154,16 +147,14 @@ public:
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIEExpr - An expression DIE. /// An expression DIE.
//
class DIEExpr { class DIEExpr {
const MCExpr *Expr; const MCExpr *Expr;
public: public:
explicit DIEExpr(const MCExpr *E) : Expr(E) {} explicit DIEExpr(const MCExpr *E) : Expr(E) {}
/// getValue - Get MCExpr. /// Get MCExpr.
///
const MCExpr *getValue() const { return Expr; } const MCExpr *getValue() const { return Expr; }
void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const; void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const;
@ -173,16 +164,14 @@ public:
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIELabel - A label DIE. /// A label DIE.
//
class DIELabel { class DIELabel {
const MCSymbol *Label; const MCSymbol *Label;
public: public:
explicit DIELabel(const MCSymbol *L) : Label(L) {} explicit DIELabel(const MCSymbol *L) : Label(L) {}
/// getValue - Get MCSymbol. /// Get MCSymbol.
///
const MCSymbol *getValue() const { return Label; } const MCSymbol *getValue() const { return Label; }
void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const; void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const;
@ -192,7 +181,7 @@ public:
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIEDelta - A simple label difference DIE. /// A simple label difference DIE.
/// ///
class DIEDelta { class DIEDelta {
const MCSymbol *LabelHi; const MCSymbol *LabelHi;
@ -208,7 +197,7 @@ public:
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIEString - A container for string values. /// A container for string values.
/// ///
class DIEString { class DIEString {
DwarfStringPoolEntryRef S; DwarfStringPoolEntryRef S;
@ -216,7 +205,7 @@ class DIEString {
public: public:
DIEString(DwarfStringPoolEntryRef S) : S(S) {} DIEString(DwarfStringPoolEntryRef S) : S(S) {}
/// getString - Grab the string out of the object. /// Grab the string out of the object.
StringRef getString() const { return S.getString(); } StringRef getString() const { return S.getString(); }
void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const; void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const;
@ -226,9 +215,9 @@ public:
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIEEntry - A pointer to another debug information entry. An instance of /// A pointer to another debug information entry. An instance of this class can
/// this class can also be used as a proxy for a debug information entry not /// also be used as a proxy for a debug information entry not yet defined
/// yet defined (ie. types.) /// (ie. types.)
class DIE; class DIE;
class DIEEntry { class DIEEntry {
DIE *Entry; DIE *Entry;
@ -253,17 +242,16 @@ public:
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIELocList - Represents a pointer to a location list in the debug_loc /// Represents a pointer to a location list in the debug_loc
/// section. /// section.
//
class DIELocList { class DIELocList {
// Index into the .debug_loc vector. /// Index into the .debug_loc vector.
size_t Index; size_t Index;
public: public:
DIELocList(size_t I) : Index(I) {} DIELocList(size_t I) : Index(I) {}
/// getValue - Grab the current index out. /// Grab the current index out.
size_t getValue() const { return Index; } size_t getValue() const { return Index; }
void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const; void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const;
@ -273,9 +261,8 @@ public:
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIEValue - A debug information entry value. Some of these roughly correlate /// A debug information entry value. Some of these roughly correlate
/// to DWARF attribute classes. /// to DWARF attribute classes.
///
class DIEBlock; class DIEBlock;
class DIELoc; class DIELoc;
class DIEValue { class DIEValue {
@ -287,8 +274,7 @@ public:
}; };
private: private:
/// Ty - Type of data stored in the value. /// Type of data stored in the value.
///
Type Ty = isNone; Type Ty = isNone;
dwarf::Attribute Attribute = (dwarf::Attribute)0; dwarf::Attribute Attribute = (dwarf::Attribute)0;
dwarf::Form Form = (dwarf::Form)0; dwarf::Form Form = (dwarf::Form)0;
@ -394,11 +380,13 @@ public:
} }
#include "llvm/CodeGen/DIEValue.def" #include "llvm/CodeGen/DIEValue.def"
// Accessors /// Accessors.
/// @{
Type getType() const { return Ty; } Type getType() const { return Ty; }
dwarf::Attribute getAttribute() const { return Attribute; } dwarf::Attribute getAttribute() const { return Attribute; }
dwarf::Form getForm() const { return Form; } dwarf::Form getForm() const { return Form; }
explicit operator bool() const { return Ty; } explicit operator bool() const { return Ty; }
/// @}
#define HANDLE_DIEVALUE_SMALL(T) \ #define HANDLE_DIEVALUE_SMALL(T) \
const DIE##T &getDIE##T() const { \ const DIE##T &getDIE##T() const { \
@ -412,12 +400,10 @@ public:
} }
#include "llvm/CodeGen/DIEValue.def" #include "llvm/CodeGen/DIEValue.def"
/// EmitValue - Emit value via the Dwarf writer. /// Emit value via the Dwarf writer.
///
void EmitValue(const AsmPrinter *AP) const; void EmitValue(const AsmPrinter *AP) const;
/// SizeOf - Return the size of a value in bytes. /// Return the size of a value in bytes.
///
unsigned SizeOf(const AsmPrinter *AP) const; unsigned SizeOf(const AsmPrinter *AP) const;
void print(raw_ostream &O) const; void print(raw_ostream &O) const;