DebugInfo: Gut DILocation

This is along the same lines as r234832, but for `DILocation`.  Clean
out all accessors from `DILocation`.  Any callers should be using
`MDLocation` directly (e.g., via `operator->()`).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234835 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-04-14 01:35:55 +00:00
parent 1624f35f2b
commit d59e30dfb7
6 changed files with 23 additions and 37 deletions

View File

@@ -663,28 +663,15 @@ public:
MDExpression &operator*() const { return *N; }
};
/// \brief This object holds location information.
///
/// This object is not associated with any DWARF tag.
class DILocation : public DIDescriptor {
class DILocation {
MDLocation *N;
public:
DILocation() = default;
DILocation(const MDLocation *N) : DIDescriptor(N) {}
DILocation(const MDLocation *N = nullptr) : N(const_cast<MDLocation *>(N)) {}
MDLocation *get() const {
return cast_or_null<MDLocation>(DIDescriptor::get());
}
operator MDLocation *() const { return get(); }
MDLocation *operator->() const { return get(); }
MDLocation &operator*() const { return *get(); }
unsigned getLineNumber() const { return get()->getLine(); }
unsigned getColumnNumber() const { return get()->getColumn(); }
DIScope getScope() const { return DIScope(get()->getScope()); }
DILocation getOrigLocation() const { return get()->getInlinedAt(); }
StringRef getFilename() const { return get()->getFilename(); }
StringRef getDirectory() const { return get()->getDirectory(); }
unsigned getDiscriminator() const { return get()->getDiscriminator(); }
operator MDLocation *() const { return N; }
MDLocation *operator->() const { return N; }
MDLocation &operator*() const { return *N; }
};
class DIObjCProperty : public DIDescriptor {