- Eliminate MCCodeEmitter's dependency on TargetMachine. It now uses MCInstrInfo
[oota-llvm.git] / lib / Target / Blackfin / BlackfinSubtarget.cpp
1 //===- BlackfinSubtarget.cpp - BLACKFIN Subtarget Information -------------===//
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 // This file implements the blackfin specific subclass of TargetSubtargetInfo.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "BlackfinSubtarget.h"
15 #include "Blackfin.h"
16 #include "llvm/Target/TargetRegistry.h"
17
18 #define GET_SUBTARGETINFO_ENUM
19 #define GET_SUBTARGETINFO_MC_DESC
20 #define GET_SUBTARGETINFO_TARGET_DESC
21 #define GET_SUBTARGETINFO_CTOR
22 #include "BlackfinGenSubtargetInfo.inc"
23
24 using namespace llvm;
25
26 BlackfinSubtarget::BlackfinSubtarget(const std::string &TT,
27                                      const std::string &CPU,
28                                      const std::string &FS)
29   : BlackfinGenSubtargetInfo(TT, CPU, FS), sdram(false),
30     icplb(false),
31     wa_mi_shift(false),
32     wa_csync(false),
33     wa_specld(false),
34     wa_mmr_stall(false),
35     wa_lcregs(false),
36     wa_hwloop(false),
37     wa_ind_call(false),
38     wa_killed_mmr(false),
39     wa_rets(false)
40 {
41   std::string CPUName = CPU;
42   if (CPUName.empty())
43     CPUName = "generic";
44   // Parse features string.
45   ParseSubtargetFeatures(CPUName, FS);
46 }
47
48 MCSubtargetInfo *createBlackfinMCSubtargetInfo(StringRef TT, StringRef CPU,
49                                                StringRef FS) {
50   MCSubtargetInfo *X = new MCSubtargetInfo();
51   InitBlackfinMCSubtargetInfo(X, TT, CPU, FS);
52   return X;
53 }
54
55 extern "C" void LLVMInitializeBlackfinMCSubtargetInfo() {
56   TargetRegistry::RegisterMCSubtargetInfo(TheBlackfinTarget,
57                                           createBlackfinMCSubtargetInfo);
58 }