1 //===-- MCAsmBackend.cpp - Target MC Assembly Backend ----------------------==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/MC/MCAsmBackend.h"
11 #include "llvm/MC/MCFixupKindInfo.h"
14 MCAsmBackend::MCAsmBackend()
15 : HasReliableSymbolDifference(false)
19 MCAsmBackend::~MCAsmBackend() {
22 const MCFixupKindInfo &
23 MCAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
24 static const MCFixupKindInfo Builtins[] = {
25 { "FK_Data_1", 0, 8, 0 },
26 { "FK_Data_2", 0, 16, 0 },
27 { "FK_Data_4", 0, 32, 0 },
28 { "FK_Data_8", 0, 64, 0 },
29 { "FK_PCRel_1", 0, 8, MCFixupKindInfo::FKF_IsPCRel },
30 { "FK_PCRel_2", 0, 16, MCFixupKindInfo::FKF_IsPCRel },
31 { "FK_PCRel_4", 0, 32, MCFixupKindInfo::FKF_IsPCRel },
32 { "FK_PCRel_8", 0, 64, MCFixupKindInfo::FKF_IsPCRel },
33 { "FK_GPRel_1", 0, 8, 0 },
34 { "FK_GPRel_2", 0, 16, 0 },
35 { "FK_GPRel_4", 0, 32, 0 },
36 { "FK_GPRel_8", 0, 64, 0 },
37 { "FK_SecRel_1", 0, 8, 0 },
38 { "FK_SecRel_2", 0, 16, 0 },
39 { "FK_SecRel_4", 0, 32, 0 },
40 { "FK_SecRel_8", 0, 64, 0 }
43 assert((size_t)Kind <= sizeof(Builtins) / sizeof(Builtins[0]) &&
44 "Unknown fixup kind");
45 return Builtins[Kind];