Home | History | Annotate | Download | only in Hexagon
      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 
     14 namespace mcld {
     15 
     16 //===----------------------------------------------------------------------===//
     17 // HexagonGNUInfo
     18 //===----------------------------------------------------------------------===//
     19 HexagonGNUInfo::HexagonGNUInfo(const TargetOptions& pTargetOptions)
     20     : GNUInfo(pTargetOptions.triple()), m_Options(pTargetOptions) {
     21 }
     22 
     23 /// flags - the value of ElfXX_Ehdr::e_flags
     24 uint64_t HexagonGNUInfo::flags() const {
     25   return llvm::StringSwitch<uint64_t>(m_Options.getTargetCPU())
     26       .Case("hexagonv4", V4)
     27       .Case("hexagonv5", V5)
     28       .Default(V4);
     29 }
     30 
     31 }  // namespace mcld
     32