| Alex Bradbury | b2e5472 | 2016-11-01 17:27:54 +0000 | [diff] [blame] | 1 | //===-- RISCVTargetInfo.cpp - RISCV Target Implementation -----------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "llvm/Support/TargetRegistry.h" |
| 11 | using namespace llvm; |
| 12 | |
| 13 | namespace llvm { |
| 14 | Target &getTheRISCV32Target() { |
| 15 | static Target TheRISCV32Target; |
| 16 | return TheRISCV32Target; |
| 17 | } |
| 18 | |
| 19 | Target &getTheRISCV64Target() { |
| 20 | static Target TheRISCV64Target; |
| 21 | return TheRISCV64Target; |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | extern "C" void LLVMInitializeRISCVTargetInfo() { |
| 26 | RegisterTarget<Triple::riscv32> X(getTheRISCV32Target(), "riscv32", |
| Azharuddin Mohammed | fa8420d | 2017-11-16 18:39:31 +0000 | [diff] [blame] | 27 | "32-bit RISC-V", "RISCV"); |
| Alex Bradbury | b2e5472 | 2016-11-01 17:27:54 +0000 | [diff] [blame] | 28 | RegisterTarget<Triple::riscv64> Y(getTheRISCV64Target(), "riscv64", |
| Azharuddin Mohammed | fa8420d | 2017-11-16 18:39:31 +0000 | [diff] [blame] | 29 | "64-bit RISC-V", "RISCV"); |
| Alex Bradbury | b2e5472 | 2016-11-01 17:27:54 +0000 | [diff] [blame] | 30 | } |