diff options
| author | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-11-20 08:59:02 +0000 |
|---|---|---|
| committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-11-20 08:59:02 +0000 |
| commit | 5a83192570b7cfbd8c34133184e9eac540c3a614 (patch) | |
| tree | 93b97e56528864be0a80f29ddb1665ef37aace20 /llvm/lib/Transforms | |
| parent | 65253e76ede5bb8625e041c8311c798f3a0efa1a (diff) | |
| download | bcm5719-llvm-5a83192570b7cfbd8c34133184e9eac540c3a614.tar.gz bcm5719-llvm-5a83192570b7cfbd8c34133184e9eac540c3a614.zip | |
SimplifyCFG.cpp: Tweak to let msc17 compliant.
- Use LLVM_DELETED_FUNCTION.
- Don't use member initializers.
- Don't use initializer list.
llvm-svn: 222422
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 318773d64c2..4bedf0e2fb9 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -369,19 +369,22 @@ static ConstantInt *GetConstantInt(Value *V, const DataLayout *DL) { /// fail. struct ConstantComparesGatherer { - Value *CompValue = nullptr; /// Value found for the switch comparison - Value *Extra = nullptr; /// Extra clause to be checked before the switch - SmallVector<ConstantInt*, 8> Vals; /// Set of integers to match in switch - unsigned UsedICmps = 0; /// Number of comparisons matched in the and/or chain + Value *CompValue; /// Value found for the switch comparison + Value *Extra; /// Extra clause to be checked before the switch + SmallVector<ConstantInt *, 8> Vals; /// Set of integers to match in switch + unsigned UsedICmps; /// Number of comparisons matched in the and/or chain /// 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); } /// Prevent copy - ConstantComparesGatherer(const ConstantComparesGatherer&) = delete; - ConstantComparesGatherer &operator=(const ConstantComparesGatherer&) = delete; + ConstantComparesGatherer(const ConstantComparesGatherer &) + LLVM_DELETED_FUNCTION; + ConstantComparesGatherer & + operator=(const ConstantComparesGatherer &) LLVM_DELETED_FUNCTION; private: @@ -2825,7 +2828,7 @@ static bool SimplifyBranchOnICmpChain(BranchInst *BI, const DataLayout *DL, // 'setne's and'ed together, collect them. // 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 SmallVectorImpl<ConstantInt*> &Values = ConstantCompare.Vals; Value *CompVal = ConstantCompare.CompValue; |

