diff options
author | Stepan Dyatkovskiy <stpworld@narod.ru> | 2012-05-08 08:33:21 +0000 |
---|---|---|
committer | Stepan Dyatkovskiy <stpworld@narod.ru> | 2012-05-08 08:33:21 +0000 |
commit | 1f9838347fdcc75cead228ec1758063074b89c6a (patch) | |
tree | 5c351480bfeee042189aea714de3e8a570e29e8d /include | |
parent | 189bce48c7121b0d21f23aa3dec91fcf66e27925 (diff) | |
download | llvm-1f9838347fdcc75cead228ec1758063074b89c6a.tar.gz llvm-1f9838347fdcc75cead228ec1758063074b89c6a.tar.bz2 llvm-1f9838347fdcc75cead228ec1758063074b89c6a.tar.xz |
Rejected r156374: Ordinary PR1255 patch. Due to clang-x86_64-debian-fnt buildbot failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156377 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/ConstantRangesSet.h | 16 | ||||
-rw-r--r-- | include/llvm/Instructions.h | 48 |
2 files changed, 5 insertions, 59 deletions
diff --git a/include/llvm/ConstantRangesSet.h b/include/llvm/ConstantRangesSet.h index a3f082f822..2d3ee8bafa 100644 --- a/include/llvm/ConstantRangesSet.h +++ b/include/llvm/ConstantRangesSet.h @@ -48,15 +48,8 @@ class ConstantRangesSet { Constant *Array; public: - bool IsWide; - // implicit - ConstantRangesSet(Constant *V) : Array(V) { - ArrayType *ArrTy = cast<ArrayType>(Array->getType()); - VectorType *VecTy = cast<VectorType>(ArrTy->getElementType()); - IntegerType *IntTy = cast<IntegerType>(VecTy->getElementType()); - IsWide = IntTy->getBitWidth() > 64; - } + ConstantRangesSet(Constant *V) : Array(V) {} operator Constant*() { return Array; } operator const Constant*() const { return Array; } @@ -237,13 +230,6 @@ public: return cast<ArrayType>(Array->getType())->getNumElements(); } - bool isWideNumberFormat() const { return IsWide; } - - bool isSingleNumber(unsigned idx) const { - Constant *CV = Array->getAggregateElement(idx); - return cast<VectorType>(CV->getType())->getNumElements() == 1; - } - /// Returns set the size, that equals number of all values + sizes of all /// ranges. /// Ranges set is considered as flat numbers collection. diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 320602686b..f6eaf04fd0 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -20,8 +20,6 @@ #include "llvm/DerivedTypes.h" #include "llvm/Attributes.h" #include "llvm/CallingConv.h" -#include "llvm/ConstantRangesSet.h" -#include "llvm/CRSBuilder.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/ErrorHandling.h" @@ -2502,19 +2500,9 @@ public: } /// Resolves case value for current case. - /// @Deprecated ConstantIntTy *getCaseValue() { assert(Index < SI->getNumCases() && "Index out the number of cases."); - ConstantRangesSet CRS = - reinterpret_cast<Constant*>(SI->getOperand(2 + Index*2)); - ConstantRangesSet::Range R = CRS.getItem(0); - return R.Low; - } - - /// Resolves case value for current case. - ConstantRangesSet getCaseValueEx() { - assert(Index < SI->getNumCases() && "Index out the number of cases."); - return reinterpret_cast<Constant*>(SI->getOperand(2 + Index*2)); + return reinterpret_cast<ConstantIntTy*>(SI->getOperand(2 + Index*2)); } /// Resolves successor for current case. @@ -2584,19 +2572,9 @@ public: CaseIt(SwitchInst *SI, unsigned CaseNum) : ParentTy(SI, CaseNum) {} /// Sets the new value for current case. - /// @Deprecated. void setValue(ConstantInt *V) { assert(Index < SI->getNumCases() && "Index out the number of cases."); - CRSBuilder CB; - CB.add(V); - SI->setOperand(2 + Index*2, - reinterpret_cast<Value*>((Constant*)CB.getCase())); - } - - /// Sets the new value for current case. - void setValueEx(ConstantRangesSet& V) { - assert(Index < SI->getNumCases() && "Index out the number of cases."); - SI->setOperand(2 + Index*2, reinterpret_cast<Value*>((Constant*)V)); + SI->setOperand(2 + Index*2, reinterpret_cast<Value*>(V)); } /// Sets the new successor for current case. @@ -2676,13 +2654,13 @@ public: /// that it is handled by the default handler. CaseIt findCaseValue(const ConstantInt *C) { for (CaseIt i = case_begin(), e = case_end(); i != e; ++i) - if (i.getCaseValueEx().isSatisfies(C)) + if (i.getCaseValue() == C) return i; return case_default(); } ConstCaseIt findCaseValue(const ConstantInt *C) const { for (ConstCaseIt i = case_begin(), e = case_end(); i != e; ++i) - if (i.getCaseValueEx().isSatisfies(C)) + if (i.getCaseValue() == C) return i; return case_default(); } @@ -2703,17 +2681,10 @@ public: } /// addCase - Add an entry to the switch instruction... - /// @Deprecated /// Note: /// This action invalidates case_end(). Old case_end() iterator will /// point to the added case. void addCase(ConstantInt *OnVal, BasicBlock *Dest); - - /// addCase - Add an entry to the switch instruction. - /// Note: - /// This action invalidates case_end(). Old case_end() iterator will - /// point to the added case. - void addCase(ConstantRangesSet& OnVal, BasicBlock *Dest); /// removeCase - This method removes the specified case and its successor /// from the switch instruction. Note that this operation may reorder the @@ -2732,17 +2703,6 @@ public: assert(idx < getNumSuccessors() && "Successor # out of range for switch!"); setOperand(idx*2+1, (Value*)NewSucc); } - - uint16_t Hash() const { - uint32_t NumberOfCases = (uint32_t)getNumCases(); - uint16_t Hash = (0xFFFF & NumberOfCases) ^ (NumberOfCases >> 16); - for (ConstCaseIt i = case_begin(), e = case_end(); - i != e; ++i) { - uint32_t NumItems = (uint32_t)i.getCaseValueEx().getNumItems(); - Hash = (Hash << 1) ^ (0xFFFF & NumItems) ^ (NumItems >> 16); - } - return Hash; - } // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SwitchInst *) { return true; } |