LCOV - code coverage report
Current view: top level - lib/CodeGen - MachinePassRegistry.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 13 22 59.1 %
Date: 2017-09-14 15:23:50 Functions: 2 4 50.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===-- CodeGen/MachineInstr.cpp ------------------------------------------===//
       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 contains the machine function pass registry for register allocators
      11             : // and instruction schedulers.
      12             : //
      13             : //===----------------------------------------------------------------------===//
      14             : 
      15             : #include "llvm/CodeGen/MachinePassRegistry.h"
      16             : 
      17             : using namespace llvm;
      18             : 
      19           0 : void MachinePassRegistryListener::anchor() { }
      20             : 
      21             : /// setDefault - Set the default constructor by name.
      22           0 : void MachinePassRegistry::setDefault(StringRef Name) {
      23           0 :   MachinePassCtor Ctor = nullptr;
      24           0 :   for(MachinePassRegistryNode *R = getList(); R; R = R->getNext()) {
      25           0 :     if (R->getName() == Name) {
      26           0 :       Ctor = R->getCtor();
      27           0 :       break;
      28             :     }
      29             :   }
      30             :   assert(Ctor && "Unregistered pass name");
      31           0 :   setDefault(Ctor);
      32           0 : }
      33             : 
      34             : /// Add - Adds a function pass to the registration list.
      35             : ///
      36     1663038 : void MachinePassRegistry::Add(MachinePassRegistryNode *Node) {
      37     3326076 :   Node->setNext(List);
      38     1663038 :   List = Node;
      39     2530710 :   if (Listener) Listener->NotifyAdd(Node->getName(),
      40             :                                     Node->getCtor(),
      41      867672 :                                     Node->getDescription());
      42     1663038 : }
      43             : 
      44             : 
      45             : /// Remove - Removes a function pass from the registration list.
      46             : ///
      47     1663038 : void MachinePassRegistry::Remove(MachinePassRegistryNode *Node) {
      48     1663038 :   for (MachinePassRegistryNode **I = &List; *I; I = (*I)->getNextAddress()) {
      49     1663038 :     if (*I == Node) {
      50     1663038 :       if (Listener) Listener->NotifyRemove(Node->getName());
      51     1663038 :       *I = (*I)->getNext();
      52     1663038 :       break;
      53             :     }
      54             :   }
      55     1663038 : }

Generated by: LCOV version 1.13