f8bf21e5ea800a3153d77e7a14706abdc2ecde44
[oota-llvm.git] / lib / Linker / Linker.cpp
1 //===- lib/Linker/Linker.cpp - Basic Linker functionality  ----------------===//
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 // This file contains basic Linker functionality that all usages will need.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "llvm/Linker.h"
15 #include "llvm/Bitcode/ReaderWriter.h"
16 #include "llvm/IR/Module.h"
17 #include "llvm/Support/MemoryBuffer.h"
18 #include "llvm/Support/raw_ostream.h"
19 #include "llvm/Support/system_error.h"
20 using namespace llvm;
21
22 Linker::Linker(StringRef modname,
23                LLVMContext& C):
24   Context(C),
25   Composite(new Module(modname, C)) { }
26
27 Linker::Linker(Module* aModule) :
28   Context(aModule->getContext()),
29   Composite(aModule) { }
30
31 Linker::~Linker() {
32   delete Composite;
33 }