Skip to content

Commit 2b4fbc3

Browse files
committed
review: remove use of small vector
1 parent a6b094e commit 2b4fbc3

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

llvm/lib/Target/DirectX/DXILTranslateMetadata.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -303,14 +303,12 @@ static void translateBranchMetadata(Module &M, Instruction *BBTerminatorInst) {
303303
"invalid operands for hlsl.controlflow.hint");
304304

305305
MDBuilder MDHelper(M.getContext());
306-
ConstantInt *Op1 =
307-
mdconst::extract<ConstantInt>(HlslControlFlowMD->getOperand(1));
308306

309-
SmallVector<llvm::Metadata *, 2> Vals(
310-
ArrayRef<Metadata *>{MDHelper.createString("dx.controlflow.hints"),
311-
MDHelper.createConstant(Op1)});
307+
llvm::Metadata *HintsStr = MDHelper.createString("dx.controlflow.hints");
308+
llvm::Metadata *HintsValue = MDHelper.createConstant(
309+
mdconst::extract<ConstantInt>(HlslControlFlowMD->getOperand(1)));
312310

313-
MDNode *MDNode = llvm::MDNode::get(M.getContext(), Vals);
311+
MDNode *MDNode = llvm::MDNode::get(M.getContext(), {HintsStr, HintsValue});
314312

315313
BBTerminatorInst->setMetadata("dx.controlflow.hints", MDNode);
316314
BBTerminatorInst->setMetadata("hlsl.controlflow.hint", nullptr);

0 commit comments

Comments
 (0)