clang
22.0.0git
lib
CodeGen
LinkInModulesPass.cpp
Go to the documentation of this file.
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) : BC(BC) {}
20
21
PreservedAnalyses
LinkInModulesPass::run
(Module &M, ModuleAnalysisManager &AM) {
22
if
(!BC)
23
return
PreservedAnalyses::all();
24
25
if
(BC->LinkInModules(&M))
26
report_fatal_error(
"Bitcode module postopt linking failed, aborted!"
);
27
28
return
PreservedAnalyses::none();
29
}
BackendConsumer.h
LinkInModulesPass.h
This file provides a pass to link in Modules from a provided BackendConsumer.
clang::BackendConsumer
Definition
BackendConsumer.h:27
llvm::LinkInModulesPass::run
PreservedAnalyses run(Module &M, AnalysisManager< Module > &)
Definition
LinkInModulesPass.cpp:21
llvm::LinkInModulesPass::LinkInModulesPass
LinkInModulesPass(clang::BackendConsumer *BC)
Definition
LinkInModulesPass.cpp:19
llvm
Diagnostic wrappers for TextAPI types for error reporting.
Definition
Dominators.h:30
Generated on
for clang by
1.14.0