LLVM API Documentation
00001 //===-- MCAsmBackend.cpp - Target MC Assembly Backend ----------------------==// 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 #include "llvm/MC/MCAsmBackend.h" 00011 #include "llvm/ADT/STLExtras.h" 00012 #include "llvm/MC/MCFixupKindInfo.h" 00013 using namespace llvm; 00014 00015 MCAsmBackend::MCAsmBackend() : HasDataInCodeSupport(false) {} 00016 00017 MCAsmBackend::~MCAsmBackend() {} 00018 00019 const MCFixupKindInfo & 00020 MCAsmBackend::getFixupKindInfo(MCFixupKind Kind) const { 00021 static const MCFixupKindInfo Builtins[] = { 00022 { "FK_Data_1", 0, 8, 0 }, 00023 { "FK_Data_2", 0, 16, 0 }, 00024 { "FK_Data_4", 0, 32, 0 }, 00025 { "FK_Data_8", 0, 64, 0 }, 00026 { "FK_PCRel_1", 0, 8, MCFixupKindInfo::FKF_IsPCRel }, 00027 { "FK_PCRel_2", 0, 16, MCFixupKindInfo::FKF_IsPCRel }, 00028 { "FK_PCRel_4", 0, 32, MCFixupKindInfo::FKF_IsPCRel }, 00029 { "FK_PCRel_8", 0, 64, MCFixupKindInfo::FKF_IsPCRel }, 00030 { "FK_GPRel_1", 0, 8, 0 }, 00031 { "FK_GPRel_2", 0, 16, 0 }, 00032 { "FK_GPRel_4", 0, 32, 0 }, 00033 { "FK_GPRel_8", 0, 64, 0 }, 00034 { "FK_SecRel_1", 0, 8, 0 }, 00035 { "FK_SecRel_2", 0, 16, 0 }, 00036 { "FK_SecRel_4", 0, 32, 0 }, 00037 { "FK_SecRel_8", 0, 64, 0 } 00038 }; 00039 00040 assert((size_t)Kind <= array_lengthof(Builtins) && "Unknown fixup kind"); 00041 return Builtins[Kind]; 00042 }