diff options
author | Cristian Cadar <c.cadar@imperial.ac.uk> | 2020-04-03 18:57:53 +0100 |
---|---|---|
committer | MartinNowack <2443641+MartinNowack@users.noreply.github.com> | 2020-04-30 09:25:36 +0100 |
commit | 02fed84be089d81a5a9a812c2c8dd112f5e2fa71 (patch) | |
tree | 749c6030b8e371dbfd10906f13374d55a84be6d2 /include | |
parent | e2cbdaeb98168db12aba4abab04eea2416c0931c (diff) | |
download | klee-02fed84be089d81a5a9a812c2c8dd112f5e2fa71.tar.gz |
Removed include/klee/util and moved header files to appropriate places
Diffstat (limited to 'include')
-rw-r--r-- | include/klee/ADT/BitArray.h (renamed from include/klee/util/BitArray.h) | 0 | ||||
-rw-r--r-- | include/klee/ADT/Bits.h (renamed from include/klee/util/Bits.h) | 0 | ||||
-rw-r--r-- | include/klee/ADT/Ref.h (renamed from include/klee/util/Ref.h) | 0 | ||||
-rw-r--r-- | include/klee/Expr/ArrayExprOptimizer.h | 2 | ||||
-rw-r--r-- | include/klee/Expr/ArrayExprRewriter.h | 2 | ||||
-rw-r--r-- | include/klee/Expr/AssignmentGenerator.h | 2 | ||||
-rw-r--r-- | include/klee/Expr/Expr.h | 5 | ||||
-rw-r--r-- | include/klee/Expr/ExprRangeEvaluator.h | 2 | ||||
-rw-r--r-- | include/klee/Expr/ExprSMTLIBPrinter.h | 2 | ||||
-rw-r--r-- | include/klee/Support/FloatEvaluation.h | 5 | ||||
-rw-r--r-- | include/klee/Support/IntEvaluation.h | 2 | ||||
-rw-r--r-- | include/klee/Support/PrintContext.h (renamed from include/klee/util/PrintContext.h) | 0 | ||||
-rw-r--r-- | include/klee/util/GetElementPtrTypeIterator.h | 154 |
13 files changed, 11 insertions, 165 deletions
diff --git a/include/klee/util/BitArray.h b/include/klee/ADT/BitArray.h index 029e130f..029e130f 100644 --- a/include/klee/util/BitArray.h +++ b/include/klee/ADT/BitArray.h diff --git a/include/klee/util/Bits.h b/include/klee/ADT/Bits.h index 5f64e244..5f64e244 100644 --- a/include/klee/util/Bits.h +++ b/include/klee/ADT/Bits.h diff --git a/include/klee/util/Ref.h b/include/klee/ADT/Ref.h index 92fd1740..92fd1740 100644 --- a/include/klee/util/Ref.h +++ b/include/klee/ADT/Ref.h diff --git a/include/klee/Expr/ArrayExprOptimizer.h b/include/klee/Expr/ArrayExprOptimizer.h index 8fc040e5..015ed1a2 100644 --- a/include/klee/Expr/ArrayExprOptimizer.h +++ b/include/klee/Expr/ArrayExprOptimizer.h @@ -17,9 +17,9 @@ #include <utility> #include <vector> +#include "klee/ADT/Ref.h" #include "klee/Expr/Expr.h" #include "klee/Expr/ExprHashMap.h" -#include "klee/util/Ref.h" namespace klee { diff --git a/include/klee/Expr/ArrayExprRewriter.h b/include/klee/Expr/ArrayExprRewriter.h index 098cb0a6..11627906 100644 --- a/include/klee/Expr/ArrayExprRewriter.h +++ b/include/klee/Expr/ArrayExprRewriter.h @@ -14,8 +14,8 @@ #include <map> #include <vector> +#include "klee/ADT/Ref.h" #include "klee/Expr/Expr.h" -#include "klee/util/Ref.h" namespace klee { diff --git a/include/klee/Expr/AssignmentGenerator.h b/include/klee/Expr/AssignmentGenerator.h index 173b863e..cf656d91 100644 --- a/include/klee/Expr/AssignmentGenerator.h +++ b/include/klee/Expr/AssignmentGenerator.h @@ -10,8 +10,8 @@ #ifndef KLEE_ASSIGNMENTGENERATOR_H #define KLEE_ASSIGNMENTGENERATOR_H +#include "klee/ADT/Ref.h" #include "klee/Expr/Expr.h" -#include "klee/util/Ref.h" #include <vector> diff --git a/include/klee/Expr/Expr.h b/include/klee/Expr/Expr.h index 374fc541..c5d1e7bb 100644 --- a/include/klee/Expr/Expr.h +++ b/include/klee/Expr/Expr.h @@ -10,9 +10,8 @@ #ifndef KLEE_EXPR_H #define KLEE_EXPR_H -#include "klee/util/Bits.h" -#include "klee/util/Ref.h" - +#include "klee/ADT/Bits.h" +#include "klee/ADT/Ref.h" #include "llvm/ADT/APFloat.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/DenseSet.h" diff --git a/include/klee/Expr/ExprRangeEvaluator.h b/include/klee/Expr/ExprRangeEvaluator.h index 540ccafd..a8a0f6b8 100644 --- a/include/klee/Expr/ExprRangeEvaluator.h +++ b/include/klee/Expr/ExprRangeEvaluator.h @@ -10,8 +10,8 @@ #ifndef KLEE_EXPRRANGEEVALUATOR_H #define KLEE_EXPRRANGEEVALUATOR_H +#include "klee/ADT/Bits.h" #include "klee/Expr/Expr.h" -#include "klee/util/Bits.h" namespace klee { diff --git a/include/klee/Expr/ExprSMTLIBPrinter.h b/include/klee/Expr/ExprSMTLIBPrinter.h index 38ae2fa1..290caf7b 100644 --- a/include/klee/Expr/ExprSMTLIBPrinter.h +++ b/include/klee/Expr/ExprSMTLIBPrinter.h @@ -14,7 +14,7 @@ #include "klee/Expr/Constraints.h" #include "klee/Expr/Expr.h" #include "klee/Solver/Solver.h" -#include "klee/util/PrintContext.h" +#include "klee/Support/PrintContext.h" #include <map> #include <set> diff --git a/include/klee/Support/FloatEvaluation.h b/include/klee/Support/FloatEvaluation.h index 37392576..d6fcc73c 100644 --- a/include/klee/Support/FloatEvaluation.h +++ b/include/klee/Support/FloatEvaluation.h @@ -12,8 +12,9 @@ #ifndef KLEE_FLOATEVALUATION_H #define KLEE_FLOATEVALUATION_H -#include "klee/util/Bits.h" //bits64::truncateToNBits -#include "IntEvaluation.h" //ints::sext +#include "IntEvaluation.h" // ints::sext + +#include "klee/ADT/Bits.h" // bits64::truncateToNBits #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/MathExtras.h" diff --git a/include/klee/Support/IntEvaluation.h b/include/klee/Support/IntEvaluation.h index 27a8daf0..0e9a40d6 100644 --- a/include/klee/Support/IntEvaluation.h +++ b/include/klee/Support/IntEvaluation.h @@ -10,7 +10,7 @@ #ifndef KLEE_INTEVALUATION_H #define KLEE_INTEVALUATION_H -#include "klee/util/Bits.h" +#include "klee/ADT/Bits.h" #define MAX_BITS (sizeof(uint64_t) * 8) diff --git a/include/klee/util/PrintContext.h b/include/klee/Support/PrintContext.h index de9094da..de9094da 100644 --- a/include/klee/util/PrintContext.h +++ b/include/klee/Support/PrintContext.h diff --git a/include/klee/util/GetElementPtrTypeIterator.h b/include/klee/util/GetElementPtrTypeIterator.h deleted file mode 100644 index cdbc36bc..00000000 --- a/include/klee/util/GetElementPtrTypeIterator.h +++ /dev/null @@ -1,154 +0,0 @@ -//===-- GetElementPtrTypeIterator.h -----------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements an iterator for walking through the types indexed by -// getelementptr, insertvalue and extractvalue instructions. -// -// It is an enhanced version of llvm::gep_type_iterator which only handles -// getelementptr. -// -//===----------------------------------------------------------------------===// - -#ifndef KLEE_GETELEMENTPTRTYPEITERATOR_H -#define KLEE_GETELEMENTPTRTYPEITERATOR_H - -#include "llvm/IR/User.h" -#include "llvm/IR/DerivedTypes.h" -#include "llvm/IR/Instructions.h" -#include "llvm/IR/Constants.h" - -#include "klee/Config/Version.h" - -namespace klee { -template <typename ItTy = llvm::User::const_op_iterator> -class generic_gep_type_iterator - : public std::iterator<std::forward_iterator_tag, llvm::Type *, ptrdiff_t> { - typedef std::iterator<std::forward_iterator_tag, llvm::Type *, ptrdiff_t> - super; - - ItTy OpIt; - llvm::Type *CurTy; - generic_gep_type_iterator() {} - - llvm::Value *asValue(llvm::Value *V) const { return V; } - llvm::Value *asValue(unsigned U) const { - return llvm::ConstantInt::get(CurTy->getContext(), llvm::APInt(32, U)); - } - - public: - static generic_gep_type_iterator begin(llvm::Type *Ty, ItTy It) { - generic_gep_type_iterator I; - I.CurTy = Ty; - I.OpIt = It; - return I; - } - static generic_gep_type_iterator end(ItTy It) { - generic_gep_type_iterator I; - I.CurTy = 0; - I.OpIt = It; - return I; - } - - bool operator==(const generic_gep_type_iterator& x) const { - return OpIt == x.OpIt; - } - bool operator!=(const generic_gep_type_iterator& x) const { - return !operator==(x); - } - - llvm::Type *operator*() const { return CurTy; } - - llvm::Type *getIndexedType() const { - llvm::CompositeType *CT = cast<llvm::CompositeType>(CurTy); - return CT->getTypeAtIndex(getOperand()); - } - - // This is a non-standard operator->. It allows you to call methods on the - // current type directly. - llvm::Type *operator->() const { return operator*(); } - - llvm::Value *getOperand() const { return asValue(*OpIt); } - - generic_gep_type_iterator& operator++() { // Preincrement - if (llvm::CompositeType *CT = dyn_cast<llvm::CompositeType>(CurTy)) { - CurTy = CT->getTypeAtIndex(getOperand()); -#if LLVM_VERSION_CODE >= LLVM_VERSION(4, 0) - } else if (auto ptr = dyn_cast<llvm::PointerType>(CurTy)) { - CurTy = ptr->getElementType(); -#endif - } else { - CurTy = 0; - } - ++OpIt; - return *this; - } - - generic_gep_type_iterator operator++(int) { // Postincrement - generic_gep_type_iterator tmp = *this; ++*this; return tmp; - } - }; - - typedef generic_gep_type_iterator<> gep_type_iterator; - typedef generic_gep_type_iterator<llvm::ExtractValueInst::idx_iterator> ev_type_iterator; - typedef generic_gep_type_iterator<llvm::InsertValueInst::idx_iterator> iv_type_iterator; - typedef generic_gep_type_iterator<llvm::SmallVector<unsigned, 4>::const_iterator> vce_type_iterator; - - inline gep_type_iterator gep_type_begin(const llvm::User *GEP) { - return gep_type_iterator::begin(GEP->getOperand(0)->getType(), - GEP->op_begin()+1); - } - inline gep_type_iterator gep_type_end(const llvm::User *GEP) { - return gep_type_iterator::end(GEP->op_end()); - } - inline gep_type_iterator gep_type_begin(const llvm::User &GEP) { - return gep_type_iterator::begin(GEP.getOperand(0)->getType(), - GEP.op_begin()+1); - } - inline gep_type_iterator gep_type_end(const llvm::User &GEP) { - return gep_type_iterator::end(GEP.op_end()); - } - - inline ev_type_iterator ev_type_begin(const llvm::ExtractValueInst *EV) { - return ev_type_iterator::begin(EV->getOperand(0)->getType(), - EV->idx_begin()); - } - inline ev_type_iterator ev_type_end(const llvm::ExtractValueInst *EV) { - return ev_type_iterator::end(EV->idx_end()); - } - - inline iv_type_iterator iv_type_begin(const llvm::InsertValueInst *IV) { - return iv_type_iterator::begin(IV->getType(), - IV->idx_begin()); - } - inline iv_type_iterator iv_type_end(const llvm::InsertValueInst *IV) { - return iv_type_iterator::end(IV->idx_end()); - } - - inline vce_type_iterator vce_type_begin(const llvm::ConstantExpr *CE) { - return vce_type_iterator::begin(CE->getOperand(0)->getType(), - CE->getIndices().begin()); - } - inline vce_type_iterator vce_type_end(const llvm::ConstantExpr *CE) { - return vce_type_iterator::end(CE->getIndices().end()); - } - - template <typename ItTy> - inline generic_gep_type_iterator<ItTy> gep_type_begin(llvm::Type *Op0, ItTy I, - ItTy E) { - return generic_gep_type_iterator<ItTy>::begin(Op0, I); - } - - template <typename ItTy> - inline generic_gep_type_iterator<ItTy> gep_type_end(llvm::Type *Op0, ItTy I, - ItTy E) { - return generic_gep_type_iterator<ItTy>::end(E); - } -} // end namespace klee - -#endif /* KLEE_GETELEMENTPTRTYPEITERATOR_H */ |