LCOV - code coverage report
Current view: top level - lib/Support - Options.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 8 8 100.0 %
Date: 2017-09-14 15:23:50 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- llvm/Support/Options.cpp - Debug options support ---------*- 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 implements the helper objects for defining debug options using the
      11             : // new API built on cl::opt, but not requiring the use of static globals.
      12             : //
      13             : //===----------------------------------------------------------------------===//
      14             : 
      15             : #include "llvm/Support/Options.h"
      16             : #include "llvm/Support/ManagedStatic.h"
      17             : 
      18             : using namespace llvm;
      19             : 
      20       76590 : OptionRegistry::~OptionRegistry() {
      21      127650 :   for (auto IT = Options.begin(); IT != Options.end(); ++IT)
      22       25530 :     delete IT->second;
      23       25530 : }
      24             : 
      25       25723 : void OptionRegistry::addOption(void *Key, cl::Option *O) {
      26             :   assert(Options.find(Key) == Options.end() &&
      27             :          "Argument with this key already registerd");
      28       77169 :   Options.insert(std::make_pair(Key, O));
      29       25723 : }
      30             : 
      31             : static ManagedStatic<OptionRegistry> OR;
      32             : 
      33       25731 : OptionRegistry &OptionRegistry::instance() { return *OR; }

Generated by: LCOV version 1.13