Unindent namespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202918 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher
2014-03-05 00:43:41 +00:00
parent 64da21dd5a
commit 9ad8924df3

View File

@@ -22,16 +22,16 @@
#include <vector> #include <vector>
namespace llvm { namespace llvm {
class AsmPrinter; class AsmPrinter;
class MCSymbol; class MCSymbol;
class MCSymbolRefExpr; class MCSymbolRefExpr;
class raw_ostream; class raw_ostream;
class DwarfTypeUnit; class DwarfTypeUnit;
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIEAbbrevData - Dwarf abbreviation data, describes one attribute of a /// DIEAbbrevData - Dwarf abbreviation data, describes one attribute of a
/// Dwarf abbreviation. /// Dwarf abbreviation.
class DIEAbbrevData { class DIEAbbrevData {
/// Attribute - Dwarf attribute code. /// Attribute - Dwarf attribute code.
/// ///
dwarf::Attribute Attribute; dwarf::Attribute Attribute;
@@ -39,7 +39,8 @@ namespace llvm {
/// Form - Dwarf form code. /// Form - 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.
@@ -49,12 +50,12 @@ namespace llvm {
/// Profile - Used to gather unique data for the abbreviation folding set. /// Profile - 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 /// DIEAbbrev - Dwarf abbreviation, describes the organization of a debug
/// information object. /// information object.
class DIEAbbrev : public FoldingSetNode { class DIEAbbrev : public FoldingSetNode {
/// Tag - Dwarf tag code. /// Tag - Dwarf tag code.
/// ///
dwarf::Tag Tag; dwarf::Tag Tag;
@@ -71,7 +72,7 @@ namespace llvm {
/// ///
SmallVector<DIEAbbrevData, 12> Data; SmallVector<DIEAbbrevData, 12> Data;
public: public:
DIEAbbrev(dwarf::Tag T, uint16_t C) : Tag(T), ChildrenFlag(C), Data() {} DIEAbbrev(dwarf::Tag T, uint16_t C) : Tag(T), ChildrenFlag(C), Data() {}
// Accessors. // Accessors.
@@ -100,15 +101,15 @@ namespace llvm {
void print(raw_ostream &O); void print(raw_ostream &O);
void dump(); void dump();
#endif #endif
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIE - A structured debug information entry. Has an abbreviation which /// DIE - A structured debug information entry. Has an abbreviation which
/// describes its organization. /// describes its organization.
class DIEValue; class DIEValue;
class DIE { class DIE {
protected: protected:
/// Offset - Offset in debug info section. /// Offset - Offset in debug info section.
/// ///
unsigned Offset; unsigned Offset;
@@ -129,9 +130,9 @@ namespace llvm {
/// Attribute values. /// Attribute values.
/// ///
SmallVector<DIEValue*, 12> Values; SmallVector<DIEValue *, 12> Values;
public: public:
explicit DIE(unsigned Tag) explicit DIE(unsigned Tag)
: Offset(0), Size(0), Abbrev((dwarf::Tag)Tag, dwarf::DW_CHILDREN_no), : Offset(0), Size(0), Abbrev((dwarf::Tag)Tag, dwarf::DW_CHILDREN_no),
Parent(0) {} Parent(0) {}
@@ -145,7 +146,7 @@ namespace llvm {
unsigned getOffset() const { return Offset; } unsigned getOffset() const { return Offset; }
unsigned getSize() const { return Size; } unsigned getSize() const { return Size; }
const std::vector<DIE *> &getChildren() const { return Children; } const std::vector<DIE *> &getChildren() const { return Children; }
const SmallVectorImpl<DIEValue*> &getValues() const { return Values; } const SmallVectorImpl<DIEValue *> &getValues() const { return Values; }
DIE *getParent() const { return Parent; } DIE *getParent() const { return Parent; }
/// Climb up the parent chain to get the compile or type unit DIE this DIE /// Climb up the parent chain to get the compile or type unit DIE this DIE
/// belongs to. /// belongs to.
@@ -158,8 +159,7 @@ namespace llvm {
/// addValue - Add a value and attributes to a DIE. /// addValue - Add a value and attributes to a DIE.
/// ///
void addValue(dwarf::Attribute Attribute, dwarf::Form Form, void addValue(dwarf::Attribute Attribute, dwarf::Form Form, DIEValue *Value) {
DIEValue *Value) {
Abbrev.AddAttribute(Attribute, Form); Abbrev.AddAttribute(Attribute, Form);
Values.push_back(Value); Values.push_back(Value);
} }
@@ -181,14 +181,15 @@ namespace llvm {
void print(raw_ostream &O, unsigned IndentCount = 0) const; void print(raw_ostream &O, unsigned IndentCount = 0) const;
void dump(); void dump();
#endif #endif
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIEValue - A debug information entry value. /// DIEValue - A debug information entry value.
/// ///
class DIEValue { class DIEValue {
virtual void anchor(); virtual void anchor();
public:
public:
enum { enum {
isInteger, isInteger,
isString, isString,
@@ -200,11 +201,13 @@ namespace llvm {
isBlock, isBlock,
isLoc isLoc
}; };
protected:
protected:
/// Type - Type of data stored in the value. /// Type - Type of data stored in the value.
/// ///
unsigned Type; unsigned Type;
public:
public:
explicit DIEValue(unsigned T) : Type(T) {} explicit DIEValue(unsigned T) : Type(T) {}
virtual ~DIEValue() {} virtual ~DIEValue() {}
@@ -223,14 +226,15 @@ namespace llvm {
virtual void print(raw_ostream &O) const = 0; virtual void print(raw_ostream &O) const = 0;
void dump() const; void dump() const;
#endif #endif
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIEInteger - An integer value DIE. /// DIEInteger - An integer value DIE.
/// ///
class DIEInteger : public DIEValue { class DIEInteger : public DIEValue {
uint64_t Integer; uint64_t Integer;
public:
public:
explicit DIEInteger(uint64_t I) : DIEValue(isInteger), Integer(I) {} explicit DIEInteger(uint64_t I) : DIEValue(isInteger), Integer(I) {}
/// BestForm - Choose the best form for integer. /// BestForm - Choose the best form for integer.
@@ -238,13 +242,19 @@ namespace llvm {
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;
if ((char)Int == SignedInt) return dwarf::DW_FORM_data1; if ((char)Int == SignedInt)
if ((short)Int == SignedInt) return dwarf::DW_FORM_data2; return dwarf::DW_FORM_data1;
if ((int)Int == SignedInt) return dwarf::DW_FORM_data4; if ((short)Int == SignedInt)
return dwarf::DW_FORM_data2;
if ((int)Int == SignedInt)
return dwarf::DW_FORM_data4;
} else { } else {
if ((unsigned char)Int == Int) return dwarf::DW_FORM_data1; if ((unsigned char)Int == Int)
if ((unsigned short)Int == Int) return dwarf::DW_FORM_data2; return dwarf::DW_FORM_data1;
if ((unsigned int)Int == Int) return dwarf::DW_FORM_data4; if ((unsigned short)Int == Int)
return dwarf::DW_FORM_data2;
if ((unsigned int)Int == Int)
return dwarf::DW_FORM_data4;
} }
return dwarf::DW_FORM_data8; return dwarf::DW_FORM_data8;
} }
@@ -265,14 +275,15 @@ namespace llvm {
#ifndef NDEBUG #ifndef NDEBUG
virtual void print(raw_ostream &O) const; virtual void print(raw_ostream &O) const;
#endif #endif
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIEExpr - An expression DIE. /// DIEExpr - An expression DIE.
// //
class DIEExpr : public DIEValue { class DIEExpr : public DIEValue {
const MCExpr *Expr; const MCExpr *Expr;
public:
public:
explicit DIEExpr(const MCExpr *E) : DIEValue(isExpr), Expr(E) {} explicit DIEExpr(const MCExpr *E) : DIEValue(isExpr), Expr(E) {}
/// EmitValue - Emit expression value. /// EmitValue - Emit expression value.
@@ -293,14 +304,15 @@ namespace llvm {
#ifndef NDEBUG #ifndef NDEBUG
virtual void print(raw_ostream &O) const; virtual void print(raw_ostream &O) const;
#endif #endif
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIELabel - A label DIE. /// DIELabel - A label DIE.
// //
class DIELabel : public DIEValue { class DIELabel : public DIEValue {
const MCSymbol *Label; const MCSymbol *Label;
public:
public:
explicit DIELabel(const MCSymbol *L) : DIEValue(isLabel), Label(L) {} explicit DIELabel(const MCSymbol *L) : DIEValue(isLabel), Label(L) {}
/// EmitValue - Emit label value. /// EmitValue - Emit label value.
@@ -321,15 +333,16 @@ namespace llvm {
#ifndef NDEBUG #ifndef NDEBUG
virtual void print(raw_ostream &O) const; virtual void print(raw_ostream &O) const;
#endif #endif
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIEDelta - A simple label difference DIE. /// DIEDelta - A simple label difference DIE.
/// ///
class DIEDelta : public DIEValue { class DIEDelta : public DIEValue {
const MCSymbol *LabelHi; const MCSymbol *LabelHi;
const MCSymbol *LabelLo; const MCSymbol *LabelLo;
public:
public:
DIEDelta(const MCSymbol *Hi, const MCSymbol *Lo) DIEDelta(const MCSymbol *Hi, const MCSymbol *Lo)
: DIEValue(isDelta), LabelHi(Hi), LabelLo(Lo) {} : DIEValue(isDelta), LabelHi(Hi), LabelLo(Lo) {}
@@ -347,16 +360,16 @@ namespace llvm {
#ifndef NDEBUG #ifndef NDEBUG
virtual void print(raw_ostream &O) const; virtual void print(raw_ostream &O) const;
#endif #endif
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIEString - A container for string values. /// DIEString - A container for string values.
/// ///
class DIEString : public DIEValue { class DIEString : public DIEValue {
const DIEValue *Access; const DIEValue *Access;
const StringRef Str; const StringRef Str;
public: public:
DIEString(const DIEValue *Acc, const StringRef S) DIEString(const DIEValue *Acc, const StringRef S)
: DIEValue(isString), Access(Acc), Str(S) {} : DIEValue(isString), Access(Acc), Str(S) {}
@@ -374,18 +387,19 @@ namespace llvm {
// Implement isa/cast/dyncast. // Implement isa/cast/dyncast.
static bool classof(const DIEValue *D) { return D->getType() == isString; } static bool classof(const DIEValue *D) { return D->getType() == isString; }
#ifndef NDEBUG #ifndef NDEBUG
virtual void print(raw_ostream &O) const; virtual void print(raw_ostream &O) const;
#endif #endif
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIEEntry - A pointer to another debug information entry. An instance of /// DIEEntry - A pointer to another debug information entry. An instance of
/// this class can also be used as a proxy for a debug information entry not /// this class can also be used as a proxy for a debug information entry not
/// yet defined (ie. types.) /// yet defined (ie. types.)
class DIEEntry : public DIEValue { class DIEEntry : public DIEValue {
DIE *const Entry; DIE *const Entry;
public:
public:
explicit DIEEntry(DIE *E) : DIEValue(isEntry), Entry(E) { explicit DIEEntry(DIE *E) : DIEValue(isEntry), Entry(E) {
assert(E && "Cannot construct a DIEEntry with a null DIE"); assert(E && "Cannot construct a DIEEntry with a null DIE");
} }
@@ -412,13 +426,14 @@ namespace llvm {
#ifndef NDEBUG #ifndef NDEBUG
virtual void print(raw_ostream &O) const; virtual void print(raw_ostream &O) const;
#endif #endif
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// \brief A signature reference to a type unit. /// \brief A signature reference to a type unit.
class DIETypeSignature : public DIEValue { class DIETypeSignature : public DIEValue {
const DwarfTypeUnit &Unit; const DwarfTypeUnit &Unit;
public:
public:
explicit DIETypeSignature(const DwarfTypeUnit &Unit) explicit DIETypeSignature(const DwarfTypeUnit &Unit)
: DIEValue(isTypeSignature), Unit(Unit) {} : DIEValue(isTypeSignature), Unit(Unit) {}
@@ -439,14 +454,14 @@ namespace llvm {
virtual void print(raw_ostream &O) const; virtual void print(raw_ostream &O) const;
void dump() const; void dump() const;
#endif #endif
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIELoc - Represents an expression location. /// DIELoc - Represents an expression location.
// //
class DIELoc : public DIEValue, public DIE { class DIELoc : public DIEValue, public DIE {
mutable unsigned Size; // Size in bytes excluding size header. mutable unsigned Size; // Size in bytes excluding size header.
public: public:
DIELoc() : DIEValue(isLoc), DIE(0), Size(0) {} DIELoc() : DIEValue(isLoc), DIE(0), Size(0) {}
/// ComputeSize - Calculate the size of the location expression. /// ComputeSize - Calculate the size of the location expression.
@@ -456,11 +471,15 @@ namespace llvm {
/// BestForm - Choose the best form for data. /// BestForm - Choose the best form for data.
/// ///
dwarf::Form BestForm(unsigned DwarfVersion) const { dwarf::Form BestForm(unsigned DwarfVersion) const {
if (DwarfVersion > 3) return dwarf::DW_FORM_exprloc; if (DwarfVersion > 3)
return dwarf::DW_FORM_exprloc;
// Pre-DWARF4 location expressions were blocks and not exprloc. // Pre-DWARF4 location expressions were blocks and not exprloc.
if ((unsigned char)Size == Size) return dwarf::DW_FORM_block1; if ((unsigned char)Size == Size)
if ((unsigned short)Size == Size) return dwarf::DW_FORM_block2; return dwarf::DW_FORM_block1;
if ((unsigned int)Size == Size) return dwarf::DW_FORM_block4; if ((unsigned short)Size == Size)
return dwarf::DW_FORM_block2;
if ((unsigned int)Size == Size)
return dwarf::DW_FORM_block4;
return dwarf::DW_FORM_block; return dwarf::DW_FORM_block;
} }
@@ -478,14 +497,14 @@ namespace llvm {
#ifndef NDEBUG #ifndef NDEBUG
virtual void print(raw_ostream &O) const; virtual void print(raw_ostream &O) const;
#endif #endif
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
/// DIEBlock - Represents a block of values. /// DIEBlock - Represents a block of values.
// //
class DIEBlock : public DIEValue, public DIE { class DIEBlock : public DIEValue, public DIE {
mutable unsigned Size; // Size in bytes excluding size header. mutable unsigned Size; // Size in bytes excluding size header.
public: public:
DIEBlock() : DIEValue(isBlock), DIE(0), Size(0) {} DIEBlock() : DIEValue(isBlock), DIE(0), Size(0) {}
/// ComputeSize - Calculate the size of the location expression. /// ComputeSize - Calculate the size of the location expression.
@@ -495,9 +514,12 @@ namespace llvm {
/// BestForm - Choose the best form for data. /// BestForm - Choose the best form for data.
/// ///
dwarf::Form BestForm() const { dwarf::Form BestForm() const {
if ((unsigned char)Size == Size) return dwarf::DW_FORM_block1; if ((unsigned char)Size == Size)
if ((unsigned short)Size == Size) return dwarf::DW_FORM_block2; return dwarf::DW_FORM_block1;
if ((unsigned int)Size == Size) return dwarf::DW_FORM_block4; if ((unsigned short)Size == Size)
return dwarf::DW_FORM_block2;
if ((unsigned int)Size == Size)
return dwarf::DW_FORM_block4;
return dwarf::DW_FORM_block; return dwarf::DW_FORM_block;
} }
@@ -512,10 +534,10 @@ namespace llvm {
// Implement isa/cast/dyncast. // Implement isa/cast/dyncast.
static bool classof(const DIEValue *E) { return E->getType() == isBlock; } static bool classof(const DIEValue *E) { return E->getType() == isBlock; }
#ifndef NDEBUG #ifndef NDEBUG
virtual void print(raw_ostream &O) const; virtual void print(raw_ostream &O) const;
#endif #endif
}; };
} // end llvm namespace } // end llvm namespace
#endif #endif