blob: 2c150f456cf6c6e9b35a2e833f459edb39807dd4 [file] [log] [blame]
Evan Cheng78c10ee2011-07-25 23:24:55 +00001//===-- MCAsmBackend.cpp - Target MC Assembly Backend ----------------------==//
Daniel Dunbare7bd8862010-02-21 21:53:53 +00002//
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
Evan Cheng78c10ee2011-07-25 23:24:55 +000010#include "llvm/MC/MCAsmBackend.h"
Daniel Dunbare7bd8862010-02-21 21:53:53 +000011using namespace llvm;
12
Evan Cheng78c10ee2011-07-25 23:24:55 +000013MCAsmBackend::MCAsmBackend()
Daniel Dunbar7b62afa2010-12-17 02:06:08 +000014 : HasReliableSymbolDifference(false)
Daniel Dunbare7bd8862010-02-21 21:53:53 +000015{
16}
17
Evan Cheng78c10ee2011-07-25 23:24:55 +000018MCAsmBackend::~MCAsmBackend() {
Daniel Dunbare7bd8862010-02-21 21:53:53 +000019}
Daniel Dunbar2761fc42010-12-16 03:20:06 +000020
21const MCFixupKindInfo &
Evan Cheng78c10ee2011-07-25 23:24:55 +000022MCAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
Daniel Dunbar2761fc42010-12-16 03:20:06 +000023 static const MCFixupKindInfo Builtins[] = {
24 { "FK_Data_1", 0, 8, 0 },
25 { "FK_Data_2", 0, 16, 0 },
26 { "FK_Data_4", 0, 32, 0 },
27 { "FK_Data_8", 0, 64, 0 },
28 { "FK_PCRel_1", 0, 8, MCFixupKindInfo::FKF_IsPCRel },
29 { "FK_PCRel_2", 0, 16, MCFixupKindInfo::FKF_IsPCRel },
Rafael Espindola3a83c402010-12-27 00:36:05 +000030 { "FK_PCRel_4", 0, 32, MCFixupKindInfo::FKF_IsPCRel },
31 { "FK_PCRel_8", 0, 64, MCFixupKindInfo::FKF_IsPCRel }
Daniel Dunbar2761fc42010-12-16 03:20:06 +000032 };
33
Benjamin Kramere21083a2010-12-28 13:52:52 +000034 assert((size_t)Kind <= sizeof(Builtins) / sizeof(Builtins[0]) &&
Daniel Dunbar2761fc42010-12-16 03:20:06 +000035 "Unknown fixup kind");
36 return Builtins[Kind];
37}