diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-20 01:18:47 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-20 01:18:47 +0000 |
| commit | 9c73c4aff2108a3df3bcf7450c8d0ddb9cb85e14 (patch) | |
| tree | 7869a256dd1b635aad1da90e4c617d46f1ef3064 | |
| parent | d16a9b1fdc3f1422396c89e2a715bbc200035100 (diff) | |
| download | bcm5719-llvm-9c73c4aff2108a3df3bcf7450c8d0ddb9cb85e14.tar.gz bcm5719-llvm-9c73c4aff2108a3df3bcf7450c8d0ddb9cb85e14.zip | |
IR: Add getRaw() helper, NFC
llvm-svn: 229947
| -rw-r--r-- | llvm/include/llvm/IR/DebugInfo.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/include/llvm/IR/DebugInfo.h b/llvm/include/llvm/IR/DebugInfo.h index d31f107d913..f7d71e53702 100644 --- a/llvm/include/llvm/IR/DebugInfo.h +++ b/llvm/include/llvm/IR/DebugInfo.h @@ -928,26 +928,28 @@ public: /// /// This object is not associated with any DWARF tag. class DILocation : public DIDescriptor { + MDLocation *getRaw() const { return dyn_cast_or_null<MDLocation>(get()); } + public: explicit DILocation(const MDNode *N) : DIDescriptor(N) {} unsigned getLineNumber() const { - if (auto *L = dyn_cast_or_null<MDLocation>(DbgNode)) + if (auto *L = getRaw()) return L->getLine(); return 0; } unsigned getColumnNumber() const { - if (auto *L = dyn_cast_or_null<MDLocation>(DbgNode)) + if (auto *L = getRaw()) return L->getColumn(); return 0; } DIScope getScope() const { - if (auto *L = dyn_cast_or_null<MDLocation>(DbgNode)) + if (auto *L = getRaw()) return DIScope(dyn_cast_or_null<MDNode>(L->getScope())); return DIScope(nullptr); } DILocation getOrigLocation() const { - if (auto *L = dyn_cast_or_null<MDLocation>(DbgNode)) + if (auto *L = getRaw()) return DILocation(dyn_cast_or_null<MDNode>(L->getInlinedAt())); return DILocation(nullptr); } |

