LCOV - code coverage report
Current view: top level - include/llvm/DebugInfo/PDB/Raw - ModInfo.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 8 9 88.9 %
Date: 2017-01-24 23:09:07 Functions: 5 5 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- ModInfo.h - PDB module information -----------------------*- 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_PDB_RAW_MODINFO_H
      11             : #define LLVM_DEBUGINFO_PDB_RAW_MODINFO_H
      12             : 
      13             : #include "llvm/ADT/StringRef.h"
      14             : #include "llvm/DebugInfo/MSF/StreamArray.h"
      15             : #include "llvm/DebugInfo/MSF/StreamRef.h"
      16             : #include "llvm/DebugInfo/PDB/Raw/RawTypes.h"
      17             : #include "llvm/Support/Error.h"
      18             : #include <cstdint>
      19             : #include <vector>
      20             : 
      21             : namespace llvm {
      22             : 
      23             : namespace pdb {
      24             : 
      25         350 : class ModInfo {
      26             :   friend class DbiStreamBuilder;
      27             : 
      28             : public:
      29             :   ModInfo();
      30             :   ModInfo(const ModInfo &Info);
      31             :   ~ModInfo();
      32             : 
      33             :   static Error initialize(msf::ReadableStreamRef Stream, ModInfo &Info);
      34             : 
      35             :   bool hasECInfo() const;
      36             :   uint16_t getTypeServerIndex() const;
      37             :   uint16_t getModuleStreamIndex() const;
      38             :   uint32_t getSymbolDebugInfoByteSize() const;
      39             :   uint32_t getLineInfoByteSize() const;
      40             :   uint32_t getC13LineInfoByteSize() const;
      41             :   uint32_t getNumberOfFiles() const;
      42             :   uint32_t getSourceFileNameIndex() const;
      43             :   uint32_t getPdbFilePathNameIndex() const;
      44             : 
      45             :   StringRef getModuleName() const;
      46             :   StringRef getObjFileName() const;
      47             : 
      48             :   uint32_t getRecordLength() const;
      49             : 
      50             : private:
      51             :   StringRef ModuleName;
      52             :   StringRef ObjFileName;
      53             :   const ModuleInfoHeader *Layout = nullptr;
      54             : };
      55             : 
      56         268 : struct ModuleInfoEx {
      57         130 :   ModuleInfoEx(const ModInfo &Info) : Info(Info) {}
      58          71 :   ModuleInfoEx(const ModuleInfoEx &Ex) = default;
      59             : 
      60             :   ModInfo Info;
      61             :   std::vector<StringRef> SourceFiles;
      62             : };
      63             : 
      64             : } // end namespace pdb
      65             : 
      66             : namespace msf {
      67             : 
      68             : template <> struct VarStreamArrayExtractor<pdb::ModInfo> {
      69          65 :   Error operator()(ReadableStreamRef Stream, uint32_t &Length,
      70             :                    pdb::ModInfo &Info) const {
      71         195 :     if (auto EC = pdb::ModInfo::initialize(Stream, Info))
      72           0 :       return EC;
      73          65 :     Length = Info.getRecordLength();
      74         195 :     return Error::success();
      75             :   }
      76             : };
      77             : 
      78             : } // end namespace msf
      79             : 
      80             : } // end namespace llvm
      81             : 
      82             : #endif // LLVM_DEBUGINFO_PDB_RAW_MODINFO_H

Generated by: LCOV version 1.13