RangeConstraintManager.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. //== RangeConstraintManager.cpp - Manage range constraints.------*- C++ -*--==//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // This file defines RangeConstraintManager, a class that tracks simple
  11. // equality and inequality constraints on symbolic values of ProgramState.
  12. //
  13. //===----------------------------------------------------------------------===//
  14. #include "SimpleConstraintManager.h"
  15. #include "clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h"
  16. #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
  17. #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
  18. #include "llvm/Support/Debug.h"
  19. #include "llvm/ADT/FoldingSet.h"
  20. #include "llvm/ADT/ImmutableSet.h"
  21. #include "llvm/Support/raw_ostream.h"
  22. using namespace clang;
  23. using namespace ento;
  24. namespace { class ConstraintRange {}; }
  25. static int ConstraintRangeIndex = 0;
  26. /// A Range represents the closed range [from, to]. The caller must
  27. /// guarantee that from <= to. Note that Range is immutable, so as not
  28. /// to subvert RangeSet's immutability.
  29. namespace {
  30. class Range : public std::pair<const llvm::APSInt*,
  31. const llvm::APSInt*> {
  32. public:
  33. Range(const llvm::APSInt &from, const llvm::APSInt &to)
  34. : std::pair<const llvm::APSInt*, const llvm::APSInt*>(&from, &to) {
  35. assert(from <= to);
  36. }
  37. bool Includes(const llvm::APSInt &v) const {
  38. return *first <= v && v <= *second;
  39. }
  40. const llvm::APSInt &From() const {
  41. return *first;
  42. }
  43. const llvm::APSInt &To() const {
  44. return *second;
  45. }
  46. const llvm::APSInt *getConcreteValue() const {
  47. return &From() == &To() ? &From() : NULL;
  48. }
  49. void Profile(llvm::FoldingSetNodeID &ID) const {
  50. ID.AddPointer(&From());
  51. ID.AddPointer(&To());
  52. }
  53. };
  54. class RangeTrait : public llvm::ImutContainerInfo<Range> {
  55. public:
  56. // When comparing if one Range is less than another, we should compare
  57. // the actual APSInt values instead of their pointers. This keeps the order
  58. // consistent (instead of comparing by pointer values) and can potentially
  59. // be used to speed up some of the operations in RangeSet.
  60. static inline bool isLess(key_type_ref lhs, key_type_ref rhs) {
  61. return *lhs.first < *rhs.first || (!(*rhs.first < *lhs.first) &&
  62. *lhs.second < *rhs.second);
  63. }
  64. };
  65. /// RangeSet contains a set of ranges. If the set is empty, then
  66. /// there the value of a symbol is overly constrained and there are no
  67. /// possible values for that symbol.
  68. class RangeSet {
  69. typedef llvm::ImmutableSet<Range, RangeTrait> PrimRangeSet;
  70. PrimRangeSet ranges; // no need to make const, since it is an
  71. // ImmutableSet - this allows default operator=
  72. // to work.
  73. public:
  74. typedef PrimRangeSet::Factory Factory;
  75. typedef PrimRangeSet::iterator iterator;
  76. RangeSet(PrimRangeSet RS) : ranges(RS) {}
  77. iterator begin() const { return ranges.begin(); }
  78. iterator end() const { return ranges.end(); }
  79. bool isEmpty() const { return ranges.isEmpty(); }
  80. /// Construct a new RangeSet representing '{ [from, to] }'.
  81. RangeSet(Factory &F, const llvm::APSInt &from, const llvm::APSInt &to)
  82. : ranges(F.add(F.getEmptySet(), Range(from, to))) {}
  83. /// Profile - Generates a hash profile of this RangeSet for use
  84. /// by FoldingSet.
  85. void Profile(llvm::FoldingSetNodeID &ID) const { ranges.Profile(ID); }
  86. /// getConcreteValue - If a symbol is contrained to equal a specific integer
  87. /// constant then this method returns that value. Otherwise, it returns
  88. /// NULL.
  89. const llvm::APSInt* getConcreteValue() const {
  90. return ranges.isSingleton() ? ranges.begin()->getConcreteValue() : 0;
  91. }
  92. private:
  93. void IntersectInRange(BasicValueFactory &BV, Factory &F,
  94. const llvm::APSInt &Lower,
  95. const llvm::APSInt &Upper,
  96. PrimRangeSet &newRanges,
  97. PrimRangeSet::iterator &i,
  98. PrimRangeSet::iterator &e) const {
  99. // There are six cases for each range R in the set:
  100. // 1. R is entirely before the intersection range.
  101. // 2. R is entirely after the intersection range.
  102. // 3. R contains the entire intersection range.
  103. // 4. R starts before the intersection range and ends in the middle.
  104. // 5. R starts in the middle of the intersection range and ends after it.
  105. // 6. R is entirely contained in the intersection range.
  106. // These correspond to each of the conditions below.
  107. for (/* i = begin(), e = end() */; i != e; ++i) {
  108. if (i->To() < Lower) {
  109. continue;
  110. }
  111. if (i->From() > Upper) {
  112. break;
  113. }
  114. if (i->Includes(Lower)) {
  115. if (i->Includes(Upper)) {
  116. newRanges = F.add(newRanges, Range(BV.getValue(Lower),
  117. BV.getValue(Upper)));
  118. break;
  119. } else
  120. newRanges = F.add(newRanges, Range(BV.getValue(Lower), i->To()));
  121. } else {
  122. if (i->Includes(Upper)) {
  123. newRanges = F.add(newRanges, Range(i->From(), BV.getValue(Upper)));
  124. break;
  125. } else
  126. newRanges = F.add(newRanges, *i);
  127. }
  128. }
  129. }
  130. const llvm::APSInt &getMinValue() const {
  131. assert(!isEmpty());
  132. return ranges.begin()->From();
  133. }
  134. bool pin(llvm::APSInt &Lower, llvm::APSInt &Upper) const {
  135. // This function has nine cases, the cartesian product of range-testing
  136. // both the upper and lower bounds against the symbol's type.
  137. // Each case requires a different pinning operation.
  138. // The function returns false if the described range is entirely outside
  139. // the range of values for the associated symbol.
  140. APSIntType Type(getMinValue());
  141. APSIntType::RangeTestResultKind LowerTest = Type.testInRange(Lower);
  142. APSIntType::RangeTestResultKind UpperTest = Type.testInRange(Upper);
  143. switch (LowerTest) {
  144. case APSIntType::RTR_Below:
  145. switch (UpperTest) {
  146. case APSIntType::RTR_Below:
  147. // The entire range is outside the symbol's set of possible values.
  148. // If this is a conventionally-ordered range, the state is infeasible.
  149. if (Lower < Upper)
  150. return false;
  151. // However, if the range wraps around, it spans all possible values.
  152. Lower = Type.getMinValue();
  153. Upper = Type.getMaxValue();
  154. break;
  155. case APSIntType::RTR_Within:
  156. // The range starts below what's possible but ends within it. Pin.
  157. Lower = Type.getMinValue();
  158. Type.apply(Upper);
  159. break;
  160. case APSIntType::RTR_Above:
  161. // The range spans all possible values for the symbol. Pin.
  162. Lower = Type.getMinValue();
  163. Upper = Type.getMaxValue();
  164. break;
  165. }
  166. break;
  167. case APSIntType::RTR_Within:
  168. switch (UpperTest) {
  169. case APSIntType::RTR_Below:
  170. // The range wraps around, but all lower values are not possible.
  171. Type.apply(Lower);
  172. Upper = Type.getMaxValue();
  173. break;
  174. case APSIntType::RTR_Within:
  175. // The range may or may not wrap around, but both limits are valid.
  176. Type.apply(Lower);
  177. Type.apply(Upper);
  178. break;
  179. case APSIntType::RTR_Above:
  180. // The range starts within what's possible but ends above it. Pin.
  181. Type.apply(Lower);
  182. Upper = Type.getMaxValue();
  183. break;
  184. }
  185. break;
  186. case APSIntType::RTR_Above:
  187. switch (UpperTest) {
  188. case APSIntType::RTR_Below:
  189. // The range wraps but is outside the symbol's set of possible values.
  190. return false;
  191. case APSIntType::RTR_Within:
  192. // The range starts above what's possible but ends within it (wrap).
  193. Lower = Type.getMinValue();
  194. Type.apply(Upper);
  195. break;
  196. case APSIntType::RTR_Above:
  197. // The entire range is outside the symbol's set of possible values.
  198. // If this is a conventionally-ordered range, the state is infeasible.
  199. if (Lower < Upper)
  200. return false;
  201. // However, if the range wraps around, it spans all possible values.
  202. Lower = Type.getMinValue();
  203. Upper = Type.getMaxValue();
  204. break;
  205. }
  206. break;
  207. }
  208. return true;
  209. }
  210. public:
  211. // Returns a set containing the values in the receiving set, intersected with
  212. // the closed range [Lower, Upper]. Unlike the Range type, this range uses
  213. // modular arithmetic, corresponding to the common treatment of C integer
  214. // overflow. Thus, if the Lower bound is greater than the Upper bound, the
  215. // range is taken to wrap around. This is equivalent to taking the
  216. // intersection with the two ranges [Min, Upper] and [Lower, Max],
  217. // or, alternatively, /removing/ all integers between Upper and Lower.
  218. RangeSet Intersect(BasicValueFactory &BV, Factory &F,
  219. llvm::APSInt Lower, llvm::APSInt Upper) const {
  220. if (!pin(Lower, Upper))
  221. return F.getEmptySet();
  222. PrimRangeSet newRanges = F.getEmptySet();
  223. PrimRangeSet::iterator i = begin(), e = end();
  224. if (Lower <= Upper)
  225. IntersectInRange(BV, F, Lower, Upper, newRanges, i, e);
  226. else {
  227. // The order of the next two statements is important!
  228. // IntersectInRange() does not reset the iteration state for i and e.
  229. // Therefore, the lower range most be handled first.
  230. IntersectInRange(BV, F, BV.getMinValue(Upper), Upper, newRanges, i, e);
  231. IntersectInRange(BV, F, Lower, BV.getMaxValue(Lower), newRanges, i, e);
  232. }
  233. return newRanges;
  234. }
  235. void print(raw_ostream &os) const {
  236. bool isFirst = true;
  237. os << "{ ";
  238. for (iterator i = begin(), e = end(); i != e; ++i) {
  239. if (isFirst)
  240. isFirst = false;
  241. else
  242. os << ", ";
  243. os << '[' << i->From().toString(10) << ", " << i->To().toString(10)
  244. << ']';
  245. }
  246. os << " }";
  247. }
  248. bool operator==(const RangeSet &other) const {
  249. return ranges == other.ranges;
  250. }
  251. };
  252. } // end anonymous namespace
  253. typedef llvm::ImmutableMap<SymbolRef,RangeSet> ConstraintRangeTy;
  254. namespace clang {
  255. namespace ento {
  256. template<>
  257. struct ProgramStateTrait<ConstraintRange>
  258. : public ProgramStatePartialTrait<ConstraintRangeTy> {
  259. static inline void *GDMIndex() { return &ConstraintRangeIndex; }
  260. };
  261. }
  262. }
  263. namespace {
  264. class RangeConstraintManager : public SimpleConstraintManager{
  265. RangeSet GetRange(ProgramStateRef state, SymbolRef sym);
  266. public:
  267. RangeConstraintManager(SubEngine &subengine, BasicValueFactory &BVF)
  268. : SimpleConstraintManager(subengine, BVF) {}
  269. ProgramStateRef assumeSymNE(ProgramStateRef state, SymbolRef sym,
  270. const llvm::APSInt& Int,
  271. const llvm::APSInt& Adjustment);
  272. ProgramStateRef assumeSymEQ(ProgramStateRef state, SymbolRef sym,
  273. const llvm::APSInt& Int,
  274. const llvm::APSInt& Adjustment);
  275. ProgramStateRef assumeSymLT(ProgramStateRef state, SymbolRef sym,
  276. const llvm::APSInt& Int,
  277. const llvm::APSInt& Adjustment);
  278. ProgramStateRef assumeSymGT(ProgramStateRef state, SymbolRef sym,
  279. const llvm::APSInt& Int,
  280. const llvm::APSInt& Adjustment);
  281. ProgramStateRef assumeSymGE(ProgramStateRef state, SymbolRef sym,
  282. const llvm::APSInt& Int,
  283. const llvm::APSInt& Adjustment);
  284. ProgramStateRef assumeSymLE(ProgramStateRef state, SymbolRef sym,
  285. const llvm::APSInt& Int,
  286. const llvm::APSInt& Adjustment);
  287. const llvm::APSInt* getSymVal(ProgramStateRef St, SymbolRef sym) const;
  288. ProgramStateRef removeDeadBindings(ProgramStateRef St, SymbolReaper& SymReaper);
  289. void print(ProgramStateRef St, raw_ostream &Out,
  290. const char* nl, const char *sep);
  291. private:
  292. RangeSet::Factory F;
  293. };
  294. } // end anonymous namespace
  295. ConstraintManager *
  296. ento::CreateRangeConstraintManager(ProgramStateManager &StMgr, SubEngine &Eng) {
  297. return new RangeConstraintManager(Eng, StMgr.getBasicVals());
  298. }
  299. const llvm::APSInt* RangeConstraintManager::getSymVal(ProgramStateRef St,
  300. SymbolRef sym) const {
  301. const ConstraintRangeTy::data_type *T = St->get<ConstraintRange>(sym);
  302. return T ? T->getConcreteValue() : NULL;
  303. }
  304. /// Scan all symbols referenced by the constraints. If the symbol is not alive
  305. /// as marked in LSymbols, mark it as dead in DSymbols.
  306. ProgramStateRef
  307. RangeConstraintManager::removeDeadBindings(ProgramStateRef state,
  308. SymbolReaper& SymReaper) {
  309. ConstraintRangeTy CR = state->get<ConstraintRange>();
  310. ConstraintRangeTy::Factory& CRFactory = state->get_context<ConstraintRange>();
  311. for (ConstraintRangeTy::iterator I = CR.begin(), E = CR.end(); I != E; ++I) {
  312. SymbolRef sym = I.getKey();
  313. if (SymReaper.maybeDead(sym))
  314. CR = CRFactory.remove(CR, sym);
  315. }
  316. return state->set<ConstraintRange>(CR);
  317. }
  318. RangeSet
  319. RangeConstraintManager::GetRange(ProgramStateRef state, SymbolRef sym) {
  320. if (ConstraintRangeTy::data_type* V = state->get<ConstraintRange>(sym))
  321. return *V;
  322. // Lazily generate a new RangeSet representing all possible values for the
  323. // given symbol type.
  324. BasicValueFactory &BV = getBasicVals();
  325. QualType T = sym->getType();
  326. RangeSet Result(F, BV.getMinValue(T), BV.getMaxValue(T));
  327. // Special case: references are known to be non-zero.
  328. if (T->isReferenceType()) {
  329. APSIntType IntType = BV.getAPSIntType(T);
  330. Result = Result.Intersect(BV, F, ++IntType.getZeroValue(),
  331. --IntType.getZeroValue());
  332. }
  333. return Result;
  334. }
  335. //===------------------------------------------------------------------------===
  336. // assumeSymX methods: public interface for RangeConstraintManager.
  337. //===------------------------------------------------------------------------===/
  338. // The syntax for ranges below is mathematical, using [x, y] for closed ranges
  339. // and (x, y) for open ranges. These ranges are modular, corresponding with
  340. // a common treatment of C integer overflow. This means that these methods
  341. // do not have to worry about overflow; RangeSet::Intersect can handle such a
  342. // "wraparound" range.
  343. // As an example, the range [UINT_MAX-1, 3) contains five values: UINT_MAX-1,
  344. // UINT_MAX, 0, 1, and 2.
  345. ProgramStateRef
  346. RangeConstraintManager::assumeSymNE(ProgramStateRef St, SymbolRef Sym,
  347. const llvm::APSInt &Int,
  348. const llvm::APSInt &Adjustment) {
  349. // Before we do any real work, see if the value can even show up.
  350. APSIntType AdjustmentType(Adjustment);
  351. if (AdjustmentType.testInRange(Int) != APSIntType::RTR_Within)
  352. return St;
  353. llvm::APSInt Lower = AdjustmentType.convert(Int) - Adjustment;
  354. llvm::APSInt Upper = Lower;
  355. --Lower;
  356. ++Upper;
  357. // [Int-Adjustment+1, Int-Adjustment-1]
  358. // Notice that the lower bound is greater than the upper bound.
  359. RangeSet New = GetRange(St, Sym).Intersect(getBasicVals(), F, Upper, Lower);
  360. return New.isEmpty() ? NULL : St->set<ConstraintRange>(Sym, New);
  361. }
  362. ProgramStateRef
  363. RangeConstraintManager::assumeSymEQ(ProgramStateRef St, SymbolRef Sym,
  364. const llvm::APSInt &Int,
  365. const llvm::APSInt &Adjustment) {
  366. // Before we do any real work, see if the value can even show up.
  367. APSIntType AdjustmentType(Adjustment);
  368. if (AdjustmentType.testInRange(Int) != APSIntType::RTR_Within)
  369. return NULL;
  370. // [Int-Adjustment, Int-Adjustment]
  371. llvm::APSInt AdjInt = AdjustmentType.convert(Int) - Adjustment;
  372. RangeSet New = GetRange(St, Sym).Intersect(getBasicVals(), F, AdjInt, AdjInt);
  373. return New.isEmpty() ? NULL : St->set<ConstraintRange>(Sym, New);
  374. }
  375. ProgramStateRef
  376. RangeConstraintManager::assumeSymLT(ProgramStateRef St, SymbolRef Sym,
  377. const llvm::APSInt &Int,
  378. const llvm::APSInt &Adjustment) {
  379. // Before we do any real work, see if the value can even show up.
  380. APSIntType AdjustmentType(Adjustment);
  381. switch (AdjustmentType.testInRange(Int)) {
  382. case APSIntType::RTR_Below:
  383. return NULL;
  384. case APSIntType::RTR_Within:
  385. break;
  386. case APSIntType::RTR_Above:
  387. return St;
  388. }
  389. // Special case for Int == Min. This is always false.
  390. llvm::APSInt ComparisonVal = AdjustmentType.convert(Int);
  391. llvm::APSInt Min = AdjustmentType.getMinValue();
  392. if (ComparisonVal == Min)
  393. return NULL;
  394. llvm::APSInt Lower = Min-Adjustment;
  395. llvm::APSInt Upper = ComparisonVal-Adjustment;
  396. --Upper;
  397. RangeSet New = GetRange(St, Sym).Intersect(getBasicVals(), F, Lower, Upper);
  398. return New.isEmpty() ? NULL : St->set<ConstraintRange>(Sym, New);
  399. }
  400. ProgramStateRef
  401. RangeConstraintManager::assumeSymGT(ProgramStateRef St, SymbolRef Sym,
  402. const llvm::APSInt &Int,
  403. const llvm::APSInt &Adjustment) {
  404. // Before we do any real work, see if the value can even show up.
  405. APSIntType AdjustmentType(Adjustment);
  406. switch (AdjustmentType.testInRange(Int)) {
  407. case APSIntType::RTR_Below:
  408. return St;
  409. case APSIntType::RTR_Within:
  410. break;
  411. case APSIntType::RTR_Above:
  412. return NULL;
  413. }
  414. // Special case for Int == Max. This is always false.
  415. llvm::APSInt ComparisonVal = AdjustmentType.convert(Int);
  416. llvm::APSInt Max = AdjustmentType.getMaxValue();
  417. if (ComparisonVal == Max)
  418. return NULL;
  419. llvm::APSInt Lower = ComparisonVal-Adjustment;
  420. llvm::APSInt Upper = Max-Adjustment;
  421. ++Lower;
  422. RangeSet New = GetRange(St, Sym).Intersect(getBasicVals(), F, Lower, Upper);
  423. return New.isEmpty() ? NULL : St->set<ConstraintRange>(Sym, New);
  424. }
  425. ProgramStateRef
  426. RangeConstraintManager::assumeSymGE(ProgramStateRef St, SymbolRef Sym,
  427. const llvm::APSInt &Int,
  428. const llvm::APSInt &Adjustment) {
  429. // Before we do any real work, see if the value can even show up.
  430. APSIntType AdjustmentType(Adjustment);
  431. switch (AdjustmentType.testInRange(Int)) {
  432. case APSIntType::RTR_Below:
  433. return St;
  434. case APSIntType::RTR_Within:
  435. break;
  436. case APSIntType::RTR_Above:
  437. return NULL;
  438. }
  439. // Special case for Int == Min. This is always feasible.
  440. llvm::APSInt ComparisonVal = AdjustmentType.convert(Int);
  441. llvm::APSInt Min = AdjustmentType.getMinValue();
  442. if (ComparisonVal == Min)
  443. return St;
  444. llvm::APSInt Max = AdjustmentType.getMaxValue();
  445. llvm::APSInt Lower = ComparisonVal-Adjustment;
  446. llvm::APSInt Upper = Max-Adjustment;
  447. RangeSet New = GetRange(St, Sym).Intersect(getBasicVals(), F, Lower, Upper);
  448. return New.isEmpty() ? NULL : St->set<ConstraintRange>(Sym, New);
  449. }
  450. ProgramStateRef
  451. RangeConstraintManager::assumeSymLE(ProgramStateRef St, SymbolRef Sym,
  452. const llvm::APSInt &Int,
  453. const llvm::APSInt &Adjustment) {
  454. // Before we do any real work, see if the value can even show up.
  455. APSIntType AdjustmentType(Adjustment);
  456. switch (AdjustmentType.testInRange(Int)) {
  457. case APSIntType::RTR_Below:
  458. return NULL;
  459. case APSIntType::RTR_Within:
  460. break;
  461. case APSIntType::RTR_Above:
  462. return St;
  463. }
  464. // Special case for Int == Max. This is always feasible.
  465. llvm::APSInt ComparisonVal = AdjustmentType.convert(Int);
  466. llvm::APSInt Max = AdjustmentType.getMaxValue();
  467. if (ComparisonVal == Max)
  468. return St;
  469. llvm::APSInt Min = AdjustmentType.getMinValue();
  470. llvm::APSInt Lower = Min-Adjustment;
  471. llvm::APSInt Upper = ComparisonVal-Adjustment;
  472. RangeSet New = GetRange(St, Sym).Intersect(getBasicVals(), F, Lower, Upper);
  473. return New.isEmpty() ? NULL : St->set<ConstraintRange>(Sym, New);
  474. }
  475. //===------------------------------------------------------------------------===
  476. // Pretty-printing.
  477. //===------------------------------------------------------------------------===/
  478. void RangeConstraintManager::print(ProgramStateRef St, raw_ostream &Out,
  479. const char* nl, const char *sep) {
  480. ConstraintRangeTy Ranges = St->get<ConstraintRange>();
  481. if (Ranges.isEmpty()) {
  482. Out << nl << sep << "Ranges are empty." << nl;
  483. return;
  484. }
  485. Out << nl << sep << "Ranges of symbol values:";
  486. for (ConstraintRangeTy::iterator I=Ranges.begin(), E=Ranges.end(); I!=E; ++I){
  487. Out << nl << ' ' << I.getKey() << " : ";
  488. I.getData().print(Out);
  489. }
  490. Out << nl;
  491. }