diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2011-07-09 05:47:46 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2011-07-09 05:47:46 +0000 |
| commit | 91111d270614d072e7d96bd695a1daef808775a8 (patch) | |
| tree | 90f0922eb8e4b79dc6cf36f2b7d5ea59e99fbbf5 /llvm/lib/Target/Alpha/AlphaSubtarget.cpp | |
| parent | 0081892d335b22f2d3b0b92071f7e7fc9d0172ec (diff) | |
| download | llvm-91111d270614d072e7d96bd695a1daef808775a8.zip llvm-91111d270614d072e7d96bd695a1daef808775a8.tar.gz llvm-91111d270614d072e7d96bd695a1daef808775a8.tar.bz2 | |
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.
llvm-svn: 134795
Diffstat (limited to 'llvm/lib/Target/Alpha/AlphaSubtarget.cpp')
| -rw-r--r-- | llvm/lib/Target/Alpha/AlphaSubtarget.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Target/Alpha/AlphaSubtarget.cpp b/llvm/lib/Target/Alpha/AlphaSubtarget.cpp index 75f5d8b..ccdc490 100644 --- a/llvm/lib/Target/Alpha/AlphaSubtarget.cpp +++ b/llvm/lib/Target/Alpha/AlphaSubtarget.cpp @@ -13,6 +13,7 @@ #include "AlphaSubtarget.h" #include "Alpha.h" +#include "llvm/Target/TargetRegistry.h" #define GET_SUBTARGETINFO_ENUM #define GET_SUBTARGETINFO_MC_DESC @@ -35,3 +36,15 @@ AlphaSubtarget::AlphaSubtarget(const std::string &TT, const std::string &CPU, // Initialize scheduling itinerary for the specified CPU. InstrItins = getInstrItineraryForCPU(CPUName); } + +MCSubtargetInfo *createAlphaMCSubtargetInfo(StringRef TT, StringRef CPU, + StringRef FS) { + MCSubtargetInfo *X = new MCSubtargetInfo(); + InitAlphaMCSubtargetInfo(X, CPU, FS); + return X; +} + +extern "C" void LLVMInitializeAlphaMCSubtargetInfo() { + TargetRegistry::RegisterMCSubtargetInfo(TheAlphaTarget, + createAlphaMCSubtargetInfo); +} |
