OLD | NEW |
1 //=== BasicValueFactory.cpp - Basic values for Path Sens analysis --*- C++ -*-// | 1 //=== BasicValueFactory.cpp - Basic values for Path Sens analysis --*- C++ -*-// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file defines BasicValueFactory, a class that manages the lifetime | 10 // This file defines BasicValueFactory, a class that manages the lifetime |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 const llvm::APSInt& BasicValueFactory::getValue(uint64_t X, unsigned BitWidth, | 92 const llvm::APSInt& BasicValueFactory::getValue(uint64_t X, unsigned BitWidth, |
93 bool isUnsigned) { | 93 bool isUnsigned) { |
94 llvm::APSInt V(BitWidth, isUnsigned); | 94 llvm::APSInt V(BitWidth, isUnsigned); |
95 V = X; | 95 V = X; |
96 return getValue(V); | 96 return getValue(V); |
97 } | 97 } |
98 | 98 |
99 const llvm::APSInt& BasicValueFactory::getValue(uint64_t X, QualType T) { | 99 const llvm::APSInt& BasicValueFactory::getValue(uint64_t X, QualType T) { |
100 | 100 |
101 unsigned bits = Ctx.getTypeSize(T); | 101 unsigned bits = Ctx.getTypeSize(T); |
102 llvm::APSInt V(bits, T->isUnsignedIntegerType() || Loc::IsLocType(T)); | 102 llvm::APSInt V(bits, T->isUnsignedIntegerType() || Loc::isLocType(T)); |
103 V = X; | 103 V = X; |
104 return getValue(V); | 104 return getValue(V); |
105 } | 105 } |
106 | 106 |
107 const CompoundValData* | 107 const CompoundValData* |
108 BasicValueFactory::getCompoundValData(QualType T, | 108 BasicValueFactory::getCompoundValData(QualType T, |
109 llvm::ImmutableList<SVal> Vals) { | 109 llvm::ImmutableList<SVal> Vals) { |
110 | 110 |
111 llvm::FoldingSetNodeID ID; | 111 llvm::FoldingSetNodeID ID; |
112 CompoundValData::Profile(ID, T, Vals); | 112 CompoundValData::Profile(ID, T, Vals); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 new (P) FoldNodeTy(std::make_pair(V1, V2)); | 279 new (P) FoldNodeTy(std::make_pair(V1, V2)); |
280 Map.InsertNode(P, InsertPos); | 280 Map.InsertNode(P, InsertPos); |
281 } | 281 } |
282 | 282 |
283 return P->getValue(); | 283 return P->getValue(); |
284 } | 284 } |
285 | 285 |
286 const SVal* BasicValueFactory::getPersistentSVal(SVal X) { | 286 const SVal* BasicValueFactory::getPersistentSVal(SVal X) { |
287 return &getPersistentSValWithData(X, 0).first; | 287 return &getPersistentSValWithData(X, 0).first; |
288 } | 288 } |
289 | |
290 | |
OLD | NEW |