forked from OSchip/llvm-project
SimplifyCFG.cpp: Tweak to let msc17 compliant.
- Use LLVM_DELETED_FUNCTION. - Don't use member initializers. - Don't use initializer list. llvm-svn: 222422
This commit is contained in:
parent
65253e76ed
commit
5a83192570
|
@ -369,19 +369,22 @@ static ConstantInt *GetConstantInt(Value *V, const DataLayout *DL) {
|
||||||
/// fail.
|
/// fail.
|
||||||
struct ConstantComparesGatherer {
|
struct ConstantComparesGatherer {
|
||||||
|
|
||||||
Value *CompValue = nullptr; /// Value found for the switch comparison
|
Value *CompValue; /// Value found for the switch comparison
|
||||||
Value *Extra = nullptr; /// Extra clause to be checked before the switch
|
Value *Extra; /// Extra clause to be checked before the switch
|
||||||
SmallVector<ConstantInt *, 8> Vals; /// Set of integers to match in switch
|
SmallVector<ConstantInt *, 8> Vals; /// Set of integers to match in switch
|
||||||
unsigned UsedICmps = 0; /// Number of comparisons matched in the and/or chain
|
unsigned UsedICmps; /// Number of comparisons matched in the and/or chain
|
||||||
|
|
||||||
/// Construct and compute the result for the comparison instruction Cond
|
/// Construct and compute the result for the comparison instruction Cond
|
||||||
ConstantComparesGatherer(Instruction *Cond, const DataLayout *DL) {
|
ConstantComparesGatherer(Instruction *Cond, const DataLayout *DL)
|
||||||
|
: CompValue(nullptr), Extra(nullptr), UsedICmps(0) {
|
||||||
gather(Cond, DL);
|
gather(Cond, DL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Prevent copy
|
/// Prevent copy
|
||||||
ConstantComparesGatherer(const ConstantComparesGatherer&) = delete;
|
ConstantComparesGatherer(const ConstantComparesGatherer &)
|
||||||
ConstantComparesGatherer &operator=(const ConstantComparesGatherer&) = delete;
|
LLVM_DELETED_FUNCTION;
|
||||||
|
ConstantComparesGatherer &
|
||||||
|
operator=(const ConstantComparesGatherer &) LLVM_DELETED_FUNCTION;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -2825,7 +2828,7 @@ static bool SimplifyBranchOnICmpChain(BranchInst *BI, const DataLayout *DL,
|
||||||
// 'setne's and'ed together, collect them.
|
// 'setne's and'ed together, collect them.
|
||||||
|
|
||||||
// Try to gather values from a chain of and/or to be turned into a switch
|
// Try to gather values from a chain of and/or to be turned into a switch
|
||||||
ConstantComparesGatherer ConstantCompare{Cond, DL};
|
ConstantComparesGatherer ConstantCompare(Cond, DL);
|
||||||
// Unpack the result
|
// Unpack the result
|
||||||
SmallVectorImpl<ConstantInt*> &Values = ConstantCompare.Vals;
|
SmallVectorImpl<ConstantInt*> &Values = ConstantCompare.Vals;
|
||||||
Value *CompVal = ConstantCompare.CompValue;
|
Value *CompVal = ConstantCompare.CompValue;
|
||||||
|
|
Loading…
Reference in New Issue