| 1 | //===-- LoongArchTargetInfo.cpp - LoongArch Target Implementation ---------===// |
|---|---|
| 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 | #include "TargetInfo/LoongArchTargetInfo.h" |
| 10 | #include "llvm/MC/TargetRegistry.h" |
| 11 | #include "llvm/Support/Compiler.h" |
| 12 | using namespace llvm; |
| 13 | |
| 14 | Target &llvm::getTheLoongArch32Target() { |
| 15 | static Target TheLoongArch32Target; |
| 16 | return TheLoongArch32Target; |
| 17 | } |
| 18 | |
| 19 | Target &llvm::getTheLoongArch64Target() { |
| 20 | static Target TheLoongArch64Target; |
| 21 | return TheLoongArch64Target; |
| 22 | } |
| 23 | |
| 24 | extern "C"LLVM_ABI LLVM_EXTERNAL_VISIBILITY void |
| 25 | LLVMInitializeLoongArchTargetInfo() { |
| 26 | RegisterTarget<Triple::loongarch32, /*HasJIT=*/false> X( |
| 27 | getTheLoongArch32Target(), "loongarch32", "32-bit LoongArch", |
| 28 | "LoongArch"); |
| 29 | RegisterTarget<Triple::loongarch64, /*HasJIT=*/true> Y( |
| 30 | getTheLoongArch64Target(), "loongarch64", "64-bit LoongArch", |
| 31 | "LoongArch"); |
| 32 | } |
| 33 |