Skip to content

Commit 3da4774

Browse files
committed
[IR] Move CallBase::getOperandBundlesAsDefs out of line, NFC
Copying operand bundles doesn't need to be inlined, and this template instantiation shows up in ClangBuildAnalyzer.
1 parent 38fd180 commit 3da4774

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

llvm/include/llvm/IR/InstrTypes.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,10 +1876,7 @@ class CallBase : public Instruction {
18761876
/// OperandBundleUser to a vector of OperandBundleDefs. Note:
18771877
/// OperandBundeUses and OperandBundleDefs are non-trivially *different*
18781878
/// representations of operand bundles (see documentation above).
1879-
void getOperandBundlesAsDefs(SmallVectorImpl<OperandBundleDef> &Defs) const {
1880-
for (unsigned i = 0, e = getNumOperandBundles(); i != e; ++i)
1881-
Defs.emplace_back(getOperandBundleAt(i));
1882-
}
1879+
void getOperandBundlesAsDefs(SmallVectorImpl<OperandBundleDef> &Defs) const;
18831880

18841881
/// Return the operand bundle for the operand at index OpIdx.
18851882
///

llvm/lib/IR/Instructions.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,12 @@ bool CallBase::hasFnAttrOnCalledFunction(StringRef Kind) const {
352352
return false;
353353
}
354354

355+
void CallBase::getOperandBundlesAsDefs(
356+
SmallVectorImpl<OperandBundleDef> &Defs) const {
357+
for (unsigned i = 0, e = getNumOperandBundles(); i != e; ++i)
358+
Defs.emplace_back(getOperandBundleAt(i));
359+
}
360+
355361
CallBase::op_iterator
356362
CallBase::populateBundleOperandInfos(ArrayRef<OperandBundleDef> Bundles,
357363
const unsigned BeginIndex) {

0 commit comments

Comments
 (0)