mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Next round of MC refactoring. This patch factor MC table instantiations, MC
registeration and creation code into XXXMCDesc libraries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135184 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
1
lib/Target/MSP430/MCTargetDesc/CMakeLists.txt
Normal file
1
lib/Target/MSP430/MCTargetDesc/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
||||
add_llvm_library(LLVMMSP430Desc MSP430MCTargetDesc.cpp)
|
53
lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp
Normal file
53
lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp
Normal file
@@ -0,0 +1,53 @@
|
||||
//===-- MSP430MCTargetDesc.cpp - MSP430 Target Descriptions -----*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file provides MSP430 specific target descriptions.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "MSP430MCTargetDesc.h"
|
||||
#include "llvm/MC/MCInstrInfo.h"
|
||||
#include "llvm/MC/MCRegisterInfo.h"
|
||||
#include "llvm/MC/MCSubtargetInfo.h"
|
||||
#include "llvm/Target/TargetRegistry.h"
|
||||
|
||||
#define GET_INSTRINFO_MC_DESC
|
||||
#include "MSP430GenInstrInfo.inc"
|
||||
|
||||
#define GET_SUBTARGETINFO_MC_DESC
|
||||
#include "MSP430GenSubtargetInfo.inc"
|
||||
|
||||
#define GET_REGINFO_MC_DESC
|
||||
#include "MSP430GenRegisterInfo.inc"
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
|
||||
MCInstrInfo *createMSP430MCInstrInfo() {
|
||||
MCInstrInfo *X = new MCInstrInfo();
|
||||
InitMSP430MCInstrInfo(X);
|
||||
return X;
|
||||
}
|
||||
|
||||
extern "C" void LLVMInitializeMSP430MCInstrInfo() {
|
||||
TargetRegistry::RegisterMCInstrInfo(TheMSP430Target, createMSP430MCInstrInfo);
|
||||
}
|
||||
|
||||
|
||||
MCSubtargetInfo *createMSP430MCSubtargetInfo(StringRef TT, StringRef CPU,
|
||||
StringRef FS) {
|
||||
MCSubtargetInfo *X = new MCSubtargetInfo();
|
||||
InitMSP430MCSubtargetInfo(X, TT, CPU, FS);
|
||||
return X;
|
||||
}
|
||||
|
||||
extern "C" void LLVMInitializeMSP430MCSubtargetInfo() {
|
||||
TargetRegistry::RegisterMCSubtargetInfo(TheMSP430Target,
|
||||
createMSP430MCSubtargetInfo);
|
||||
}
|
38
lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.h
Normal file
38
lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.h
Normal file
@@ -0,0 +1,38 @@
|
||||
//===-- MSP430MCTargetDesc.h - MSP430 Target Descriptions -------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file provides MSP430 specific target descriptions.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef ALPHAMCTARGETDESC_H
|
||||
#define ALPHAMCTARGETDESC_H
|
||||
|
||||
namespace llvm {
|
||||
class MCSubtargetInfo;
|
||||
class Target;
|
||||
class StringRef;
|
||||
|
||||
extern Target TheMSP430Target;
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
// Defines symbolic names for MSP430 registers.
|
||||
// This defines a mapping from register name to register number.
|
||||
#define GET_REGINFO_ENUM
|
||||
#include "MSP430GenRegisterInfo.inc"
|
||||
|
||||
// Defines symbolic names for the MSP430 instructions.
|
||||
#define GET_INSTRINFO_ENUM
|
||||
#include "MSP430GenInstrInfo.inc"
|
||||
|
||||
#define GET_SUBTARGETINFO_ENUM
|
||||
#include "MSP430GenSubtargetInfo.inc"
|
||||
|
||||
#endif
|
16
lib/Target/MSP430/MCTargetDesc/Makefile
Normal file
16
lib/Target/MSP430/MCTargetDesc/Makefile
Normal file
@@ -0,0 +1,16 @@
|
||||
##===- lib/Target/MSP430/TargetDesc/Makefile ---------------*- Makefile -*-===##
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file is distributed under the University of Illinois Open Source
|
||||
# License. See LICENSE.TXT for details.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
LEVEL = ../../../..
|
||||
LIBRARYNAME = LLVMMSP430Desc
|
||||
|
||||
# Hack: we need to include 'main' target directory to grab private headers
|
||||
CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/..
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
Reference in New Issue
Block a user