mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-24 08:24:33 +00:00
Change createAsmParser to take a MCSubtargetInfo instead of triple,
CPU, and feature string. Parsing some asm directives can change subtarget state (e.g. .code 16) and it must be reflected in other modules (e.g. MCCodeEmitter). That is, the MCSubtargetInfo instance must be shared. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134795 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
|
||||
#include "MipsSubtarget.h"
|
||||
#include "Mips.h"
|
||||
#include "llvm/Target/TargetRegistry.h"
|
||||
|
||||
#define GET_SUBTARGETINFO_ENUM
|
||||
#define GET_SUBTARGETINFO_MC_DESC
|
||||
@ -61,3 +62,15 @@ MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &CPU,
|
||||
HasCondMov = true;
|
||||
}
|
||||
}
|
||||
|
||||
MCSubtargetInfo *createMipsMCSubtargetInfo(StringRef TT, StringRef CPU,
|
||||
StringRef FS) {
|
||||
MCSubtargetInfo *X = new MCSubtargetInfo();
|
||||
InitMipsMCSubtargetInfo(X, CPU, FS);
|
||||
return X;
|
||||
}
|
||||
|
||||
extern "C" void LLVMInitializeMipsMCSubtargetInfo() {
|
||||
TargetRegistry::RegisterMCSubtargetInfo(TheMipsTarget,
|
||||
createMipsMCSubtargetInfo);
|
||||
}
|
||||
|
Reference in New Issue
Block a user