FunctionSummary.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. //== FunctionSummary.cpp - Stores summaries of functions. ----------*- 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 a summary of a function gathered/used by static analysis.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #include "clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h"
  14. using namespace clang;
  15. using namespace ento;
  16. unsigned FunctionSummariesTy::getTotalNumBasicBlocks() {
  17. unsigned Total = 0;
  18. for (MapTy::iterator I = Map.begin(), E = Map.end(); I != E; ++I) {
  19. Total += I->second.TotalBasicBlocks;
  20. }
  21. return Total;
  22. }
  23. unsigned FunctionSummariesTy::getTotalNumVisitedBasicBlocks() {
  24. unsigned Total = 0;
  25. for (MapTy::iterator I = Map.begin(), E = Map.end(); I != E; ++I) {
  26. Total += I->second.VisitedBasicBlocks.count();
  27. }
  28. return Total;
  29. }