Combine all MC initialization routines into one. e.g. InitializeX86MCAsmInfo,
[oota-llvm.git] / tools / lto / LTOModule.cpp
index dc99b94f04e6510c2ced22521add6cdf40702a91..c1f1be4e231cb8fbd1b14faee55d4cc84029ff89 100644 (file)
@@ -40,6 +40,7 @@
 #include "llvm/MC/SubtargetFeature.h"
 #include "llvm/Target/TargetAsmParser.h"
 #include "llvm/Target/TargetMachine.h"
+#include "llvm/Target/TargetRegisterInfo.h"
 #include "llvm/Target/TargetRegistry.h"
 #include "llvm/Target/TargetSelect.h"
 
@@ -135,8 +136,7 @@ LTOModule *LTOModule::makeLTOModule(MemoryBuffer *buffer,
   static bool Initialized = false;
   if (!Initialized) {
     InitializeAllTargets();
-    InitializeAllMCAsmInfos();
-    InitializeAllMCSubtargetInfos();
+    InitializeAllTargetMCs();
     InitializeAllAsmParsers();
     Initialized = true;
   }
@@ -662,7 +662,7 @@ static bool isAliasToDeclaration(const GlobalAlias &V) {
 
 bool LTOModule::ParseSymbols() {
   // Use mangler to add GlobalPrefix to names to match linker names.
-  MCContext Context(*_target->getMCAsmInfo(), NULL);
+  MCContext Context(*_target->getMCAsmInfo(), *_target->getRegisterInfo(),NULL);
   Mangler mangler(Context, *_target->getTargetData());
 
   // add functions