LCOV - code coverage report
Current view: top level - lib/ExecutionEngine/Orc - IRTransformLayer.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 7 9 77.8 %
Date: 2018-10-20 13:21:21 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===-------------- IRTransformLayer.cpp - IR Transform Layer -------------===//
       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/ExecutionEngine/Orc/IRTransformLayer.h"
      11             : #include "llvm/Support/MemoryBuffer.h"
      12             : 
      13             : namespace llvm {
      14             : namespace orc {
      15             : 
      16          13 : IRTransformLayer::IRTransformLayer(ExecutionSession &ES,
      17             :                                      IRLayer &BaseLayer,
      18          13 :                                      TransformFunction Transform)
      19          13 :     : IRLayer(ES), BaseLayer(BaseLayer), Transform(std::move(Transform)) {}
      20             : 
      21          24 : void IRTransformLayer::emit(MaterializationResponsibility R,
      22             :                             ThreadSafeModule TSM) {
      23             :   assert(TSM.getModule() && "Module must not be null");
      24             : 
      25          72 :   if (auto TransformedTSM = Transform(std::move(TSM), R))
      26          48 :     BaseLayer.emit(std::move(R), std::move(*TransformedTSM));
      27             :   else {
      28           0 :     R.failMaterialization();
      29           0 :     getExecutionSession().reportError(TransformedTSM.takeError());
      30             :   }
      31          24 : }
      32             : 
      33             : } // End namespace orc.
      34             : } // End namespace llvm.

Generated by: LCOV version 1.13