LCOV - code coverage report
Current view: top level - include/llvm/DebugInfo/CodeView - SymbolVisitorCallbackPipeline.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 12 15 80.0 %
Date: 2018-10-20 13:21:21 Functions: 3 4 75.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         470 : class SymbolVisitorCallbackPipeline : public SymbolVisitorCallbacks {
      22             : public:
      23         467 :   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             :         return EC;
      29             :     }
      30             :     return Error::success();
      31             :   }
      32             : 
      33         327 :   Error visitSymbolBegin(CVSymbol &Record, uint32_t Offset) override {
      34         981 :     for (auto Visitor : Pipeline) {
      35        1308 :       if (auto EC = Visitor->visitSymbolBegin(Record, Offset))
      36             :         return EC;
      37             :     }
      38             :     return Error::success();
      39             :   }
      40             : 
      41        1721 :   Error visitSymbolBegin(CVSymbol &Record) override {
      42        5163 :     for (auto Visitor : Pipeline) {
      43        6884 :       if (auto EC = Visitor->visitSymbolBegin(Record))
      44             :         return EC;
      45             :     }
      46             :     return Error::success();
      47             :   }
      48             : 
      49        2048 :   Error visitSymbolEnd(CVSymbol &Record) override {
      50        6144 :     for (auto Visitor : Pipeline) {
      51        8192 :       if (auto EC = Visitor->visitSymbolEnd(Record))
      52             :         return EC;
      53             :     }
      54             :     return Error::success();
      55             :   }
      56             : 
      57             :   void addCallbackToPipeline(SymbolVisitorCallbacks &Callbacks) {
      58         467 :     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