[WebAsssembly] Register the MC register info.
authorDan Gohman <dan433584@gmail.com>
Tue, 12 Jan 2016 21:27:55 +0000 (21:27 +0000)
committerDan Gohman <dan433584@gmail.com>
Tue, 12 Jan 2016 21:27:55 +0000 (21:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257525 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp

index 160efdb..37000f1 100644 (file)
@@ -46,6 +46,12 @@ static MCInstrInfo *createMCInstrInfo() {
   return X;
 }
 
+static MCRegisterInfo *createMCRegisterInfo(const Triple & /*T*/) {
+  MCRegisterInfo *X = new MCRegisterInfo();
+  InitWebAssemblyMCRegisterInfo(X, 0);
+  return X;
+}
+
 static MCInstPrinter *createMCInstPrinter(const Triple & /*T*/,
                                           unsigned SyntaxVariant,
                                           const MCAsmInfo &MAI,
@@ -93,6 +99,9 @@ extern "C" void LLVMInitializeWebAssemblyTargetMC() {
     // Register the MC instruction info.
     TargetRegistry::RegisterMCInstrInfo(*T, createMCInstrInfo);
 
+    // Register the MC register info.
+    TargetRegistry::RegisterMCRegInfo(*T, createMCRegisterInfo);
+
     // Register the MCInstPrinter.
     TargetRegistry::RegisterMCInstPrinter(*T, createMCInstPrinter);