/// DIFile - This is a wrapper for a file.
class DIFile : public DIScope {
friend class DIDescriptor;
- void printInternal(raw_ostream &OS) const {} // FIXME: Output something?
public:
explicit DIFile(const MDNode *N = 0) : DIScope(N) {
if (DbgNode && !isFile())
DbgNode = 0;
}
- StringRef getFilename() const { return getStringField(1); }
- StringRef getDirectory() const { return getStringField(2); }
+ MDNode *getFileNode() const;
bool Verify() const;
};
explicit DIType(const MDNode *N);
explicit DIType() {}
- DIScope getContext() const { return getFieldAs<DIScope>(1); }
- StringRef getName() const { return getStringField(2); }
- DIFile getFile() const { return getFieldAs<DIFile>(3); }
+ DIScope getContext() const { return getFieldAs<DIScope>(2); }
+ StringRef getName() const { return getStringField(3); }
unsigned getLineNumber() const { return getUnsignedField(4); }
uint64_t getSizeInBits() const { return getUInt64Field(5); }
uint64_t getAlignInBits() const { return getUInt64Field(6); }
bool isValid() const {
return DbgNode && (isBasicType() || isDerivedType() || isCompositeType());
}
- StringRef getDirectory() const {
- return getFieldAs<DIFile>(3).getDirectory();
- }
- StringRef getFilename() const {
- return getFieldAs<DIFile>(3).getFilename();
- }
/// isUnsignedDIType - Return true if type encoding is unsigned.
bool isUnsignedDIType();
unsigned getLineNumber() const { return getUnsignedField(2); }
unsigned getColumnNumber() const { return getUnsignedField(3); }
StringRef getDirectory() const {
- StringRef dir = getFieldAs<DIFile>(4).getDirectory();
- return !dir.empty() ? dir : getContext().getDirectory();
+ return getFieldAs<DIFile>(4).getDirectory();
}
StringRef getFilename() const {
- StringRef filename = getFieldAs<DIFile>(4).getFilename();
- return !filename.empty() ? filename : getContext().getFilename();
+ return getFieldAs<DIFile>(4).getFilename();
}
bool Verify() const;
};
unsigned getLineNumber() const { return getScope().getLineNumber(); }
unsigned getColumnNumber() const { return getScope().getColumnNumber(); }
StringRef getDirectory() const {
- StringRef dir = getFieldAs<DIFile>(2).getDirectory();
- return !dir.empty() ? dir : getContext().getDirectory();
+ return getFieldAs<DIFile>(2).getDirectory();
}
StringRef getFilename() const {
- StringRef filename = getFieldAs<DIFile>(2).getFilename();
- assert(!filename.empty() && "Why'd you create this then?");
- return filename;
+ return getFieldAs<DIFile>(2).getFilename();
}
DILexicalBlock getScope() const { return getFieldAs<DILexicalBlock>(1); }
bool Verify() const;
/// DINameSpace - A wrapper for a C++ style name space.
class DINameSpace : public DIScope {
+ friend class DIDescriptor;
+ void printInternal(raw_ostream &OS) const;
public:
explicit DINameSpace(const MDNode *N = 0) : DIScope(N) {}
- DIScope getContext() const { return getFieldAs<DIScope>(1); }
- StringRef getName() const { return getStringField(2); }
- StringRef getDirectory() const {
- return getFieldAs<DIFile>(3).getDirectory();
- }
- StringRef getFilename() const {
- return getFieldAs<DIFile>(3).getFilename();
- }
+ DIScope getContext() const { return getFieldAs<DIScope>(2); }
+ StringRef getName() const { return getStringField(3); }
unsigned getLineNumber() const { return getUnsignedField(4); }
bool Verify() const;
};