blob: da834fb2c9c914d0a77cdccc1b2d17d81d74fdae [file] [log] [blame]
Michael J. Spencerd68d6192013-01-22 02:15:30 +00001//===- lib/Core/TargetInfo.cpp - Linker Target Info Interface -------------===//
2//
3// The LLVM Linker
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "lld/Core/TargetInfo.h"
11
12#include "lld/Core/LinkerOptions.h"
13
14#include "llvm/ADT/Triple.h"
15
16namespace lld {
17TargetInfo::~TargetInfo() {}
18
19llvm::Triple TargetInfo::getTriple() const {
20 return llvm::Triple(llvm::Triple::normalize(_options._target));
21}
22
23bool TargetInfo::is64Bits() const {
24 return getTriple().isArch64Bit();
25}
26
27bool TargetInfo::isLittleEndian() const {
28 // TODO: Do this properly. It is not defined purely by arch.
29 return true;
30}
31
32StringRef TargetInfo::getEntry() const {
33 return _options._entrySymbol;
34}
35} // end namespace lld