LCOV - code coverage report
Current view: top level - include/llvm/DebugInfo/CodeView - SymbolVisitorCallbackPipeline.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 15 23 65.2 %
Date: 2017-09-14 15:23:50 Functions: 3 6 50.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- SymbolVisitorCallbackPipeline.h --------------------------*- 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             : #ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLVISITORCALLBACKPIPELINE_H
      11             : #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLVISITORCALLBACKPIPELINE_H
      12             : 
      13             : #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
      14             : #include "llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h"
      15             : #include "llvm/Support/Error.h"
      16             : #include <vector>
      17             : 
      18             : namespace llvm {
      19             : namespace codeview {
      20             : 
      21         626 : class SymbolVisitorCallbackPipeline : public SymbolVisitorCallbacks {
      22             : public:
      23         626 :   SymbolVisitorCallbackPipeline() = default;
      24             : 
      25           0 :   Error visitUnknownSymbol(CVSymbol &Record) override {
      26           0 :     for (auto Visitor : Pipeline) {
      27           0 :       if (auto EC = Visitor->visitUnknownSymbol(Record))
      28           0 :         return EC;
      29             :     }
      30           0 :     return Error::success();
      31             :   }
      32             : 
      33         218 :   Error visitSymbolBegin(CVSymbol &Record, uint32_t Offset) override {
      34        1308 :     for (auto Visitor : Pipeline) {
      35        1308 :       if (auto EC = Visitor->visitSymbolBegin(Record, Offset))
      36           0 :         return EC;
      37             :     }
      38         654 :     return Error::success();
      39             :   }
      40             : 
      41         909 :   Error visitSymbolBegin(CVSymbol &Record) override {
      42        5454 :     for (auto Visitor : Pipeline) {
      43        5454 :       if (auto EC = Visitor->visitSymbolBegin(Record))
      44           0 :         return EC;
      45             :     }
      46        2727 :     return Error::success();
      47             :   }
      48             : 
      49        1127 :   Error visitSymbolEnd(CVSymbol &Record) override {
      50        6762 :     for (auto Visitor : Pipeline) {
      51        6762 :       if (auto EC = Visitor->visitSymbolEnd(Record))
      52           0 :         return EC;
      53             :     }
      54        3381 :     return Error::success();
      55             :   }
      56             : 
      57             :   void addCallbackToPipeline(SymbolVisitorCallbacks &Callbacks) {
      58        1252 :     Pipeline.push_back(&Callbacks);
      59             :   }
      60             : 
      61             : #define SYMBOL_RECORD(EnumName, EnumVal, Name)                                 \
      62             :   Error visitKnownRecord(CVSymbol &CVR, Name &Record) override {               \
      63             :     for (auto Visitor : Pipeline) {                                            \
      64             :       if (auto EC = Visitor->visitKnownRecord(CVR, Record))                    \
      65             :         return EC;                                                             \
      66             :     }                                                                          \
      67             :     return Error::success();                                                   \
      68             :   }
      69             : #define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
      70             : #include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
      71             : 
      72             : private:
      73             :   std::vector<SymbolVisitorCallbacks *> Pipeline;
      74             : };
      75             : 
      76             : } // end namespace codeview
      77             : } // end namespace llvm
      78             : 
      79             : #endif // LLVM_DEBUGINFO_CODEVIEW_SYMBOLVISITORCALLBACKPIPELINE_H

Generated by: LCOV version 1.13