From c760eff69f889f5f1d48678240e5c84990030422 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Thu, 5 Feb 2015 01:07:47 +0000 Subject: [PATCH] IR: Split out getOperandAs(), NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228250 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/DebugInfoMetadata.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/llvm/IR/DebugInfoMetadata.h b/include/llvm/IR/DebugInfoMetadata.h index 0439e7f7b23..ba0c2320f63 100644 --- a/include/llvm/IR/DebugInfoMetadata.h +++ b/include/llvm/IR/DebugInfoMetadata.h @@ -105,8 +105,12 @@ protected: } ~DebugNode() {} + template Ty *getOperandAs(unsigned I) const { + return cast_or_null(getOperand(I)); + } + StringRef getStringOperand(unsigned I) const { - if (auto *S = cast_or_null(getOperand(I))) + if (auto *S = getOperandAs(I)) return S->getString(); return StringRef(); } -- 2.34.1