[Cloning] Pass blocks as ArrayRef to remapInstructions (NFC).
authorFlorian Hahn <flo@fhahn.com>
Fri, 3 Feb 2023 20:03:15 +0000 (20:03 +0000)
committerFlorian Hahn <flo@fhahn.com>
Fri, 3 Feb 2023 20:03:16 +0000 (20:03 +0000)
Passing ArrayRef doesn't force users to construct a SmallVector to pass
blocks.

llvm/include/llvm/Transforms/Utils/Cloning.h
llvm/lib/Transforms/Utils/CloneFunction.cpp

index 7705039..85343a6 100644 (file)
@@ -286,7 +286,7 @@ Loop *cloneLoopWithPreheader(BasicBlock *Before, BasicBlock *LoopDomBB,
                              SmallVectorImpl<BasicBlock *> &Blocks);
 
 /// Remaps instructions in \p Blocks using the mapping in \p VMap.
-void remapInstructionsInBlocks(const SmallVectorImpl<BasicBlock *> &Blocks,
+void remapInstructionsInBlocks(ArrayRef<BasicBlock *> Blocks,
                                ValueToValueMapTy &VMap);
 
 /// Split edge between BB and PredBB and duplicate all non-Phi instructions
index 87822ee..315263a 100644 (file)
@@ -937,8 +937,8 @@ void llvm::CloneAndPruneFunctionInto(
 }
 
 /// Remaps instructions in \p Blocks using the mapping in \p VMap.
-void llvm::remapInstructionsInBlocks(
-    const SmallVectorImpl<BasicBlock *> &Blocks, ValueToValueMapTy &VMap) {
+void llvm::remapInstructionsInBlocks(ArrayRef<BasicBlock *> Blocks,
+                                     ValueToValueMapTy &VMap) {
   // Rewrite the code to refer to itself.
   for (auto *BB : Blocks)
     for (auto &Inst : *BB)