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

@ -39,6 +39,7 @@ 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) {}
@ -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);
} }
@ -188,6 +188,7 @@ namespace llvm {
/// ///
class DIEValue { class DIEValue {
virtual void anchor(); virtual void anchor();
public: public:
enum { enum {
isInteger, isInteger,
@ -200,10 +201,12 @@ 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() {}
@ -230,6 +233,7 @@ namespace llvm {
/// ///
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) {}
@ -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;
} }
@ -272,6 +282,7 @@ namespace llvm {
// //
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) {}
@ -300,6 +311,7 @@ namespace llvm {
// //
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) {}
@ -329,6 +341,7 @@ namespace llvm {
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) {}
@ -385,6 +398,7 @@ namespace llvm {
/// 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");
@ -418,6 +432,7 @@ namespace llvm {
/// \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) {}
@ -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;
} }
@ -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;
} }