OLD | NEW |
(Empty) | |
| 1 //===-- PNaClMCTargetDesc.cpp - PNaCl Target Descriptions -------*- C++ -*-===// |
| 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 provides PNaCl specific target descriptions. |
| 11 // |
| 12 //===----------------------------------------------------------------------===// |
| 13 |
| 14 #include "PNaClMCTargetDesc.h" |
| 15 #include "PNaClMCAsmInfo.h" |
| 16 #include "llvm/MC/MCCodeGenInfo.h" |
| 17 #include "llvm/MC/MCInstrInfo.h" |
| 18 #include "llvm/MC/MCRegisterInfo.h" |
| 19 #include "llvm/MC/MCSubtargetInfo.h" |
| 20 #include "llvm/Support/TargetRegistry.h" |
| 21 |
| 22 using namespace llvm; |
| 23 |
| 24 static MCSubtargetInfo *createPNaClMCSubtargetInfo(StringRef TT, StringRef CPU, |
| 25 StringRef FS) { |
| 26 return new MCSubtargetInfo(); |
| 27 } |
| 28 |
| 29 static MCCodeGenInfo *createPNaClMCCodeGenInfo(StringRef TT, Reloc::Model RM, |
| 30 CodeModel::Model CM) { |
| 31 MCCodeGenInfo *X = new MCCodeGenInfo(); |
| 32 X->InitMCCodeGenInfo(Reloc::PIC_, CM); |
| 33 return X; |
| 34 } |
| 35 |
| 36 // Force static initialization. |
| 37 extern "C" void LLVMInitializePNaClTargetMC() { |
| 38 // Register the MC asm info. |
| 39 RegisterMCAsmInfo<PNaClMCAsmInfo> X(ThePNaClTarget); |
| 40 |
| 41 // Register the MC codegen info. |
| 42 TargetRegistry::RegisterMCCodeGenInfo(ThePNaClTarget, |
| 43 createPNaClMCCodeGenInfo); |
| 44 |
| 45 // Register the MC subtarget info. |
| 46 TargetRegistry::RegisterMCSubtargetInfo(ThePNaClTarget, |
| 47 createPNaClMCSubtargetInfo); |
| 48 } |
OLD | NEW |