LCOV - code coverage report
Current view: top level - build-llvm/lib/Target/BPF - BPFGenCallingConv.inc (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 16 20 80.0 %
Date: 2017-09-14 15:23:50 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
       2             : |*                                                                            *|
       3             : |* Calling Convention Implementation Fragment                                 *|
       4             : |*                                                                            *|
       5             : |* Automatically generated file, do not edit!                                 *|
       6             : |*                                                                            *|
       7             : \*===----------------------------------------------------------------------===*/
       8             : 
       9             : static bool CC_BPF64(unsigned ValNo, MVT ValVT,
      10             :                      MVT LocVT, CCValAssign::LocInfo LocInfo,
      11             :                      ISD::ArgFlagsTy ArgFlags, CCState &State);
      12             : static bool RetCC_BPF64(unsigned ValNo, MVT ValVT,
      13             :                         MVT LocVT, CCValAssign::LocInfo LocInfo,
      14             :                         ISD::ArgFlagsTy ArgFlags, CCState &State);
      15             : 
      16             : 
      17         319 : static bool CC_BPF64(unsigned ValNo, MVT ValVT,
      18             :                      MVT LocVT, CCValAssign::LocInfo LocInfo,
      19             :                      ISD::ArgFlagsTy ArgFlags, CCState &State) {
      20             : 
      21         638 :   if (LocVT == MVT::i8 ||
      22         638 :       LocVT == MVT::i16 ||
      23         319 :       LocVT == MVT::i32) {
      24           0 :     LocVT = MVT::i64;
      25           0 :     if (ArgFlags.isSExt())
      26             :         LocInfo = CCValAssign::SExt;
      27           0 :     else if (ArgFlags.isZExt())
      28             :         LocInfo = CCValAssign::ZExt;
      29             :     else
      30           0 :         LocInfo = CCValAssign::AExt;
      31             :   }
      32             : 
      33         319 :   if (LocVT == MVT::i64) {
      34             :     static const MCPhysReg RegList1[] = {
      35             :       BPF::R1, BPF::R2, BPF::R3, BPF::R4, BPF::R5
      36             :     };
      37         319 :     if (unsigned Reg = State.AllocateReg(RegList1)) {
      38         634 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
      39         317 :       return false;
      40             :     }
      41             :   }
      42             : 
      43           2 :   unsigned Offset2 = State.AllocateStack(8, 8);
      44           4 :   State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset2, LocVT, LocInfo));
      45           2 :   return false;
      46             : 
      47             :   return true;  // CC didn't match.
      48             : }
      49             : 
      50             : 
      51         130 : static bool RetCC_BPF64(unsigned ValNo, MVT ValVT,
      52             :                         MVT LocVT, CCValAssign::LocInfo LocInfo,
      53             :                         ISD::ArgFlagsTy ArgFlags, CCState &State) {
      54             : 
      55         260 :   if (LocVT == MVT::i64) {
      56         130 :     if (unsigned Reg = State.AllocateReg(BPF::R0)) {
      57         260 :       State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
      58         130 :       return false;
      59             :     }
      60             :   }
      61             : 
      62             :   return true;  // CC didn't match.
      63             : }

Generated by: LCOV version 1.13