llvm.org GIT mirror llvm / 8a67f12
[Layering] Sink Linker.h into a Linker subdirectory to make it consistent with every other sub-library header in LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203065 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 5 years ago
9 changed file(s) with 68 addition(s) and 68 deletion(s). Raw diff Collapse all Expand all
3838 #include "llvm/ADT/ArrayRef.h"
3939 #include "llvm/ADT/SmallPtrSet.h"
4040 #include "llvm/ADT/StringMap.h"
41 #include "llvm/Linker.h"
41 #include "llvm/Linker/Linker.h"
4242 #include "llvm/Target/TargetOptions.h"
4343 #include
4444 #include
0 //===- Linker.h - Module Linker Interface -----------------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef LLVM_LINKER_LINKER_H
10 #define LLVM_LINKER_LINKER_H
11
12 #include "llvm/ADT/SmallPtrSet.h"
13 #include
14
15 namespace llvm {
16
17 class Module;
18 class StringRef;
19 class StructType;
20
21 /// This class provides the core functionality of linking in LLVM. It keeps a
22 /// pointer to the merged module so far. It doesn't take ownership of the
23 /// module since it is assumed that the user of this class will want to do
24 /// something with it after the linking.
25 class Linker {
26 public:
27 enum LinkerMode {
28 DestroySource = 0, // Allow source module to be destroyed.
29 PreserveSource = 1 // Preserve the source module.
30 };
31
32 Linker(Module *M, bool SuppressWarnings=false);
33 ~Linker();
34
35 Module *getModule() const { return Composite; }
36 void deleteModule();
37
38 /// \brief Link \p Src into the composite. The source is destroyed if
39 /// \p Mode is DestroySource and preserved if it is PreserveSource.
40 /// If \p ErrorMsg is not null, information about any error is written
41 /// to it.
42 /// Returns true on error.
43 bool linkInModule(Module *Src, unsigned Mode, std::string *ErrorMsg);
44 bool linkInModule(Module *Src, std::string *ErrorMsg) {
45 return linkInModule(Src, Linker::DestroySource, ErrorMsg);
46 }
47
48 static bool LinkModules(Module *Dest, Module *Src, unsigned Mode,
49 std::string *ErrorMsg);
50
51 private:
52 Module *Composite;
53 SmallPtrSet IdentifiedStructTypes;
54
55 bool SuppressWarnings;
56 };
57
58 } // End llvm namespace
59
60 #endif
+0
-61
include/llvm/Linker.h less more
None //===- llvm/Linker.h - Module Linker Interface ------------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef LLVM_LINKER_H
10 #define LLVM_LINKER_H
11
12 #include "llvm/ADT/SmallPtrSet.h"
13 #include
14
15 namespace llvm {
16
17 class Module;
18 class StringRef;
19 class StructType;
20
21 /// This class provides the core functionality of linking in LLVM. It keeps a
22 /// pointer to the merged module so far. It doesn't take ownership of the
23 /// module since it is assumed that the user of this class will want to do
24 /// something with it after the linking.
25 class Linker {
26 public:
27 enum LinkerMode {
28 DestroySource = 0, // Allow source module to be destroyed.
29 PreserveSource = 1 // Preserve the source module.
30 };
31
32 Linker(Module *M, bool SuppressWarnings=false);
33 ~Linker();
34
35 Module *getModule() const { return Composite; }
36 void deleteModule();
37
38 /// \brief Link \p Src into the composite. The source is destroyed if
39 /// \p Mode is DestroySource and preserved if it is PreserveSource.
40 /// If \p ErrorMsg is not null, information about any error is written
41 /// to it.
42 /// Returns true on error.
43 bool linkInModule(Module *Src, unsigned Mode, std::string *ErrorMsg);
44 bool linkInModule(Module *Src, std::string *ErrorMsg) {
45 return linkInModule(Src, Linker::DestroySource, ErrorMsg);
46 }
47
48 static bool LinkModules(Module *Dest, Module *Src, unsigned Mode,
49 std::string *ErrorMsg);
50
51 private:
52 Module *Composite;
53 SmallPtrSet IdentifiedStructTypes;
54
55 bool SuppressWarnings;
56 };
57
58 } // End llvm namespace
59
60 #endif
2828 #include "llvm/IR/Verifier.h"
2929 #include "llvm/InitializePasses.h"
3030 #include "llvm/LTO/LTOModule.h"
31 #include "llvm/Linker.h"
31 #include "llvm/Linker/Linker.h"
3232 #include "llvm/MC/MCAsmInfo.h"
3333 #include "llvm/MC/MCContext.h"
3434 #include "llvm/MC/SubtargetFeature.h"
1010 //
1111 //===----------------------------------------------------------------------===//
1212
13 #include "llvm/Linker.h"
13 #include "llvm/Linker/Linker.h"
1414 #include "llvm-c/Linker.h"
1515 #include "llvm/ADT/Optional.h"
1616 #include "llvm/ADT/SetVector.h"
1616 #include "ToolRunner.h"
1717 #include "llvm/IR/Module.h"
1818 #include "llvm/IRReader/IRReader.h"
19 #include "llvm/Linker.h"
19 #include "llvm/Linker/Linker.h"
2020 #include "llvm/Pass.h"
2121 #include "llvm/Support/CommandLine.h"
2222 #include "llvm/Support/FileUtilities.h"
2020 #include "llvm/IR/Instructions.h"
2121 #include "llvm/IR/Module.h"
2222 #include "llvm/IR/Verifier.h"
23 #include "llvm/Linker.h"
23 #include "llvm/Linker/Linker.h"
2424 #include "llvm/Pass.h"
2525 #include "llvm/Support/CommandLine.h"
2626 #include "llvm/Support/FileUtilities.h"
1111 //
1212 //===----------------------------------------------------------------------===//
1313
14 #include "llvm/Linker.h"
14 #include "llvm/Linker/Linker.h"
1515 #include "llvm/Bitcode/ReaderWriter.h"
1616 #include "llvm/IR/LLVMContext.h"
1717 #include "llvm/IR/Module.h"
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "llvm/Linker.h"
9 #include "llvm/Linker/Linker.h"
1010 #include "llvm/IR/BasicBlock.h"
1111 #include "llvm/IR/DataLayout.h"
1212 #include "llvm/IR/Function.h"