LCOV - code coverage report
Current view: top level - lib/ExecutionEngine/RuntimeDyld - JITSymbol.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 21 22 95.5 %
Date: 2017-09-14 15:23:50 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===----------- JITSymbol.cpp - JITSymbol class implementation -----------===//
       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             : // JITSymbol class implementation plus helper functions.
      11             : //
      12             : //===----------------------------------------------------------------------===//
      13             : 
      14             : #include "llvm/ExecutionEngine/JITSymbol.h"
      15             : #include "llvm/IR/GlobalValue.h"
      16             : #include "llvm/Object/SymbolicFile.h"
      17             : 
      18             : using namespace llvm;
      19             : 
      20         119 : JITSymbolFlags llvm::JITSymbolFlags::fromGlobalValue(const GlobalValue &GV) {
      21         119 :   JITSymbolFlags Flags = JITSymbolFlags::None;
      22         236 :   if (GV.hasWeakLinkage() || GV.hasLinkOnceLinkage())
      23             :     Flags |= JITSymbolFlags::Weak;
      24         119 :   if (GV.hasCommonLinkage())
      25           0 :     Flags |= JITSymbolFlags::Common;
      26         236 :   if (!GV.hasLocalLinkage() && !GV.hasHiddenVisibility())
      27         114 :     Flags |= JITSymbolFlags::Exported;
      28         119 :   return Flags;
      29             : }
      30             : 
      31             : JITSymbolFlags
      32        2140 : llvm::JITSymbolFlags::fromObjectSymbol(const object::BasicSymbolRef &Symbol) {
      33        2140 :   JITSymbolFlags Flags = JITSymbolFlags::None;
      34        2140 :   if (Symbol.getFlags() & object::BasicSymbolRef::SF_Weak)
      35          16 :     Flags |= JITSymbolFlags::Weak;
      36        2140 :   if (Symbol.getFlags() & object::BasicSymbolRef::SF_Common)
      37          61 :     Flags |= JITSymbolFlags::Common;
      38        2140 :   if (Symbol.getFlags() & object::BasicSymbolRef::SF_Exported)
      39         803 :     Flags |= JITSymbolFlags::Exported;
      40        2140 :   return Flags;
      41             : }
      42             : 
      43          20 : ARMJITSymbolFlags llvm::ARMJITSymbolFlags::fromObjectSymbol(
      44             :                                          const object::BasicSymbolRef &Symbol) {
      45          20 :   ARMJITSymbolFlags Flags;
      46          20 :   if (Symbol.getFlags() & object::BasicSymbolRef::SF_Thumb)
      47           1 :     Flags |= ARMJITSymbolFlags::Thumb;
      48          20 :   return Flags;
      49             : }

Generated by: LCOV version 1.13