/3rd_party/llvm/lib/Target/Alpha/MCTargetDesc/AlphaMCTargetDesc.cpp

https://code.google.com/p/softart/ · C++ · 78 lines · 45 code · 15 blank · 18 comment · 0 complexity · 65ce13bd4ba112dade391d88020171e2 MD5 · raw file

  1. //===-- AlphaMCTargetDesc.cpp - Alpha 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 Alpha specific target descriptions.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #include "AlphaMCTargetDesc.h"
  14. #include "AlphaMCAsmInfo.h"
  15. #include "llvm/MC/MCCodeGenInfo.h"
  16. #include "llvm/MC/MCInstrInfo.h"
  17. #include "llvm/MC/MCRegisterInfo.h"
  18. #include "llvm/MC/MCSubtargetInfo.h"
  19. #include "llvm/Support/TargetRegistry.h"
  20. #define GET_INSTRINFO_MC_DESC
  21. #include "AlphaGenInstrInfo.inc"
  22. #define GET_SUBTARGETINFO_MC_DESC
  23. #include "AlphaGenSubtargetInfo.inc"
  24. #define GET_REGINFO_MC_DESC
  25. #include "AlphaGenRegisterInfo.inc"
  26. using namespace llvm;
  27. static MCInstrInfo *createAlphaMCInstrInfo() {
  28. MCInstrInfo *X = new MCInstrInfo();
  29. InitAlphaMCInstrInfo(X);
  30. return X;
  31. }
  32. static MCRegisterInfo *createAlphaMCRegisterInfo(StringRef TT) {
  33. MCRegisterInfo *X = new MCRegisterInfo();
  34. InitAlphaMCRegisterInfo(X, Alpha::R26);
  35. return X;
  36. }
  37. static MCSubtargetInfo *createAlphaMCSubtargetInfo(StringRef TT, StringRef CPU,
  38. StringRef FS) {
  39. MCSubtargetInfo *X = new MCSubtargetInfo();
  40. InitAlphaMCSubtargetInfo(X, TT, CPU, FS);
  41. return X;
  42. }
  43. static MCCodeGenInfo *createAlphaMCCodeGenInfo(StringRef TT, Reloc::Model RM,
  44. CodeModel::Model CM) {
  45. MCCodeGenInfo *X = new MCCodeGenInfo();
  46. X->InitMCCodeGenInfo(Reloc::PIC_, CM);
  47. return X;
  48. }
  49. // Force static initialization.
  50. extern "C" void LLVMInitializeAlphaTargetMC() {
  51. // Register the MC asm info.
  52. RegisterMCAsmInfo<AlphaMCAsmInfo> X(TheAlphaTarget);
  53. // Register the MC codegen info.
  54. TargetRegistry::RegisterMCCodeGenInfo(TheAlphaTarget,
  55. createAlphaMCCodeGenInfo);
  56. // Register the MC instruction info.
  57. TargetRegistry::RegisterMCInstrInfo(TheAlphaTarget, createAlphaMCInstrInfo);
  58. // Register the MC register info.
  59. TargetRegistry::RegisterMCRegInfo(TheAlphaTarget, createAlphaMCRegisterInfo);
  60. // Register the MC subtarget info.
  61. TargetRegistry::RegisterMCSubtargetInfo(TheAlphaTarget,
  62. createAlphaMCSubtargetInfo);
  63. }