//= LoongArchBaseInfo.cpp - Top level definitions for LoongArch MC -*- C++ -*-// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file implements helper functions for the LoongArch target useful for the // compiler back-end and the MC libraries. // //===----------------------------------------------------------------------===// #include "LoongArchBaseInfo.h" #include "LoongArchMCTargetDesc.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/MC/MCSubtargetInfo.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" #include "llvm/TargetParser/Triple.h" namespace llvm { namespace LoongArchABI { // Check if ABI has been standardized; issue a warning if it hasn't. // FIXME: Once all ABIs are standardized, this will be removed. static ABI checkABIStandardized(ABI Abi) { … } static ABI getTripleABI(const Triple &TT) { … } ABI computeTargetABI(const Triple &TT, const FeatureBitset &FeatureBits, StringRef ABIName) { … } ABI getTargetABI(StringRef ABIName) { … } // To avoid the BP value clobbered by a function call, we need to choose a // callee saved register to save the value. The `last` `S` register (s9) is // used for FP. So we choose the previous (s8) as BP. MCRegister getBPReg() { … } } // end namespace LoongArchABI } // end namespace llvm