LLVM API Documentation

XCoreSubtarget.h
Go to the documentation of this file.
00001 //===-- XCoreSubtarget.h - Define Subtarget for the XCore -------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file declares the XCore specific subclass of TargetSubtargetInfo.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_LIB_TARGET_XCORE_XCORESUBTARGET_H
00015 #define LLVM_LIB_TARGET_XCORE_XCORESUBTARGET_H
00016 
00017 #include "XCoreFrameLowering.h"
00018 #include "XCoreISelLowering.h"
00019 #include "XCoreInstrInfo.h"
00020 #include "XCoreSelectionDAGInfo.h"
00021 #include "llvm/IR/DataLayout.h"
00022 #include "llvm/Target/TargetMachine.h"
00023 #include "llvm/Target/TargetSubtargetInfo.h"
00024 #include <string>
00025 
00026 #define GET_SUBTARGETINFO_HEADER
00027 #include "XCoreGenSubtargetInfo.inc"
00028 
00029 namespace llvm {
00030 class StringRef;
00031 
00032 class XCoreSubtarget : public XCoreGenSubtargetInfo {
00033   virtual void anchor();
00034   const DataLayout DL;       // Calculates type size & alignment
00035   XCoreInstrInfo InstrInfo;
00036   XCoreFrameLowering FrameLowering;
00037   XCoreTargetLowering TLInfo;
00038   XCoreSelectionDAGInfo TSInfo;
00039 
00040 public:
00041   /// This constructor initializes the data members to match that
00042   /// of the specified triple.
00043   ///
00044   XCoreSubtarget(const std::string &TT, const std::string &CPU,
00045                  const std::string &FS, const TargetMachine &TM);
00046   
00047   /// ParseSubtargetFeatures - Parses features string setting specified 
00048   /// subtarget options.  Definition of function is auto generated by tblgen.
00049   void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
00050 
00051   const XCoreInstrInfo *getInstrInfo() const override { return &InstrInfo; }
00052   const XCoreFrameLowering *getFrameLowering() const override {
00053     return &FrameLowering;
00054   }
00055   const XCoreTargetLowering *getTargetLowering() const override {
00056     return &TLInfo;
00057   }
00058   const XCoreSelectionDAGInfo *getSelectionDAGInfo() const override {
00059     return &TSInfo;
00060   }
00061   const TargetRegisterInfo *getRegisterInfo() const override {
00062     return &InstrInfo.getRegisterInfo();
00063   }
00064   const DataLayout *getDataLayout() const override { return &DL; }
00065 };
00066 } // End llvm namespace
00067 
00068 #endif