summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Alpha/MCTargetDesc
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-07-22 21:58:54 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-07-22 21:58:54 +0000
commit8c886a40d2a28d770b2e6cd9ca831cf2078dbb75 (patch)
tree56cf55025c1d6fa600245cee21abd4fbfb6a2946 /llvm/lib/Target/Alpha/MCTargetDesc
parent2e3b0769da3a157f938ca12505269f2c41ab9227 (diff)
downloadbcm5719-llvm-8c886a40d2a28d770b2e6cd9ca831cf2078dbb75.tar.gz
bcm5719-llvm-8c886a40d2a28d770b2e6cd9ca831cf2078dbb75.zip
Combine all MC initialization routines into one. e.g. InitializeX86MCAsmInfo,
InitializeX86MCInstrInfo, etc. are combined into InitializeX86TargetMC. llvm-svn: 135812
Diffstat (limited to 'llvm/lib/Target/Alpha/MCTargetDesc')
-rw-r--r--llvm/lib/Target/Alpha/MCTargetDesc/AlphaMCTargetDesc.cpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/llvm/lib/Target/Alpha/MCTargetDesc/AlphaMCTargetDesc.cpp b/llvm/lib/Target/Alpha/MCTargetDesc/AlphaMCTargetDesc.cpp
index 517ab182830..d6f3e90d73d 100644
--- a/llvm/lib/Target/Alpha/MCTargetDesc/AlphaMCTargetDesc.cpp
+++ b/llvm/lib/Target/Alpha/MCTargetDesc/AlphaMCTargetDesc.cpp
@@ -36,20 +36,12 @@ static MCInstrInfo *createAlphaMCInstrInfo() {
return X;
}
-extern "C" void LLVMInitializeAlphaMCInstrInfo() {
- TargetRegistry::RegisterMCInstrInfo(TheAlphaTarget, createAlphaMCInstrInfo);
-}
-
static MCRegisterInfo *createAlphaMCRegisterInfo(StringRef TT) {
MCRegisterInfo *X = new MCRegisterInfo();
InitAlphaMCRegisterInfo(X, Alpha::R26);
return X;
}
-extern "C" void LLVMInitializeAlphaMCRegisterInfo() {
- TargetRegistry::RegisterMCRegInfo(TheAlphaTarget, createAlphaMCRegisterInfo);
-}
-
static MCSubtargetInfo *createAlphaMCSubtargetInfo(StringRef TT, StringRef CPU,
StringRef FS) {
MCSubtargetInfo *X = new MCSubtargetInfo();
@@ -57,15 +49,6 @@ static MCSubtargetInfo *createAlphaMCSubtargetInfo(StringRef TT, StringRef CPU,
return X;
}
-extern "C" void LLVMInitializeAlphaMCSubtargetInfo() {
- TargetRegistry::RegisterMCSubtargetInfo(TheAlphaTarget,
- createAlphaMCSubtargetInfo);
-}
-
-extern "C" void LLVMInitializeAlphaMCAsmInfo() {
- RegisterMCAsmInfo<AlphaMCAsmInfo> X(TheAlphaTarget);
-}
-
MCCodeGenInfo *createAlphaMCCodeGenInfo(StringRef TT, Reloc::Model RM,
CodeModel::Model CM) {
MCCodeGenInfo *X = new MCCodeGenInfo();
@@ -73,8 +56,22 @@ MCCodeGenInfo *createAlphaMCCodeGenInfo(StringRef TT, Reloc::Model RM,
return X;
}
-extern "C" void LLVMInitializeAlphaMCCodeGenInfo() {
+// Force static initialization.
+extern "C" void LLVMInitializeAlphaTargetMC() {
+ // Register the MC asm info.
+ RegisterMCAsmInfo<AlphaMCAsmInfo> X(TheAlphaTarget);
+
+ // Register the MC codegen info.
TargetRegistry::RegisterMCCodeGenInfo(TheAlphaTarget,
createAlphaMCCodeGenInfo);
-}
+ // Register the MC instruction info.
+ TargetRegistry::RegisterMCInstrInfo(TheAlphaTarget, createAlphaMCInstrInfo);
+
+ // Register the MC register info.
+ TargetRegistry::RegisterMCRegInfo(TheAlphaTarget, createAlphaMCRegisterInfo);
+
+ // Register the MC subtarget info.
+ TargetRegistry::RegisterMCSubtargetInfo(TheAlphaTarget,
+ createAlphaMCSubtargetInfo);
+}
OpenPOWER on IntegriCloud