mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-01 17:32:36 +00:00
IR: Split out getOperandAs(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228250 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a875e3d4d6
commit
c760eff69f
@ -105,8 +105,12 @@ protected:
|
||||
}
|
||||
~DebugNode() {}
|
||||
|
||||
template <class Ty> Ty *getOperandAs(unsigned I) const {
|
||||
return cast_or_null<Ty>(getOperand(I));
|
||||
}
|
||||
|
||||
StringRef getStringOperand(unsigned I) const {
|
||||
if (auto *S = cast_or_null<MDString>(getOperand(I)))
|
||||
if (auto *S = getOperandAs<MDString>(I))
|
||||
return S->getString();
|
||||
return StringRef();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user