llvm.org GIT mirror llvm / 0b9fa0c
Add AVR backend skeleton This adds part of the target info code, and adds modifications to the build scripts so that AVR is recognized a supported, experimental backend. It does not include any AVR-specific code, just the bare sources required for a backend to exist. From D14039. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252865 91177308-0d34-0410-b5e6-96231b3b80d8 Dylan McKay 3 years ago
11 changed file(s) with 145 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
430430 arm64*-*) llvm_cv_target_arch="AArch64" ;;
431431 arm*-*) llvm_cv_target_arch="ARM" ;;
432432 aarch64*-*) llvm_cv_target_arch="AArch64" ;;
433 avr-*) llvm_cv_target_arch="AVR" ;;
433434 mips-* | mips64-*) llvm_cv_target_arch="Mips" ;;
434435 mipsel-* | mips64el-*) llvm_cv_target_arch="Mips" ;;
435436 xcore-*) llvm_cv_target_arch="XCore" ;;
467468 arm64*-*) host_arch="AArch64" ;;
468469 arm*-*) host_arch="ARM" ;;
469470 aarch64*-*) host_arch="AArch64" ;;
471 avr-*) host_arch="AVR" ;;
470472 mips-* | mips64-*) host_arch="Mips" ;;
471473 mipsel-* | mips64el-*) host_arch="Mips" ;;
472474 xcore-*) host_arch="XCore" ;;
800802 PowerPC) AC_SUBST(TARGET_HAS_JIT,1) ;;
801803 x86_64) AC_SUBST(TARGET_HAS_JIT,1) ;;
802804 ARM) AC_SUBST(TARGET_HAS_JIT,1) ;;
805 AVR) AC_SUBST(TARGET_HAS_JIT,0) ;;
803806 Mips) AC_SUBST(TARGET_HAS_JIT,1) ;;
804807 XCore) AC_SUBST(TARGET_HAS_JIT,0) ;;
805808 MSP430) AC_SUBST(TARGET_HAS_JIT,0) ;;
41874187 arm64*-*) llvm_cv_target_arch="AArch64" ;;
41884188 arm*-*) llvm_cv_target_arch="ARM" ;;
41894189 aarch64*-*) llvm_cv_target_arch="AArch64" ;;
4190 avr-*) llvm_cv_target_arch="AVR" ;;
41904191 mips-* | mips64-*) llvm_cv_target_arch="Mips" ;;
41914192 mipsel-* | mips64el-*) llvm_cv_target_arch="Mips" ;;
41924193 xcore-*) llvm_cv_target_arch="XCore" ;;
42254226 arm64*-*) host_arch="AArch64" ;;
42264227 arm*-*) host_arch="ARM" ;;
42274228 aarch64*-*) host_arch="AArch64" ;;
4229 avr-*) host_arch="AVR" ;;
42284230 mips-* | mips64-*) host_arch="Mips" ;;
42294231 mipsel-* | mips64el-*) host_arch="Mips" ;;
42304232 xcore-*) host_arch="XCore" ;;
51465148 x86_64) TARGET_HAS_JIT=1
51475149 ;;
51485150 ARM) TARGET_HAS_JIT=1
5151 ;;
5152 AVR) TARGET_HAS_JIT=0
51495153 ;;
51505154 Mips) TARGET_HAS_JIT=1
51515155 ;;
0
1 extern "C" void LLVMInitializeAVRTarget() {
2
3 }
0
1
2 add_llvm_target(AVRCodeGen
3 AVRTargetMachine.cpp
4 )
5
6 add_dependencies(LLVMAVRCodeGen intrinsics_gen)
7
8 add_subdirectory(TargetInfo)
9
0 ;===- ./lib/Target/AVR/LLVMBuild.txt ---------------------------*- Conf -*--===;
1 ;
2 ; The LLVM Compiler Infrastructure
3 ;
4 ; This file is distributed under the University of Illinois Open Source
5 ; License. See LICENSE.TXT for details.
6 ;
7 ;===------------------------------------------------------------------------===;
8 ;
9 ; This is an LLVMBuild description file for the components in this subdirectory.
10 ;
11 ; For more information on the LLVMBuild system, please see:
12 ;
13 ; http://llvm.org/docs/LLVMBuild.html
14 ;
15 ;===------------------------------------------------------------------------===;
16
17 [common]
18 subdirectories = TargetInfo
19
20 [component_0]
21 type = TargetGroup
22 name = AVR
23 parent = Target
24 has_asmprinter = 0
25 has_asmparser = 0
26
27 [component_1]
28 type = Library
29 name = AVRCodeGen
30 parent = AVR
31 required_libraries = AsmPrinter CodeGen Core MC AVRInfo SelectionDAG Support Target
32 add_to_library_groups = AVR
0 ##===- lib/Target/AVR/Makefile -----------------------------*- Makefile -*-===##
1 #
2 # The LLVM Compiler Infrastructure
3 #
4 # This file is distributed under the University of Illinois Open Source
5 # License. See LICENSE.TXT for details.
6 #
7 ##===----------------------------------------------------------------------===##
8
9 LEVEL = ../../..
10 LIBRARYNAME = LLVMAVRCodeGen
11 TARGET = AVR
12
13 # Make sure that tblgen is run, first thing.
14 BUILT_SOURCES =
15
16 DIRS = TargetInfo
17
18 include $(LEVEL)/Makefile.common
0 //===-- AVRTargetInfo.cpp - AVR Target Implementation ---------------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "llvm/IR/Module.h"
10 #include "llvm/Support/TargetRegistry.h"
11
12 namespace llvm {
13 Target TheAVRTarget;
14 }
15
16 extern "C" void LLVMInitializeAVRTargetInfo() {
17 llvm::RegisterTarget X(
18 llvm::TheAVRTarget, "avr", "Atmel AVR Microcontroller");
19 }
20
21 // FIXME: Temporary stub - this function must be defined for linking
22 // to succeed. Remove once this function is properly implemented.
23 extern "C" void LLVMInitializeAVRTargetMC() {
24 }
0 include_directories( ${CMAKE_CURRENT_BINARY_DIR}/..
1 ${CMAKE_CURRENT_SOURCE_DIR}/.. )
2
3 add_llvm_library(LLVMAVRInfo
4 AVRTargetInfo.cpp
5 )
6
0 ;===- ./lib/Target/AVR/TargetInfo/LLVMBuild.txt ----------------*- Conf -*--===;
1 ;
2 ; The LLVM Compiler Infrastructure
3 ;
4 ; This file is distributed under the University of Illinois Open Source
5 ; License. See LICENSE.TXT for details.
6 ;
7 ;===------------------------------------------------------------------------===;
8 ;
9 ; This is an LLVMBuild description file for the components in this subdirectory.
10 ;
11 ; For more information on the LLVMBuild system, please see:
12 ;
13 ; http://llvm.org/docs/LLVMBuild.html
14 ;
15 ;===------------------------------------------------------------------------===;
16
17 [component_0]
18 type = Library
19 name = AVRInfo
20 parent = AVR
21 required_libraries = MC Support
22 add_to_library_groups = AVR
0 ##===- lib/Target/AVR/TargetInfo/Makefile ------------------*- Makefile -*-===##
1 #
2 # The LLVM Compiler Infrastructure
3 #
4 # This file is distributed under the University of Illinois Open Source
5 # License. See LICENSE.TXT for details.
6 #
7 ##===----------------------------------------------------------------------===##
8
9 LEVEL = ../../../..
10 LIBRARYNAME = LLVMAVRInfo
11
12 # Hack: we need to include 'main' target directory to grab private headers
13 CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/..
14
15 include $(LEVEL)/Makefile.common
2121 AMDGPU
2222 ARM
2323 AArch64
24 AVR
2425 BPF
2526 CppBackend
2627 Hexagon