1 //===-- AArch64TargetInfo.cpp - AArch64 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/ADT/Triple.h"
11 #include "llvm/Support/TargetRegistry.h"
12 using namespace llvm;
13 namespace llvm {
getTheAArch64leTarget()14 Target &getTheAArch64leTarget() {
15 static Target TheAArch64leTarget;
16 return TheAArch64leTarget;
17 }
getTheAArch64beTarget()18 Target &getTheAArch64beTarget() {
19 static Target TheAArch64beTarget;
20 return TheAArch64beTarget;
21 }
getTheARM64Target()22 Target &getTheARM64Target() {
23 static Target TheARM64Target;
24 return TheARM64Target;
25 }
26 } // namespace llvm
27
LLVMInitializeAArch64TargetInfo()28 extern "C" void LLVMInitializeAArch64TargetInfo() {
29 // Now register the "arm64" name for use with "-march". We don't want it to
30 // take possession of the Triple::aarch64 tag though.
31 TargetRegistry::RegisterTarget(getTheARM64Target(), "arm64",
32 "ARM64 (little endian)", "AArch64",
33 [](Triple::ArchType) { return false; }, true);
34
35 RegisterTarget<Triple::aarch64, /*HasJIT=*/true> Z(
36 getTheAArch64leTarget(), "aarch64", "AArch64 (little endian)", "AArch64");
37 RegisterTarget<Triple::aarch64_be, /*HasJIT=*/true> W(
38 getTheAArch64beTarget(), "aarch64_be", "AArch64 (big endian)", "AArch64");
39 }
40