[llvm] r344893 - [CGProfile] Turn constant-size SmallVector into array
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 22 03:51:34 PDT 2018
Author: d0k
Date: Mon Oct 22 03:51:34 2018
New Revision: 344893
URL: http://llvm.org/viewvc/llvm-project?rev=344893&view=rev
Log:
[CGProfile] Turn constant-size SmallVector into array
No functionality change.
Modified:
llvm/trunk/lib/Transforms/Instrumentation/CGProfile.cpp
Modified: llvm/trunk/lib/Transforms/Instrumentation/CGProfile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/CGProfile.cpp?rev=344893&r1=344892&r2=344893&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/CGProfile.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/CGProfile.cpp Mon Oct 22 03:51:34 2018
@@ -88,11 +88,10 @@ void CGProfilePass::addModuleFlags(
std::vector<Metadata *> Nodes;
for (auto E : Counts) {
- SmallVector<Metadata *, 3> Vals;
- Vals.push_back(ValueAsMetadata::get(E.first.first));
- Vals.push_back(ValueAsMetadata::get(E.first.second));
- Vals.push_back(MDB.createConstant(
- ConstantInt::get(Type::getInt64Ty(Context), E.second)));
+ Metadata *Vals[] = {ValueAsMetadata::get(E.first.first),
+ ValueAsMetadata::get(E.first.second),
+ MDB.createConstant(ConstantInt::get(
+ Type::getInt64Ty(Context), E.second))};
Nodes.push_back(MDNode::get(Context, Vals));
}
More information about the llvm-commits
mailing list