1//===- HexagonGNUInfo.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 "HexagonGNUInfo.h"
10
11#include <llvm/ADT/StringRef.h>
12#include <llvm/ADT/StringSwitch.h>
13
14using namespace mcld;
15
16//===----------------------------------------------------------------------===//
17// HexagonGNUInfo
18//===----------------------------------------------------------------------===//
19HexagonGNUInfo::HexagonGNUInfo(const TargetOptions& pTargetOptions)
20  : GNUInfo(pTargetOptions.triple()), m_Options(pTargetOptions) {
21}
22
23/// flags - the value of ElfXX_Ehdr::e_flags
24uint64_t HexagonGNUInfo::flags() const
25{
26  return llvm::StringSwitch<uint64_t>(m_Options.getTargetCPU())
27           .Case("hexagonv4", V4)
28           .Case("hexagonv5", V5)
29           .Default(V4);
30}
31
32