summaryrefslogtreecommitdiff
path: root/tools/lto
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-07-18 20:57:22 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-07-18 20:57:22 +0000
commit0e6a052331f674dd70e28af41f654a7874405eab (patch)
tree5b2a153966b9f7585e2c882d1d34f97d108d54f2 /tools/lto
parent1360bc8eb029d51d426c77c4b1410849ff308893 (diff)
downloadllvm-0e6a052331f674dd70e28af41f654a7874405eab.tar.gz
llvm-0e6a052331f674dd70e28af41f654a7874405eab.tar.bz2
llvm-0e6a052331f674dd70e28af41f654a7874405eab.tar.xz
Sink getDwarfRegNum, getLLVMRegNum, getSEHRegNum from TargetRegisterInfo down
to MCRegisterInfo. Also initialize the mapping at construction time. This patch eliminate TargetRegisterInfo from TargetAsmInfo. It's another step towards fixing the layering violation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135424 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto')
-rw-r--r--tools/lto/LTOCodeGenerator.cpp5
-rw-r--r--tools/lto/LTOModule.cpp4
2 files changed, 7 insertions, 2 deletions
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp
index 68cd2bb939..3fce45677c 100644
--- a/tools/lto/LTOCodeGenerator.cpp
+++ b/tools/lto/LTOCodeGenerator.cpp
@@ -31,6 +31,7 @@
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h"
+#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/Target/TargetSelect.h"
#include "llvm/Support/CommandLine.h"
@@ -74,6 +75,7 @@ LTOCodeGenerator::LTOCodeGenerator()
{
InitializeAllTargets();
InitializeAllMCAsmInfos();
+ InitializeAllMCRegisterInfos();
InitializeAllMCSubtargetInfos();
InitializeAllAsmPrinters();
}
@@ -308,7 +310,8 @@ void LTOCodeGenerator::applyScopeRestrictions() {
passes.add(createVerifierPass());
// mark which symbols can not be internalized
- MCContext Context(*_target->getMCAsmInfo(), NULL);
+ MCContext Context(*_target->getMCAsmInfo(), *_target->getRegisterInfo(),
+ NULL);
Mangler mangler(Context, *_target->getTargetData());
std::vector<const char*> mustPreserveList;
SmallPtrSet<GlobalValue*, 8> asmUsed;
diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp
index dc99b94f04..92b2e9aa1a 100644
--- a/tools/lto/LTOModule.cpp
+++ b/tools/lto/LTOModule.cpp
@@ -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"
@@ -662,7 +663,8 @@ 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