[Metadata] Replace a SmallVector with an array; NFC
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Wed, 15 Aug 2018 22:15:35 +0000 (22:15 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Wed, 15 Aug 2018 22:15:35 +0000 (22:15 +0000)
MDNode::get takes an ArrayRef, so these should be equivalent.

llvm-svn: 339824

llvm/lib/IR/MDBuilder.cpp

index 1bb23c0..3fa541f 100644 (file)
@@ -260,8 +260,9 @@ MDNode *MDBuilder::createMutableTBAAAccessTag(MDNode *Tag) {
 }
 
 MDNode *MDBuilder::createIrrLoopHeaderWeight(uint64_t Weight) {
-  SmallVector<Metadata *, 2> Vals(2);
-  Vals[0] = createString("loop_header_weight");
-  Vals[1] = createConstant(ConstantInt::get(Type::getInt64Ty(Context), Weight));
+  Metadata *Vals[] = {
+    createString("loop_header_weight"),
+    createConstant(ConstantInt::get(Type::getInt64Ty(Context), Weight)),
+  };
   return MDNode::get(Context, Vals);
 }