LinkerConfig.cpp revision 22add6ff3426df1a85089fe6a6e1597ee3b6f300
1//===- LinkerConfig.cpp ---------------------------------------------------===//
2//
3//                     The MCLinker Project
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9#include <mcld/LinkerConfig.h>
10#include <mcld/Config/Config.h>
11
12#include <mcld/Support/MsgHandling.h>
13
14using namespace mcld;
15
16//===----------------------------------------------------------------------===//
17// LinkerConfig
18//===----------------------------------------------------------------------===//
19LinkerConfig::LinkerConfig()
20  : m_Options(),
21    m_Scripts(),
22    m_Bitcode(),
23    m_Attribute(),
24    m_Triple(),
25    m_CodeGenType(Unknown)
26{
27  // FIXME: is here the right place to hold this?
28  InitializeDiagnosticEngine(*this);
29}
30
31LinkerConfig::LinkerConfig(const std::string& pTripleString)
32  : m_Options(),
33    m_Scripts(),
34    m_Bitcode(),
35    m_Attribute(),
36    m_Triple(pTripleString),
37    m_CodeGenType(Unknown)
38{
39  // FIXME: is here the right place to hold this?
40  InitializeDiagnosticEngine(*this);
41}
42
43LinkerConfig::~LinkerConfig()
44{
45  // FIXME: is here the right place to hold this?
46  FinalizeDiagnosticEngine();
47}
48
49void LinkerConfig::setTriple(const llvm::Triple& pTriple)
50{
51  m_Triple = pTriple;
52}
53
54void LinkerConfig::setTriple(const std::string& pTriple)
55{
56  m_Triple.setTriple(pTriple);
57}
58
59const char* LinkerConfig::version()
60{
61  return MCLD_VERSION;
62}
63