class DIDescriptor {
protected:
- GlobalVariable *GV;
+ GlobalVariable *DbgGV;
/// DIDescriptor constructor. If the specified GV is non-null, this checks
/// to make sure that the tag in the descriptor matches 'RequiredTag'. If
GlobalVariable *getGlobalVariableField(unsigned Elt) const;
public:
- explicit DIDescriptor() : GV(0) {}
- explicit DIDescriptor(GlobalVariable *gv) : GV(gv) {}
+ explicit DIDescriptor() : DbgGV(0) {}
+ explicit DIDescriptor(GlobalVariable *GV) : DbgGV(GV) {}
- bool isNull() const { return GV == 0; }
+ bool isNull() const { return DbgGV == 0; }
- GlobalVariable *getGV() const { return GV; }
+ GlobalVariable *getGV() const { return DbgGV; }
unsigned getVersion() const {
return getUnsignedField(0) & LLVMDebugVersionMask;
explicit DIDerivedType(GlobalVariable *GV)
: DIType(GV, true, true) {
if (GV && !isDerivedType(getTag()))
- GV = 0;
+ DbgGV = 0;
}
DIType getTypeDerivedFrom() const { return getFieldAs<DIType>(9); }
explicit DICompositeType(GlobalVariable *GV)
: DIDerivedType(GV, true, true) {
if (GV && !isCompositeType(getTag()))
- GV = 0;
+ DbgGV = 0;
}
DIArray getTypeArray() const { return getFieldAs<DIArray>(10); }
/// global etc).
class DIVariable : public DIDescriptor {
public:
- explicit DIVariable(GlobalVariable *gv = 0)
- : DIDescriptor(gv) {
- if (gv && !isVariable(getTag()))
- GV = 0;
+ explicit DIVariable(GlobalVariable *GV = 0)
+ : DIDescriptor(GV) {
+ if (GV && !isVariable(getTag()))
+ DbgGV = 0;
}
DIDescriptor getContext() const { return getDescriptorField(1); }
return true;
}
-DIDescriptor::DIDescriptor(GlobalVariable *gv, unsigned RequiredTag) {
- GV = gv;
+DIDescriptor::DIDescriptor(GlobalVariable *GV, unsigned RequiredTag) {
+ DbgGV = GV;
// If this is non-null, check to see if the Tag matches. If not, set to null.
if (GV && getTag() != RequiredTag)
- GV = 0;
+ DbgGV = 0;
}
const std::string &
DIDescriptor::getStringField(unsigned Elt, std::string &Result) const {
- if (GV == 0) {
+ if (DbgGV == 0) {
Result.clear();
return Result;
}
- Constant *C = GV->getInitializer();
+ Constant *C = DbgGV->getInitializer();
if (C == 0 || Elt >= C->getNumOperands()) {
Result.clear();
return Result;
}
uint64_t DIDescriptor::getUInt64Field(unsigned Elt) const {
- if (GV == 0) return 0;
+ if (DbgGV == 0) return 0;
- Constant *C = GV->getInitializer();
+ Constant *C = DbgGV->getInitializer();
if (C == 0 || Elt >= C->getNumOperands())
return 0;
}
DIDescriptor DIDescriptor::getDescriptorField(unsigned Elt) const {
- if (GV == 0) return DIDescriptor();
+ if (DbgGV == 0) return DIDescriptor();
- Constant *C = GV->getInitializer();
+ Constant *C = DbgGV->getInitializer();
if (C == 0 || Elt >= C->getNumOperands())
return DIDescriptor();
}
GlobalVariable *DIDescriptor::getGlobalVariableField(unsigned Elt) const {
- if (GV == 0) return 0;
+ if (DbgGV == 0) return 0;
- Constant *C = GV->getInitializer();
+ Constant *C = DbgGV->getInitializer();
if (C == 0 || Elt >= C->getNumOperands())
return 0;
//===----------------------------------------------------------------------===//
// Needed by DIVariable::getType().
-DIType::DIType(GlobalVariable *gv) : DIDescriptor(gv) {
- if (!gv) return;
+DIType::DIType(GlobalVariable *GV) : DIDescriptor(GV) {
+ if (!GV) return;
unsigned tag = getTag();
if (tag != dwarf::DW_TAG_base_type && !DIDerivedType::isDerivedType(tag) &&
!DICompositeType::isCompositeType(tag))
- GV = 0;
+ DbgGV = 0;
}
/// isDerivedType - Return true if the specified tag is legal for
}
unsigned DIArray::getNumElements() const {
- assert (GV && "Invalid DIArray");
- Constant *C = GV->getInitializer();
+ assert (DbgGV && "Invalid DIArray");
+ Constant *C = DbgGV->getInitializer();
assert (C && "Invalid DIArray initializer");
return C->getNumOperands();
}
/// dump - Print descriptor.
void DIDescriptor::dump() const {
cerr << "[" << dwarf::TagString(getTag()) << "] ";
- cerr << std::hex << "[GV:" << GV << "]" << std::dec;
+ cerr << std::hex << "[GV:" << DbgGV << "]" << std::dec;
}
/// dump - Print compile unit.
cerr << " [fwd] ";
if (isBasicType(Tag))
- DIBasicType(GV).dump();
+ DIBasicType(DbgGV).dump();
else if (isDerivedType(Tag))
- DIDerivedType(GV).dump();
+ DIDerivedType(DbgGV).dump();
else if (isCompositeType(Tag))
- DICompositeType(GV).dump();
+ DICompositeType(DbgGV).dump();
else {
cerr << "Invalid DIType\n";
return;
cerr << " [def] ";
if (isGlobalVariable(Tag))
- DIGlobalVariable(GV).dump();
+ DIGlobalVariable(DbgGV).dump();
cerr << "\n";
}