From 2d28617de2b0b731c08d1af9e830f31e14ac75b4 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Mon, 18 Jul 2011 22:29:13 +0000 Subject: Move getInitialFrameState from TargetFrameInfo to MCAsmInfo (suggestions for better location welcome). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135438 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib/Target/XCore/MCTargetDesc') diff --git a/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp b/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp index a29f160d41..104170c328 100644 --- a/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp +++ b/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp @@ -61,6 +61,17 @@ extern "C" void LLVMInitializeXCoreMCSubtargetInfo() { createXCoreMCSubtargetInfo); } +static MCAsmInfo *createXCoreMCAsmInfo(const Target &T, StringRef TT) { + MCAsmInfo *MAI = new XCoreMCAsmInfo(T, TT); + + // Initial state of the frame pointer is SP. + MachineLocation Dst(MachineLocation::VirtualFP); + MachineLocation Src(XCore::SP, 0); + MAI->addInitialFrameState(0, Dst, Src); + + return MAI; +} + extern "C" void LLVMInitializeXCoreMCAsmInfo() { - RegisterMCAsmInfo X(TheXCoreTarget); + RegisterMCAsmInfoFn X(TheXCoreTarget, createXCoreMCAsmInfo); } -- cgit v1.2.3