Coverage Report

Created: 2024-01-17 10:31

/src/llvm-project/clang/lib/CodeGen/LinkInModulesPass.cpp
Line
Count
Source (jump to first uncovered line)
1
//===-- LinkInModulesPass.cpp - Module Linking pass --------------- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
/// \file
9
///
10
/// LinkInModulesPass implementation.
11
///
12
//===----------------------------------------------------------------------===//
13
14
#include "LinkInModulesPass.h"
15
#include "BackendConsumer.h"
16
17
using namespace llvm;
18
19
LinkInModulesPass::LinkInModulesPass(clang::BackendConsumer *BC,
20
                                     bool ShouldLinkFiles)
21
0
    : BC(BC), ShouldLinkFiles(ShouldLinkFiles) {}
22
23
0
PreservedAnalyses LinkInModulesPass::run(Module &M, ModuleAnalysisManager &AM) {
24
25
0
  if (BC && BC->LinkInModules(&M, ShouldLinkFiles))
26
0
    report_fatal_error("Bitcode module linking failed, compilation aborted!");
27
28
0
  return PreservedAnalyses::all();
29
0
}