Make ivars private. Other cleanup. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66607 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2009-03-10 23:57:09 +00:00
parent 535f390bc3
commit dd44632498

View File

@ -128,7 +128,6 @@ public:
/// DIEAbbrevData - Dwarf abbreviation data, describes the one attribute of a /// DIEAbbrevData - Dwarf abbreviation data, describes the one attribute of a
/// Dwarf abbreviation. /// Dwarf abbreviation.
class DIEAbbrevData { class DIEAbbrevData {
private:
/// Attribute - Dwarf attribute code. /// Attribute - Dwarf attribute code.
/// ///
unsigned Attribute; unsigned Attribute;
@ -136,12 +135,8 @@ private:
/// Form - Dwarf form code. /// Form - Dwarf form code.
/// ///
unsigned Form; unsigned Form;
public: public:
DIEAbbrevData(unsigned A, unsigned F) DIEAbbrevData(unsigned A, unsigned F) : Attribute(A), Form(F) {}
: Attribute(A)
, Form(F)
{}
// Accessors. // Accessors.
unsigned getAttribute() const { return Attribute; } unsigned getAttribute() const { return Attribute; }
@ -175,15 +170,9 @@ private:
/// Data - Raw data bytes for abbreviation. /// Data - Raw data bytes for abbreviation.
/// ///
SmallVector<DIEAbbrevData, 8> Data; SmallVector<DIEAbbrevData, 8> Data;
public: public:
DIEAbbrev(unsigned T, unsigned C) : Tag(T), ChildrenFlag(C), Data() {}
DIEAbbrev(unsigned T, unsigned C) virtual ~DIEAbbrev() {}
: Tag(T)
, ChildrenFlag(C)
, Data()
{}
~DIEAbbrev() {}
// Accessors. // Accessors.
unsigned getTag() const { return Tag; } unsigned getTag() const { return Tag; }
@ -257,12 +246,7 @@ protected:
public: public:
explicit DIE(unsigned Tag) explicit DIE(unsigned Tag)
: Abbrev(Tag, DW_CHILDREN_no) : Abbrev(Tag, DW_CHILDREN_no), Offset(0), Size(0), Children(), Values() {}
, Offset(0)
, Size(0)
, Children()
, Values()
{}
virtual ~DIE(); virtual ~DIE();
// Accessors. // Accessors.
@ -340,9 +324,7 @@ public:
/// ///
unsigned Type; unsigned Type;
explicit DIEValue(unsigned T) explicit DIEValue(unsigned T) : Type(T) {}
: Type(T)
{}
virtual ~DIEValue() {} virtual ~DIEValue() {}
// Accessors // Accessors
@ -429,10 +411,9 @@ public:
/// DIEString - A string value DIE. /// DIEString - A string value DIE.
/// ///
class DIEString : public DIEValue { class DIEString : public DIEValue {
const std::string Str;
public: public:
const std::string String; explicit DIEString(const std::string &S) : DIEValue(isString), Str(S) {}
explicit DIEString(const std::string &S) : DIEValue(isString), String(S) {}
// Implement isa/cast/dyncast. // Implement isa/cast/dyncast.
static bool classof(const DIEString *) { return true; } static bool classof(const DIEString *) { return true; }
@ -445,20 +426,20 @@ public:
/// SizeOf - Determine size of string value in bytes. /// SizeOf - Determine size of string value in bytes.
/// ///
virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const { virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const {
return String.size() + sizeof(char); // sizeof('\0'); return Str.size() + sizeof(char); // sizeof('\0');
} }
/// Profile - Used to gather unique data for the value folding set. /// Profile - Used to gather unique data for the value folding set.
/// ///
static void Profile(FoldingSetNodeID &ID, const std::string &String) { static void Profile(FoldingSetNodeID &ID, const std::string &Str) {
ID.AddInteger(isString); ID.AddInteger(isString);
ID.AddString(String); ID.AddString(Str);
} }
virtual void Profile(FoldingSetNodeID &ID) { Profile(ID, String); } virtual void Profile(FoldingSetNodeID &ID) { Profile(ID, Str); }
#ifndef NDEBUG #ifndef NDEBUG
virtual void print(std::ostream &O) { virtual void print(std::ostream &O) {
O << "Str: \"" << String << "\""; O << "Str: \"" << Str << "\"";
} }
#endif #endif
}; };
@ -467,10 +448,8 @@ public:
/// DIEDwarfLabel - A Dwarf internal label expression DIE. /// DIEDwarfLabel - A Dwarf internal label expression DIE.
// //
class DIEDwarfLabel : public DIEValue { class DIEDwarfLabel : public DIEValue {
public:
const DWLabel Label; const DWLabel Label;
public:
explicit DIEDwarfLabel(const DWLabel &L) : DIEValue(isLabel), Label(L) {} explicit DIEDwarfLabel(const DWLabel &L) : DIEValue(isLabel), Label(L) {}
// Implement isa/cast/dyncast. // Implement isa/cast/dyncast.
@ -501,14 +480,12 @@ public:
#endif #endif
}; };
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// DIEObjectLabel - A label to an object in code or data. /// DIEObjectLabel - A label to an object in code or data.
// //
class DIEObjectLabel : public DIEValue { class DIEObjectLabel : public DIEValue {
public:
const std::string Label; const std::string Label;
public:
explicit DIEObjectLabel(const std::string &L) explicit DIEObjectLabel(const std::string &L)
: DIEValue(isAsIsLabel), Label(L) {} : DIEValue(isAsIsLabel), Label(L) {}
@ -543,16 +520,15 @@ public:
/// DIESectionOffset - A section offset DIE. /// DIESectionOffset - A section offset DIE.
// //
class DIESectionOffset : public DIEValue { class DIESectionOffset : public DIEValue {
public:
const DWLabel Label; const DWLabel Label;
const DWLabel Section; const DWLabel Section;
bool IsEH : 1; bool IsEH : 1;
bool UseSet : 1; bool UseSet : 1;
public:
DIESectionOffset(const DWLabel &Lab, const DWLabel &Sec, DIESectionOffset(const DWLabel &Lab, const DWLabel &Sec,
bool isEH = false, bool useSet = true) bool isEH = false, bool useSet = true)
: DIEValue(isSectionOffset), Label(Lab), Section(Sec), : DIEValue(isSectionOffset), Label(Lab), Section(Sec),
IsEH(isEH), UseSet(useSet) {} IsEH(isEH), UseSet(useSet) {}
// Implement isa/cast/dyncast. // Implement isa/cast/dyncast.
static bool classof(const DIESectionOffset *) { return true; } static bool classof(const DIESectionOffset *) { return true; }
@ -593,12 +569,11 @@ public:
/// DIEDelta - A simple label difference DIE. /// DIEDelta - A simple label difference DIE.
/// ///
class DIEDelta : public DIEValue { class DIEDelta : public DIEValue {
public:
const DWLabel LabelHi; const DWLabel LabelHi;
const DWLabel LabelLo; const DWLabel LabelLo;
public:
DIEDelta(const DWLabel &Hi, const DWLabel &Lo) DIEDelta(const DWLabel &Hi, const DWLabel &Lo)
: DIEValue(isDelta), LabelHi(Hi), LabelLo(Lo) {} : DIEValue(isDelta), LabelHi(Hi), LabelLo(Lo) {}
// Implement isa/cast/dyncast. // Implement isa/cast/dyncast.
static bool classof(const DIEDelta *) { return true; } static bool classof(const DIEDelta *) { return true; }
@ -637,11 +612,12 @@ public:
/// class can also be used as a proxy for a debug information entry not yet /// class can also be used as a proxy for a debug information entry not yet
/// defined (ie. types.) /// defined (ie. types.)
class DIEntry : public DIEValue { class DIEntry : public DIEValue {
public:
DIE *Entry; DIE *Entry;
public:
explicit DIEntry(DIE *E) : DIEValue(isEntry), Entry(E) {} explicit DIEntry(DIE *E) : DIEValue(isEntry), Entry(E) {}
void setEntry(DIE *E) { Entry = E; }
// Implement isa/cast/dyncast. // Implement isa/cast/dyncast.
static bool classof(const DIEntry *) { return true; } static bool classof(const DIEntry *) { return true; }
static bool classof(const DIEValue *E) { return E->Type == isEntry; } static bool classof(const DIEValue *E) { return E->Type == isEntry; }
@ -683,16 +659,11 @@ public:
/// DIEBlock - A block of values. Primarily used for location expressions. /// DIEBlock - A block of values. Primarily used for location expressions.
// //
class DIEBlock : public DIEValue, public DIE { class DIEBlock : public DIEValue, public DIE {
unsigned Size; // Size in bytes excluding size header.
public: public:
unsigned Size; // Size in bytes excluding size header.
DIEBlock() DIEBlock()
: DIEValue(isBlock) : DIEValue(isBlock), DIE(0), Size(0) {}
, DIE(0) virtual ~DIEBlock() {}
, Size(0)
{}
~DIEBlock() {
}
// Implement isa/cast/dyncast. // Implement isa/cast/dyncast.
static bool classof(const DIEBlock *) { return true; } static bool classof(const DIEBlock *) { return true; }
@ -719,7 +690,6 @@ public:
/// ///
virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const; virtual unsigned SizeOf(const DwarfDebug &DD, unsigned Form) const;
/// Profile - Used to gather unique data for the value folding set. /// Profile - Used to gather unique data for the value folding set.
/// ///
virtual void Profile(FoldingSetNodeID &ID) { virtual void Profile(FoldingSetNodeID &ID) {
@ -739,7 +709,6 @@ public:
/// CompileUnit - This dwarf writer support class manages information associate /// CompileUnit - This dwarf writer support class manages information associate
/// with a source file. /// with a source file.
class CompileUnit { class CompileUnit {
private:
/// ID - File identifier for source. /// ID - File identifier for source.
/// ///
unsigned ID; unsigned ID;
@ -763,7 +732,6 @@ private:
/// DiesSet - Used to uniquely define dies within the compile unit. /// DiesSet - Used to uniquely define dies within the compile unit.
/// ///
FoldingSet<DIE> DiesSet; FoldingSet<DIE> DiesSet;
public: public:
CompileUnit(unsigned I, DIE *D) CompileUnit(unsigned I, DIE *D)
: ID(I), Die(D), GVToDieMap(), : ID(I), Die(D), GVToDieMap(),
@ -1383,7 +1351,7 @@ private:
/// SetDIEntry - Set a DIEntry once the debug information entry is defined. /// SetDIEntry - Set a DIEntry once the debug information entry is defined.
/// ///
void SetDIEntry(DIEntry *Value, DIE *Entry) { void SetDIEntry(DIEntry *Value, DIE *Entry) {
Value->Entry = Entry; Value->setEntry(Entry);
// Add to values set if not already there. If it is, we merely have a // Add to values set if not already there. If it is, we merely have a
// duplicate in the values list (no harm.) // duplicate in the values list (no harm.)
ValuesSet.GetOrInsertNode(Value); ValuesSet.GetOrInsertNode(Value);
@ -4273,7 +4241,7 @@ unsigned DIEInteger::SizeOf(const DwarfDebug &DD, unsigned Form) const {
/// EmitValue - Emit string value. /// EmitValue - Emit string value.
/// ///
void DIEString::EmitValue(DwarfDebug &DD, unsigned Form) { void DIEString::EmitValue(DwarfDebug &DD, unsigned Form) {
DD.getAsm()->EmitString(String); DD.getAsm()->EmitString(Str);
} }
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//