Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79763 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-08-22 20:48:53 +00:00
parent 9c52affd37
commit af76e592c7
120 changed files with 446 additions and 445 deletions

View File

@@ -32,7 +32,7 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Mangler.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
@@ -50,7 +50,7 @@ AsmVerbose("asm-verbose", cl::desc("Add comments to directives."),
char AsmPrinter::ID = 0;
AsmPrinter::AsmPrinter(formatted_raw_ostream &o, TargetMachine &tm,
const TargetAsmInfo *T, bool VDef)
const MCAsmInfo *T, bool VDef)
: MachineFunctionPass(&ID), FunctionNumber(0), O(o),
TM(tm), TAI(T), TRI(tm.getRegisterInfo()),
@@ -1792,7 +1792,7 @@ Indent(formatted_raw_ostream &out, int level, int scale = 2) {
///
static void PrintChildLoopComment(formatted_raw_ostream &O,
const MachineLoop *loop,
const TargetAsmInfo *TAI,
const MCAsmInfo *TAI,
int FunctionNumber) {
// Add child loop information
for(MachineLoop::iterator cl = loop->begin(),

View File

@@ -14,7 +14,7 @@
#include "DIE.h"
#include "DwarfPrinter.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Support/ErrorHandling.h"
#include <ostream>
@@ -224,8 +224,8 @@ unsigned DIEInteger::SizeOf(const TargetData *TD, unsigned Form) const {
case dwarf::DW_FORM_data4: return sizeof(int32_t);
case dwarf::DW_FORM_ref8: // Fall thru
case dwarf::DW_FORM_data8: return sizeof(int64_t);
case dwarf::DW_FORM_udata: return TargetAsmInfo::getULEB128Size(Integer);
case dwarf::DW_FORM_sdata: return TargetAsmInfo::getSLEB128Size(Integer);
case dwarf::DW_FORM_udata: return MCAsmInfo::getULEB128Size(Integer);
case dwarf::DW_FORM_sdata: return MCAsmInfo::getSLEB128Size(Integer);
default: llvm_unreachable("DIE Value form not supported yet"); break;
}
return 0;
@@ -499,7 +499,7 @@ unsigned DIEBlock::SizeOf(const TargetData *TD, unsigned Form) const {
case dwarf::DW_FORM_block1: return Size + sizeof(int8_t);
case dwarf::DW_FORM_block2: return Size + sizeof(int16_t);
case dwarf::DW_FORM_block4: return Size + sizeof(int32_t);
case dwarf::DW_FORM_block: return Size + TargetAsmInfo::getULEB128Size(Size);
case dwarf::DW_FORM_block: return Size + MCAsmInfo::getULEB128Size(Size);
default: llvm_unreachable("Improper form for block"); break;
}
return 0;

View File

@@ -17,7 +17,7 @@
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetFrameInfo.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
@@ -224,7 +224,7 @@ DbgScope::~DbgScope() {
} // end llvm namespace
DwarfDebug::DwarfDebug(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T)
DwarfDebug::DwarfDebug(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T)
: Dwarf(OS, A, T, "dbg"), ModuleCU(0),
AbbreviationsSet(InitAbbreviationsSetSize), Abbreviations(),
ValuesSet(InitValuesSetSize), Values(), StringPool(),
@@ -1794,7 +1794,7 @@ unsigned DwarfDebug::SizeAndOffsetDie(DIE *Die, unsigned Offset, bool Last) {
Die->setOffset(Offset);
// Start the size with the size of abbreviation code.
Offset += TargetAsmInfo::getULEB128Size(AbbrevNumber);
Offset += MCAsmInfo::getULEB128Size(AbbrevNumber);
const SmallVector<DIEValue*, 32> &Values = Die->getValues();
const SmallVector<DIEAbbrevData, 8> &AbbrevData = Abbrev->getData();

View File

@@ -35,7 +35,7 @@ class DbgScope;
class DbgConcreteScope;
class MachineFrameInfo;
class MachineModuleInfo;
class TargetAsmInfo;
class MCAsmInfo;
class Timer;
//===----------------------------------------------------------------------===//
@@ -458,7 +458,7 @@ public:
//===--------------------------------------------------------------------===//
// Main entry points.
//
DwarfDebug(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T);
DwarfDebug(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T);
virtual ~DwarfDebug();
/// ShouldEmitDwarfDebug - Returns true if Dwarf debugging declarations should

View File

@@ -18,7 +18,7 @@
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineLocation.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetFrameInfo.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
@@ -36,7 +36,7 @@ static TimerGroup &getDwarfTimerGroup() {
}
DwarfException::DwarfException(raw_ostream &OS, AsmPrinter *A,
const TargetAsmInfo *T)
const MCAsmInfo *T)
: Dwarf(OS, A, T, "eh"), shouldEmitTable(false), shouldEmitMoves(false),
shouldEmitTableModule(false), shouldEmitMovesModule(false),
ExceptionTimer(0) {
@@ -304,7 +304,7 @@ ComputeActionsTable(const SmallVectorImpl<const LandingPadInfo*> &LandingPads,
for (std::vector<unsigned>::const_iterator
I = FilterIds.begin(), E = FilterIds.end(); I != E; ++I) {
FilterOffsets.push_back(Offset);
Offset -= TargetAsmInfo::getULEB128Size(*I);
Offset -= MCAsmInfo::getULEB128Size(*I);
}
FirstActions.reserve(LandingPads.size());
@@ -328,12 +328,12 @@ ComputeActionsTable(const SmallVectorImpl<const LandingPadInfo*> &LandingPads,
const unsigned SizePrevIds = PrevLPI->TypeIds.size();
assert(Actions.size());
PrevAction = &Actions.back();
SizeAction = TargetAsmInfo::getSLEB128Size(PrevAction->NextAction) +
TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
SizeAction = MCAsmInfo::getSLEB128Size(PrevAction->NextAction) +
MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
for (unsigned j = NumShared; j != SizePrevIds; ++j) {
SizeAction -=
TargetAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
MCAsmInfo::getSLEB128Size(PrevAction->ValueForTypeID);
SizeAction += -PrevAction->NextAction;
PrevAction = PrevAction->Previous;
}
@@ -344,10 +344,10 @@ ComputeActionsTable(const SmallVectorImpl<const LandingPadInfo*> &LandingPads,
int TypeID = TypeIds[J];
assert(-1 - TypeID < (int)FilterOffsets.size() && "Unknown filter id!");
int ValueForTypeID = TypeID < 0 ? FilterOffsets[-1 - TypeID] : TypeID;
unsigned SizeTypeID = TargetAsmInfo::getSLEB128Size(ValueForTypeID);
unsigned SizeTypeID = MCAsmInfo::getSLEB128Size(ValueForTypeID);
int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0;
SizeAction = SizeTypeID + TargetAsmInfo::getSLEB128Size(NextAction);
SizeAction = SizeTypeID + MCAsmInfo::getSLEB128Size(NextAction);
SizeSiteActions += SizeAction;
ActionEntry Action = { ValueForTypeID, NextAction, PrevAction };
@@ -556,22 +556,22 @@ void DwarfException::EmitExceptionTable() {
SizeSites = CallSites.size() *
(SiteStartSize + SiteLengthSize + LandingPadSize);
for (unsigned i = 0, e = CallSites.size(); i < e; ++i) {
SizeSites += TargetAsmInfo::getULEB128Size(CallSites[i].Action);
SizeSites += MCAsmInfo::getULEB128Size(CallSites[i].Action);
if (TAI->getExceptionHandlingType() == ExceptionHandling::SjLj)
SizeSites += TargetAsmInfo::getULEB128Size(i);
SizeSites += MCAsmInfo::getULEB128Size(i);
}
// Type infos.
const unsigned TypeInfoSize = TD->getPointerSize(); // DW_EH_PE_absptr
unsigned SizeTypes = TypeInfos.size() * TypeInfoSize;
unsigned TypeOffset = sizeof(int8_t) + // Call site format
TargetAsmInfo::getULEB128Size(SizeSites) + // Call-site table length
MCAsmInfo::getULEB128Size(SizeSites) + // Call-site table length
SizeSites + SizeActions + SizeTypes;
unsigned TotalSize = sizeof(int8_t) + // LPStart format
sizeof(int8_t) + // TType format
(HaveTTData ?
TargetAsmInfo::getULEB128Size(TypeOffset) : 0) + // TType base offset
MCAsmInfo::getULEB128Size(TypeOffset) : 0) + // TType base offset
TypeOffset;
unsigned SizeAlign = (4 - TotalSize) & 3;

View File

@@ -24,7 +24,7 @@ namespace llvm {
struct LandingPadInfo;
class MachineModuleInfo;
class TargetAsmInfo;
class MCAsmInfo;
class Timer;
class raw_ostream;
@@ -164,7 +164,7 @@ public:
//===--------------------------------------------------------------------===//
// Main entry points.
//
DwarfException(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T);
DwarfException(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T);
virtual ~DwarfException();
/// BeginModule - Emit all exception information that should come prior to the

View File

@@ -19,14 +19,14 @@
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/Support/Dwarf.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetFrameInfo.h"
#include "llvm/Target/TargetRegisterInfo.h"
using namespace llvm;
Dwarf::Dwarf(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T,
Dwarf::Dwarf(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T,
const char *flavor)
: O(OS), Asm(A), TAI(T), TD(Asm->TM.getTargetData()),
RI(Asm->TM.getRegisterInfo()), M(NULL), MF(NULL), MMI(NULL),

View File

@@ -25,7 +25,7 @@ namespace llvm {
class MachineFunction;
class MachineModuleInfo;
class Module;
class TargetAsmInfo;
class MCAsmInfo;
class TargetData;
class TargetRegisterInfo;
@@ -45,7 +45,7 @@ namespace llvm {
/// TAI - Target asm information.
///
const TargetAsmInfo *TAI;
const MCAsmInfo *TAI;
/// TD - Target data.
///
@@ -80,7 +80,7 @@ namespace llvm {
///
unsigned SetCounter;
Dwarf(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T,
Dwarf(raw_ostream &OS, AsmPrinter *A, const MCAsmInfo *T,
const char *flavor);
public:
//===------------------------------------------------------------------===//
@@ -88,7 +88,7 @@ namespace llvm {
//
const AsmPrinter *getAsm() const { return Asm; }
MachineModuleInfo *getMMI() const { return MMI; }
const TargetAsmInfo *getTargetAsmInfo() const { return TAI; }
const MCAsmInfo *getMCAsmInfo() const { return TAI; }
const TargetData *getTargetData() const { return TD; }
void PrintRelDirective(bool Force32Bit = false,

View File

@@ -39,7 +39,7 @@ DwarfWriter::~DwarfWriter() {
void DwarfWriter::BeginModule(Module *M,
MachineModuleInfo *MMI,
raw_ostream &OS, AsmPrinter *A,
const TargetAsmInfo *T) {
const MCAsmInfo *T) {
DE = new DwarfException(OS, A, T);
DD = new DwarfDebug(OS, A, T);
DE->BeginModule(M, MMI);

View File

@@ -16,7 +16,7 @@
#include "llvm/CodeGen/GCMetadataPrinter.h"
#include "llvm/Module.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h"
@@ -30,10 +30,10 @@ namespace {
class VISIBILITY_HIDDEN OcamlGCMetadataPrinter : public GCMetadataPrinter {
public:
void beginAssembly(raw_ostream &OS, AsmPrinter &AP,
const TargetAsmInfo &TAI);
const MCAsmInfo &TAI);
void finishAssembly(raw_ostream &OS, AsmPrinter &AP,
const TargetAsmInfo &TAI);
const MCAsmInfo &TAI);
};
}
@@ -44,7 +44,7 @@ Y("ocaml", "ocaml 3.10-compatible collector");
void llvm::linkOcamlGCPrinter() { }
static void EmitCamlGlobal(const Module &M, raw_ostream &OS, AsmPrinter &AP,
const TargetAsmInfo &TAI, const char *Id) {
const MCAsmInfo &TAI, const char *Id) {
const std::string &MId = M.getModuleIdentifier();
std::string Mangled;
@@ -64,7 +64,7 @@ static void EmitCamlGlobal(const Module &M, raw_ostream &OS, AsmPrinter &AP,
}
void OcamlGCMetadataPrinter::beginAssembly(raw_ostream &OS, AsmPrinter &AP,
const TargetAsmInfo &TAI) {
const MCAsmInfo &TAI) {
AP.OutStreamer.SwitchSection(AP.getObjFileLowering().getTextSection());
EmitCamlGlobal(getModule(), OS, AP, TAI, "code_begin");
@@ -89,7 +89,7 @@ void OcamlGCMetadataPrinter::beginAssembly(raw_ostream &OS, AsmPrinter &AP,
/// either condition is detected in a function which uses the GC.
///
void OcamlGCMetadataPrinter::finishAssembly(raw_ostream &OS, AsmPrinter &AP,
const TargetAsmInfo &TAI) {
const MCAsmInfo &TAI) {
const char *AddressDirective;
int AddressAlignLog;
if (AP.TM.getTargetData()->getPointerSize() == sizeof(int32_t)) {