OpenASIP 2.2
Loading...
Searching...
No Matches
TCESubtarget.cc
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file TCESubtarget.cpp
26 *
27 * Implementation of TCESubtargetClass.
28 *
29 * @author Veli-Pekka Jääskeläinen 2007 (vjaaskel-no.spam-cs.tut.fi)
30 * @author Heikki Kultala 2013 (hkultala-no.spam-cs.tut.fi)
31 */
32
33#include "TCESubtarget.hh"
34
35#include <iostream>
36
38#include "TCETargetMachine.hh"
40#include "llvm/Support/CommandLine.h"
41
42#define GET_SUBTARGETINFO_CTOR
43#define GET_SUBTARGETINFO_MC_DESC
44#define GET_SUBTARGETINFO_TARGET_DESC
45
46#define DEBUG_TYPE ""
47
48#include "TCEGenSubTargetInfo.inc"
49
50#undef DEBUG_TYPE
51
52#undef GET_SUBTARGETINFO_CTOR
53#undef GET_SUBTARGETINFO_MC_DESC
54#undef GET_SUBTARGETINFO_TARGET_DESC
55
56using namespace llvm;
57
58// Add plugin file name option.
59cl::opt<std::string>
61 "tce-plugin-file",
62 cl::value_desc("plugin file"),
63 cl::desc("TCE target machine plugin file."),
64 cl::NotHidden);
65
66/**
67 * The Constructor.
68 */
70 : TCEGenSubtargetInfo(
71 Triple("tce-tut-llvm"), std::string(""), std::string(""),
72 std::string("")),
73
74 pluginFile_(BackendPluginFile),
75 plugin_(plugin),
76 InstrItins(getInstrItineraryForCPU("generic")) {
77 assert(InstrItins.Itineraries != nullptr && "IstrItins not initialized");
78}
79
80/**
81 * Returns full path of the plugin file name supplied with the
82 * -tce-plugin-file parameter.
83 *
84 * @return plugin file path
85 */
86std::string
90
91const TargetInstrInfo* TCESubtarget::getInstrInfo() const {
92 return plugin_->getInstrInfo();
93}
94
95const TargetRegisterInfo* TCESubtarget::getRegisterInfo() const {
96 return plugin_->getRegisterInfo();
97}
98
99const TargetFrameLowering* TCESubtarget::getFrameLowering() const {
100 return plugin_->getFrameLowering();
101}
102
103const TargetLowering* TCESubtarget::getTargetLowering() const {
104 return plugin_->getTargetLowering();
105}
106
107const SelectionDAGTargetInfo* TCESubtarget::getSelectionDAGInfo() const {
109}
110
111bool
113 return false;
114}
#define assert(condition)
cl::opt< std::string > BackendPluginFile("tce-plugin-file", cl::value_desc("plugin file"), cl::desc("TCE target machine plugin file."), cl::NotHidden)
InstrItineraryData InstrItins
virtual bool enableMachinePipeliner() const override
std::string pluginFile_
virtual const TargetInstrInfo * getInstrInfo() const override
virtual const TargetLowering * getTargetLowering() const override
virtual const TargetRegisterInfo * getRegisterInfo() const override
TCESubtarget(TCETargetMachinePlugin *plugin)
virtual const TargetFrameLowering * getFrameLowering() const override
virtual const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
TCETargetMachinePlugin * plugin_
std::string pluginFileName()
virtual const TargetFrameLowering * getFrameLowering() const =0
virtual TargetLowering * getTargetLowering() const =0
virtual const TargetRegisterInfo * getRegisterInfo() const =0
virtual const TargetInstrInfo * getInstrInfo() const =0
virtual const SelectionDAGTargetInfo * getSelectionDAGInfo() const