LLVM  16.0.0git
LoongArchBaseInfo.cpp
Go to the documentation of this file.
1 //= LoongArchBaseInfo.cpp - Top level definitions for LoongArch MC -*- C++ -*-//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements helper functions for the LoongArch target useful for the
10 // compiler back-end and the MC libraries.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "LoongArchBaseInfo.h"
15 #include "llvm/ADT/ArrayRef.h"
16 #include "llvm/ADT/Triple.h"
18 
19 namespace llvm {
20 
21 namespace LoongArchABI {
22 
24  auto TargetABI = StringSwitch<ABI>(ABIName)
25  .Case("ilp32s", ABI_ILP32S)
26  .Case("ilp32f", ABI_ILP32F)
27  .Case("ilp32d", ABI_ILP32D)
28  .Case("lp64s", ABI_LP64S)
29  .Case("lp64f", ABI_LP64F)
30  .Case("lp64d", ABI_LP64D)
32  return TargetABI;
33 }
34 
35 // FIXME: other register?
36 MCRegister getBPReg() { return LoongArch::R31; }
37 
38 } // end namespace LoongArchABI
39 
40 } // end namespace llvm
llvm::StringSwitch::Case
StringSwitch & Case(StringLiteral S, T Value)
Definition: StringSwitch.h:70
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::LoongArchABI::ABI_LP64S
@ ABI_LP64S
Definition: LoongArchBaseInfo.h:51
llvm::LoongArchABI::ABI_ILP32D
@ ABI_ILP32D
Definition: LoongArchBaseInfo.h:50
llvm::LoongArchABI::ABI_LP64F
@ ABI_LP64F
Definition: LoongArchBaseInfo.h:52
llvm::LoongArchABI::ABI_ILP32F
@ ABI_ILP32F
Definition: LoongArchBaseInfo.h:49
MCSubtargetInfo.h
llvm::LoongArchABI::getTargetABI
ABI getTargetABI(StringRef ABIName)
Definition: LoongArchBaseInfo.cpp:23
llvm::LoongArchABI::ABI_Unknown
@ ABI_Unknown
Definition: LoongArchBaseInfo.h:54
ArrayRef.h
llvm::LoongArchABI::ABI
ABI
Definition: LoongArchBaseInfo.h:47
Triple.h
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
llvm::LoongArchABI::ABI_ILP32S
@ ABI_ILP32S
Definition: LoongArchBaseInfo.h:48
LoongArchBaseInfo.h
llvm::LoongArchABI::ABI_LP64D
@ ABI_LP64D
Definition: LoongArchBaseInfo.h:53
llvm::LoongArchABI::getBPReg
MCRegister getBPReg()
Definition: LoongArchBaseInfo.cpp:36
llvm::StringSwitch::Default
R Default(T Value)
Definition: StringSwitch.h:183
llvm::StringSwitch
A switch()-like statement whose cases are string literals.
Definition: StringSwitch.h:45
llvm::MCRegister
Wrapper class representing physical registers. Should be passed by value.
Definition: MCRegister.h:24