/// Configuration values for initial hash set sizes (log2).
///
-static const unsigned InitDiesSetSize = 9; // 512
-static const unsigned InitAbbreviationsSetSize = 9; // 512
-static const unsigned InitValuesSetSize = 9; // 512
+static const unsigned InitDiesSetSize = 9; // log2(512)
+static const unsigned InitAbbreviationsSetSize = 9; // log2(512)
+static const unsigned InitValuesSetSize = 9; // log2(512)
//===----------------------------------------------------------------------===//
/// Forward declarations.
/// Dwarf - Emits general Dwarf directives.
///
class Dwarf {
-
protected:
-
//===--------------------------------------------------------------------===//
// Core attributes used by the Dwarf writer.
//
}
public:
-
//===--------------------------------------------------------------------===//
// Accessors.
//
unsigned LabelID; // Label in code ID number.
public:
SrcLineInfo(unsigned L, unsigned C, unsigned S, unsigned I)
- : Line(L), Column(C), SourceID(S), LabelID(I) {}
+ : Line(L), Column(C), SourceID(S), LabelID(I) {}
// Accessors
unsigned getLine() const { return Line; }
unsigned getLabelID() const { return LabelID; }
};
-
//===----------------------------------------------------------------------===//
/// SrcFileInfo - This class is used to track source information.
///
/// DbgVariable - This class is used to track local variable information.
///
class DbgVariable {
-private:
DIVariable Var; // Variable Descriptor.
unsigned FrameIndex; // Variable frame index.
-
public:
DbgVariable(DIVariable V, unsigned I) : Var(V), FrameIndex(I) {}
/// DbgScope - This class is used to track scope information.
///
class DbgScope {
-private:
DbgScope *Parent; // Parent to this scope.
DIDescriptor Desc; // Debug info descriptor for scope.
// Either subprogram or block.
unsigned EndLabelID; // Label ID of the end of scope.
SmallVector<DbgScope *, 4> Scopes; // Scopes defined in scope.
SmallVector<DbgVariable *, 8> Variables;// Variables declared in scope.
-
public:
DbgScope(DbgScope *P, DIDescriptor D)
: Parent(P), Desc(D), StartLabelID(0), EndLabelID(0), Scopes(), Variables()
/// DwarfDebug - Emits Dwarf debug directives.
///
class DwarfDebug : public Dwarf {
-
-private:
//===--------------------------------------------------------------------===//
// Attributes used to construct specific Dwarf sections.
//
else if (Ty.isDerivedType(Ty.getTag()))
ConstructTypeDIE(DW_Unit, Buffer, DIDerivedType(Ty.getGV()));
else {
- assert (Ty.isCompositeType(Ty.getTag()) && "Unknown kind of DIType");
+ assert(Ty.isCompositeType(Ty.getTag()) && "Unknown kind of DIType");
ConstructTypeDIE(DW_Unit, Buffer, DICompositeType(Ty.getGV()));
}
Die->AddChild(Child);
Buffer.Detach();
SetDIEntry(Slot, Child);
- }
- else {
+ } else {
Die = DW_Unit->AddDie(Buffer);
SetDIEntry(Slot, Die);
}
}
}
- // ConstructSubrangeDIE - Construct subrange DIE from DISubrange.
- void ConstructSubrangeDIE (DIE &Buffer, DISubrange SR, DIE *IndexTy) {
+ /// ConstructSubrangeDIE - Construct subrange DIE from DISubrange.
+ void ConstructSubrangeDIE(DIE &Buffer, DISubrange SR, DIE *IndexTy) {
int64_t L = SR.getLo();
int64_t H = SR.getHi();
DIE *DW_Subrange = new DIE(DW_TAG_subrange_type);
}
}
- /// ConstructEnumTypeDIE - Construct enum type DIE from
- /// DIEnumerator.
+ /// ConstructEnumTypeDIE - Construct enum type DIE from DIEnumerator.
DIE *ConstructEnumTypeDIE(CompileUnit *DW_Unit, DIEnumerator *ETy) {
DIE *Enumerator = new DIE(DW_TAG_enumerator);
}
/// CreateGlobalVariableDIE - Create new DIE using GV.
- DIE *CreateGlobalVariableDIE(CompileUnit *DW_Unit, const DIGlobalVariable &GV)
+ DIE *CreateGlobalVariableDIE(CompileUnit *DW_Unit, const DIGlobalVariable &GV)
{
DIE *GVDie = new DIE(DW_TAG_variable);
AddString(GVDie, DW_AT_name, DW_FORM_string, GV.getName());
std::string SPName = "llvm.dbg.subprograms";
std::vector<GlobalVariable*> Result;
getGlobalVariablesUsing(*M, SPName, Result);
+
for (std::vector<GlobalVariable *>::iterator I = Result.begin(),
E = Result.end(); I != E; ++I) {
-
DISubprogram SPD(*I);
if (SPD.getName() == MF->getFunction()->getName()) {
/// DwarfException - Emits Dwarf exception handling directives.
///
class DwarfException : public Dwarf {
-
-private:
struct FunctionEHFrameInfo {
std::string FnName;
unsigned Number;