LCOV - code coverage report
Current view: top level - include/llvm/ExecutionEngine/Orc - OrcError.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 1 2 50.0 %
Date: 2018-02-23 15:42:53 Functions: 1 4 25.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===------ OrcError.h - Reject symbol lookup requests ------*- 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             : //   Define an error category, error codes, and helper utilities for Orc.
      11             : //
      12             : //===----------------------------------------------------------------------===//
      13             : 
      14             : #ifndef LLVM_EXECUTIONENGINE_ORC_ORCERROR_H
      15             : #define LLVM_EXECUTIONENGINE_ORC_ORCERROR_H
      16             : 
      17             : #include "llvm/Support/Error.h"
      18             : #include <system_error>
      19             : 
      20             : namespace llvm {
      21             : namespace orc {
      22             : 
      23             : enum class OrcErrorCode : int {
      24             :   // RPC Errors
      25             :   DuplicateDefinition = 1,
      26             :   JITSymbolNotFound,
      27             :   RemoteAllocatorDoesNotExist,
      28             :   RemoteAllocatorIdAlreadyInUse,
      29             :   RemoteMProtectAddrUnrecognized,
      30             :   RemoteIndirectStubsOwnerDoesNotExist,
      31             :   RemoteIndirectStubsOwnerIdAlreadyInUse,
      32             :   RPCConnectionClosed,
      33             :   RPCCouldNotNegotiateFunction,
      34             :   RPCResponseAbandoned,
      35             :   UnexpectedRPCCall,
      36             :   UnexpectedRPCResponse,
      37             :   UnknownErrorCodeFromRemote,
      38             :   UnknownResourceHandle
      39             : };
      40             : 
      41             : std::error_code orcError(OrcErrorCode ErrCode);
      42             : 
      43           0 : class DuplicateDefinition : public ErrorInfo<DuplicateDefinition> {
      44             : public:
      45             :   static char ID;
      46             : 
      47             :   DuplicateDefinition(std::string SymbolName);
      48             :   std::error_code convertToErrorCode() const override;
      49             :   void log(raw_ostream &OS) const override;
      50             :   const std::string &getSymbolName() const;
      51             : private:
      52             :   std::string SymbolName;
      53             : };
      54             : 
      55           4 : class JITSymbolNotFound : public ErrorInfo<JITSymbolNotFound> {
      56             : public:
      57             :   static char ID;
      58             : 
      59             :   JITSymbolNotFound(std::string SymbolName);
      60             :   std::error_code convertToErrorCode() const override;
      61             :   void log(raw_ostream &OS) const override;
      62             :   const std::string &getSymbolName() const;
      63             : private:
      64             :   std::string SymbolName;
      65             : };
      66             : 
      67             : } // End namespace orc.
      68             : } // End namespace llvm.
      69             : 
      70             : #endif // LLVM_EXECUTIONENGINE_ORC_ORCERROR_H

Generated by: LCOV version 1.13