///
unsigned Type;
- /// Usage - Number of uses of this value.
- ///
- unsigned Usage;
-
DIEValue(unsigned T)
: Type(T)
- , Usage(1)
{}
virtual ~DIEValue() {}
+ // Accessors
unsigned getType() const { return Type; }
- unsigned getUsage() const { return Usage; }
- void IncUsage() { ++Usage; }
// Implement isa/cast/dyncast.
static bool classof(const DIEValue *) { return true; }
/// Profile - Used to gather unique data for the value folding set.
///
virtual void Profile(FoldingSetNodeID &ID) {
+ ID.AddInteger(isInteger);
ID.AddInteger(Integer);
}
/// Profile - Used to gather unique data for the value folding set.
///
virtual void Profile(FoldingSetNodeID &ID) {
+ ID.AddInteger(isString);
ID.AddString(String);
}
/// Profile - Used to gather unique data for the value folding set.
///
virtual void Profile(FoldingSetNodeID &ID) {
+ ID.AddInteger(isLabel);
Label.Profile(ID);
}
/// Profile - Used to gather unique data for the value folding set.
///
virtual void Profile(FoldingSetNodeID &ID) {
+ ID.AddInteger(isAsIsLabel);
ID.AddString(Label);
}
/// Profile - Used to gather unique data for the value folding set.
///
virtual void Profile(FoldingSetNodeID &ID){
+ ID.AddInteger(isDelta);
LabelHi.Profile(ID);
LabelLo.Profile(ID);
}
/// Profile - Used to gather unique data for the value folding set.
///
virtual void Profile(FoldingSetNodeID &ID) {
+ ID.AddInteger(isEntry);
+
if (Entry) {
ID.AddPointer(Entry);
} else {
/// Profile - Used to gather unique data for the value folding set.
///
virtual void DIEBlock::Profile(FoldingSetNodeID &ID) {
+ ID.AddInteger(isBlock);
DIE::Profile(ID);
}
void *Where;
Value = static_cast<DIEntry *>(ValuesSet.FindNodeOrInsertPos(ID, Where));
- if (Value) {
- Value->IncUsage();
- return Value;
- }
+ if (Value) return Value;
Value = new DIEntry(Entry);
ValuesSet.InsertNode(Value, Where);
Value = new DIEInteger(Integer);
ValuesSet.InsertNode(Value, Where);
Values.push_back(Value);
- } else {
- Value->IncUsage();
}
Die->AddValue(Attribute, Form, Value);
Value = new DIEInteger(Integer);
ValuesSet.InsertNode(Value, Where);
Values.push_back(Value);
- } else {
- Value->IncUsage();
}
Die->AddValue(Attribute, Form, Value);
Value = new DIEString(String);
ValuesSet.InsertNode(Value, Where);
Values.push_back(Value);
- } else {
- Value->IncUsage();
}
Die->AddValue(Attribute, Form, Value);
Value = new DIEDwarfLabel(Label);
ValuesSet.InsertNode(Value, Where);
Values.push_back(Value);
- } else {
- Value->IncUsage();
}
Die->AddValue(Attribute, Form, Value);
Value = new DIEObjectLabel(Label);
ValuesSet.InsertNode(Value, Where);
Values.push_back(Value);
- } else {
- Value->IncUsage();
}
Die->AddValue(Attribute, Form, Value);
Value = new DIEDelta(Hi, Lo);
ValuesSet.InsertNode(Value, Where);
Values.push_back(Value);
- } else {
- Value->IncUsage();
}
Die->AddValue(Attribute, Form, Value);
ValuesSet.InsertNode(Value, Where);
Values.push_back(Value);
} else {
- Value->IncUsage();
delete Block;
}
// If it exists then use the existing value.
if (Slot) {
- Slot->IncUsage();
Entity->AddValue(DW_AT_type, DW_FORM_ref4, Slot);
return;
}