BFI: Add constructor for Weight

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212868 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2014-07-12 00:26:00 +00:00
parent d164a164ec
commit 8ff8772676
2 changed files with 3 additions and 5 deletions

View File

@ -322,6 +322,8 @@ public:
BlockNode TargetNode;
uint64_t Amount;
Weight() : Type(Local), Amount(0) {}
Weight(DistType Type, BlockNode TargetNode, uint64_t Amount)
: Type(Type), TargetNode(TargetNode), Amount(Amount) {}
};
/// \brief Distribution of unscaled probability weight.

View File

@ -112,11 +112,7 @@ void Distribution::add(const BlockNode &Node, uint64_t Amount,
Total = NewTotal;
// Save the weight.
Weight W;
W.TargetNode = Node;
W.Amount = Amount;
W.Type = Type;
Weights.push_back(W);
Weights.push_back(Weight(Type, Node, Amount));
}
static void combineWeight(Weight &W, const Weight &OtherW) {