summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2015-11-05 19:28:16 +0000
committerDan Gohman <dan433584@gmail.com>2015-11-05 19:28:16 +0000
commite9361d58ffb72aa18522c93cab0c6b5e8441a247 (patch)
tree77515b15ba5bbda485c36c7a0741a92a7a3f1f25 /llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp
parent35dfc95efe730be455996970586d055795bdffa1 (diff)
downloadbcm5719-llvm-e9361d58ffb72aa18522c93cab0c6b5e8441a247.tar.gz
bcm5719-llvm-e9361d58ffb72aa18522c93cab0c6b5e8441a247.zip
[WebAssembly] Add WebAssemblyMCInstLower.cpp.
This isn't used yet; it's just a start towards eventually using MC to do instruction printing, and eventually binary encoding. llvm-svn: 252194
Diffstat (limited to 'llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp
index 0644fd80bdf..fcd4c293f63 100644
--- a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp
+++ b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp
@@ -40,6 +40,12 @@ static MCAsmInfo *createWebAssemblyMCAsmInfo(const MCRegisterInfo &MRI,
return new WebAssemblyMCAsmInfo(TT);
}
+static MCInstrInfo *createWebAssemblyMCInstrInfo() {
+ MCInstrInfo *X = new MCInstrInfo();
+ InitWebAssemblyMCInstrInfo(X);
+ return X;
+}
+
static MCInstPrinter *
createWebAssemblyMCInstPrinter(const Triple &T, unsigned SyntaxVariant,
const MCAsmInfo &MAI, const MCInstrInfo &MII,
@@ -54,6 +60,9 @@ extern "C" void LLVMInitializeWebAssemblyTargetMC() {
// Register the MC asm info.
RegisterMCAsmInfoFn X(*T, createWebAssemblyMCAsmInfo);
+ // Register the MC instruction info.
+ TargetRegistry::RegisterMCInstrInfo(*T, createWebAssemblyMCInstrInfo);
+
// Register the MCInstPrinter.
TargetRegistry::RegisterMCInstPrinter(*T, createWebAssemblyMCInstPrinter);
}
OpenPOWER on IntegriCloud