DebugInfo: Allow DebugLocs to be constructed from const

Allow `const`-qualified pointers to be used to construct `DebugLoc`s, as
a convenience.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235115 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-04-16 16:56:29 +00:00
parent 896b86d421
commit d6629b3db8
2 changed files with 11 additions and 9 deletions

View File

@@ -48,7 +48,7 @@ namespace llvm {
}
/// \brief Construct from an \a MDLocation.
DebugLoc(MDLocation *L);
DebugLoc(const MDLocation *L);
/// \brief Construct from an \a MDNode.
///
@@ -56,7 +56,7 @@ namespace llvm {
/// accessors will crash. However, construction from other nodes is
/// supported in order to handle forward references when reading textual
/// IR.
explicit DebugLoc(MDNode *N);
explicit DebugLoc(const MDNode *N);
/// \brief Get the underlying \a MDLocation.
///
@@ -87,8 +87,8 @@ namespace llvm {
/// If \c !Scope, returns a default-constructed \a DebugLoc.
///
/// FIXME: Remove this. Users should use MDLocation::get().
static DebugLoc get(unsigned Line, unsigned Col, MDNode *Scope,
MDNode *InlinedAt = nullptr);
static DebugLoc get(unsigned Line, unsigned Col, const MDNode *Scope,
const MDNode *InlinedAt = nullptr);
unsigned getLine() const;
unsigned getCol() const;