summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/XCore/XCoreSubtarget.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-07-09 05:47:46 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-07-09 05:47:46 +0000
commit91111d270614d072e7d96bd695a1daef808775a8 (patch)
tree90f0922eb8e4b79dc6cf36f2b7d5ea59e99fbbf5 /llvm/lib/Target/XCore/XCoreSubtarget.cpp
parent0081892d335b22f2d3b0b92071f7e7fc9d0172ec (diff)
downloadbcm5719-llvm-91111d270614d072e7d96bd695a1daef808775a8.tar.gz
bcm5719-llvm-91111d270614d072e7d96bd695a1daef808775a8.zip
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/XCore/XCoreSubtarget.cpp')
-rw-r--r--llvm/lib/Target/XCore/XCoreSubtarget.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Target/XCore/XCoreSubtarget.cpp b/llvm/lib/Target/XCore/XCoreSubtarget.cpp
index 7d8fe8a10b2..8ede9366fc7 100644
--- a/llvm/lib/Target/XCore/XCoreSubtarget.cpp
+++ b/llvm/lib/Target/XCore/XCoreSubtarget.cpp
@@ -13,6 +13,7 @@
#include "XCoreSubtarget.h"
#include "XCore.h"
+#include "llvm/Target/TargetRegistry.h"
#define GET_SUBTARGETINFO_ENUM
#define GET_SUBTARGETINFO_MC_DESC
@@ -27,3 +28,16 @@ XCoreSubtarget::XCoreSubtarget(const std::string &TT,
: XCoreGenSubtargetInfo(TT, CPU, FS)
{
}
+
+
+MCSubtargetInfo *createXCoreMCSubtargetInfo(StringRef TT, StringRef CPU,
+ StringRef FS) {
+ MCSubtargetInfo *X = new MCSubtargetInfo();
+ InitXCoreMCSubtargetInfo(X, CPU, FS);
+ return X;
+}
+
+extern "C" void LLVMInitializeXCoreMCSubtargetInfo() {
+ TargetRegistry::RegisterMCSubtargetInfo(TheXCoreTarget,
+ createXCoreMCSubtargetInfo);
+}
OpenPOWER on IntegriCloud