LCOV - code coverage report
Current view: top level - lib/DebugInfo/PDB - PDBSymbolCompiland.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 4 18 22.2 %
Date: 2017-09-14 15:23:50 Functions: 1 3 33.3 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- PDBSymbolCompiland.cpp - compiland details --------*- 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             : #include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h"
      11             : #include "llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h"
      12             : 
      13             : #include "llvm/DebugInfo/PDB/PDBSymDumper.h"
      14             : 
      15             : #include <utility>
      16             : 
      17             : using namespace llvm;
      18             : using namespace llvm::pdb;
      19             : 
      20          51 : PDBSymbolCompiland::PDBSymbolCompiland(const IPDBSession &PDBSession,
      21          51 :                                        std::unique_ptr<IPDBRawSymbol> Symbol)
      22         153 :     : PDBSymbol(PDBSession, std::move(Symbol)) {
      23             :   assert(RawSymbol->getSymTag() == PDB_SymType::Compiland);
      24          51 : }
      25             : 
      26           0 : void PDBSymbolCompiland::dump(PDBSymDumper &Dumper) const {
      27           0 :   Dumper.dump(*this);
      28           0 : }
      29             : 
      30           0 : std::string PDBSymbolCompiland::getSourceFileName() const
      31             : {
      32           0 :     std::string Result = RawSymbol->getSourceFileName();
      33           0 :     if (!Result.empty())
      34             :         return Result;
      35           0 :     auto Envs = findAllChildren<PDBSymbolCompilandEnv>();
      36           0 :     if (!Envs)
      37             :         return std::string();
      38           0 :     while (auto Env = Envs->getNext()) {
      39           0 :         std::string Var = Env->getName();
      40           0 :         if (Var != "src")
      41           0 :             continue;
      42           0 :         std::string Value = Env->getValue();
      43           0 :         return Value;
      44             :     }
      45             :     return std::string();
      46             : }

Generated by: LCOV version 1.13