[llvm] r222422 - SimplifyCFG.cpp: Tweak to let msc17 compliant.

NAKAMURA Takumi geek4civic at gmail.com
Thu Nov 20 00:59:02 PST 2014


Author: chapuni
Date: Thu Nov 20 02:59:02 2014
New Revision: 222422

URL: http://llvm.org/viewvc/llvm-project?rev=222422&view=rev
Log:
SimplifyCFG.cpp: Tweak to let msc17 compliant.

  - Use LLVM_DELETED_FUNCTION.
  - Don't use member initializers.
  - Don't use initializer list.

Modified:
    llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp

Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=222422&r1=222421&r2=222422&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Thu Nov 20 02:59:02 2014
@@ -369,19 +369,22 @@ static ConstantInt *GetConstantInt(Value
 /// 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(Br
   // '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;





More information about the llvm-commits mailing list