From: Duncan P. N. Exon Smith Date: Thu, 5 Feb 2015 01:07:47 +0000 (+0000) Subject: IR: Split out getOperandAs(), NFC X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c760eff69f889f5f1d48678240e5c84990030422;p=oota-llvm.git IR: Split out getOperandAs(), NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228250 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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(); }