aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-07-14 23:50:31 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-07-14 23:50:31 +0000
commit1abf2cb59b8d63415780a03329307c0997b2670c (patch)
tree40bd0acf3a26bd3417cfc81af3ef5f22631d7903
parente696436a7ef32d892e3f76f38e84146dacc232b5 (diff)
Rename createAsmInfo to createMCAsmInfo and move registration code to MCTargetDesc to prepare for next round of changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135219 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--autoconf/configure.ac3
-rwxr-xr-xcmake/config-ix.cmake1
-rwxr-xr-xconfigure6
-rw-r--r--include/llvm-c/Target.h6
-rw-r--r--include/llvm/Config/config.h.cmake3
-rw-r--r--include/llvm/Config/config.h.in3
-rw-r--r--include/llvm/Config/llvm-config.h.cmake3
-rw-r--r--include/llvm/Config/llvm-config.h.in3
-rw-r--r--include/llvm/Target/TargetRegistry.h44
-rw-r--r--include/llvm/Target/TargetSelect.h16
-rw-r--r--lib/CodeGen/LLVMTargetMachine.cpp2
-rw-r--r--lib/MC/MCDisassembler/Disassembler.cpp3
-rw-r--r--lib/MC/MCDisassembler/EDDisassembler.cpp3
-rw-r--r--lib/Target/ARM/ARMTargetMachine.cpp14
-rw-r--r--lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp (renamed from lib/Target/ARM/ARMMCAsmInfo.cpp)0
-rw-r--r--lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.h (renamed from lib/Target/ARM/ARMMCAsmInfo.h)0
-rw-r--r--lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp42
-rw-r--r--lib/Target/Alpha/AlphaTargetMachine.cpp2
-rw-r--r--lib/Target/Alpha/MCTargetDesc/AlphaMCAsmInfo.cpp (renamed from lib/Target/Alpha/AlphaMCAsmInfo.cpp)0
-rw-r--r--lib/Target/Alpha/MCTargetDesc/AlphaMCAsmInfo.h (renamed from lib/Target/Alpha/AlphaMCAsmInfo.h)0
-rw-r--r--lib/Target/Alpha/MCTargetDesc/AlphaMCTargetDesc.cpp12
-rw-r--r--lib/Target/Alpha/MCTargetDesc/CMakeLists.txt5
-rw-r--r--lib/Target/Blackfin/BlackfinTargetMachine.cpp3
-rw-r--r--lib/Target/Blackfin/MCTargetDesc/BlackfinMCAsmInfo.cpp (renamed from lib/Target/Blackfin/BlackfinMCAsmInfo.cpp)0
-rw-r--r--lib/Target/Blackfin/MCTargetDesc/BlackfinMCAsmInfo.h (renamed from lib/Target/Blackfin/BlackfinMCAsmInfo.h)0
-rw-r--r--lib/Target/Blackfin/MCTargetDesc/BlackfinMCTargetDesc.cpp12
-rw-r--r--lib/Target/Blackfin/MCTargetDesc/CMakeLists.txt5
-rw-r--r--lib/Target/CBackend/CBackend.cpp14
-rw-r--r--lib/Target/CellSPU/CMakeLists.txt1
-rw-r--r--lib/Target/CellSPU/MCTargetDesc/CMakeLists.txt5
-rw-r--r--lib/Target/CellSPU/MCTargetDesc/SPUMCAsmInfo.cpp (renamed from lib/Target/CellSPU/SPUMCAsmInfo.cpp)0
-rw-r--r--lib/Target/CellSPU/MCTargetDesc/SPUMCAsmInfo.h (renamed from lib/Target/CellSPU/SPUMCAsmInfo.h)0
-rw-r--r--lib/Target/CellSPU/MCTargetDesc/SPUMCTargetDesc.cpp11
-rw-r--r--lib/Target/CellSPU/SPUTargetMachine.cpp2
-rw-r--r--lib/Target/CppBackend/CPPBackend.cpp3
-rw-r--r--lib/Target/MBlaze/CMakeLists.txt1
-rw-r--r--lib/Target/MBlaze/MBlazeTargetMachine.cpp12
-rw-r--r--lib/Target/MBlaze/MCTargetDesc/CMakeLists.txt5
-rw-r--r--lib/Target/MBlaze/MCTargetDesc/MBlazeMCAsmInfo.cpp (renamed from lib/Target/MBlaze/MBlazeMCAsmInfo.cpp)0
-rw-r--r--lib/Target/MBlaze/MCTargetDesc/MBlazeMCAsmInfo.h (renamed from lib/Target/MBlaze/MBlazeMCAsmInfo.h)0
-rw-r--r--lib/Target/MBlaze/MCTargetDesc/MBlazeMCTargetDesc.cpp19
-rw-r--r--lib/Target/MSP430/CMakeLists.txt1
-rw-r--r--lib/Target/MSP430/MCTargetDesc/CMakeLists.txt5
-rw-r--r--lib/Target/MSP430/MCTargetDesc/MSP430MCAsmInfo.cpp (renamed from lib/Target/MSP430/MSP430MCAsmInfo.cpp)0
-rw-r--r--lib/Target/MSP430/MCTargetDesc/MSP430MCAsmInfo.h (renamed from lib/Target/MSP430/MSP430MCAsmInfo.h)0
-rw-r--r--lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp11
-rw-r--r--lib/Target/MSP430/MSP430AsmPrinter.cpp2
-rw-r--r--lib/Target/MSP430/MSP430TargetMachine.cpp2
-rw-r--r--lib/Target/Mips/CMakeLists.txt1
-rw-r--r--lib/Target/Mips/MCTargetDesc/CMakeLists.txt5
-rw-r--r--lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp (renamed from lib/Target/Mips/MipsMCAsmInfo.cpp)0
-rw-r--r--lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.h (renamed from lib/Target/Mips/MipsMCAsmInfo.h)0
-rw-r--r--lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp12
-rw-r--r--lib/Target/Mips/MipsTargetMachine.cpp3
-rw-r--r--lib/Target/PTX/CMakeLists.txt1
-rw-r--r--lib/Target/PTX/MCTargetDesc/CMakeLists.txt5
-rw-r--r--lib/Target/PTX/MCTargetDesc/PTXMCAsmInfo.cpp (renamed from lib/Target/PTX/PTXMCAsmInfo.cpp)0
-rw-r--r--lib/Target/PTX/MCTargetDesc/PTXMCAsmInfo.h (renamed from lib/Target/PTX/PTXMCAsmInfo.h)0
-rw-r--r--lib/Target/PTX/MCTargetDesc/PTXMCTargetDesc.cpp12
-rw-r--r--lib/Target/PTX/PTXTargetMachine.cpp4
-rw-r--r--lib/Target/PowerPC/CMakeLists.txt1
-rw-r--r--lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt5
-rw-r--r--lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp (renamed from lib/Target/PowerPC/PPCMCAsmInfo.cpp)0
-rw-r--r--lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.h (renamed from lib/Target/PowerPC/PPCMCAsmInfo.h)0
-rw-r--r--lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp21
-rw-r--r--lib/Target/PowerPC/PPCTargetMachine.cpp13
-rw-r--r--lib/Target/Sparc/CMakeLists.txt1
-rw-r--r--lib/Target/Sparc/MCTargetDesc/CMakeLists.txt5
-rw-r--r--lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp (renamed from lib/Target/Sparc/SparcMCAsmInfo.cpp)0
-rw-r--r--lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.h (renamed from lib/Target/Sparc/SparcMCAsmInfo.h)0
-rw-r--r--lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp12
-rw-r--r--lib/Target/Sparc/SparcTargetMachine.cpp5
-rw-r--r--lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp (renamed from lib/Target/SystemZ/SystemZMCAsmInfo.cpp)0
-rw-r--r--lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.h (renamed from lib/Target/SystemZ/SystemZMCAsmInfo.h)0
-rw-r--r--lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp12
-rw-r--r--lib/Target/SystemZ/SystemZTargetMachine.cpp2
-rw-r--r--lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp (renamed from lib/Target/X86/X86MCAsmInfo.cpp)0
-rw-r--r--lib/Target/X86/MCTargetDesc/X86MCAsmInfo.h (renamed from lib/Target/X86/X86MCAsmInfo.h)0
-rw-r--r--lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp49
-rw-r--r--lib/Target/X86/X86MCInstLower.cpp2
-rw-r--r--lib/Target/X86/X86TargetMachine.cpp21
-rw-r--r--lib/Target/XCore/MCTargetDesc/XCoreMCAsmInfo.cpp (renamed from lib/Target/XCore/XCoreMCAsmInfo.cpp)0
-rw-r--r--lib/Target/XCore/MCTargetDesc/XCoreMCAsmInfo.h (renamed from lib/Target/XCore/XCoreMCAsmInfo.h)0
-rw-r--r--lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp11
-rw-r--r--lib/Target/XCore/XCoreAsmPrinter.cpp2
-rw-r--r--lib/Target/XCore/XCoreTargetMachine.cpp2
-rw-r--r--tools/llc/llc.cpp1
-rw-r--r--tools/llvm-mc/Disassembler.cpp2
-rw-r--r--tools/llvm-mc/llvm-mc.cpp5
-rw-r--r--tools/llvm-objdump/llvm-objdump.cpp3
-rw-r--r--tools/lto/LTOCodeGenerator.cpp1
-rw-r--r--tools/lto/LTOModule.cpp1
92 files changed, 304 insertions, 201 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 47b48bf660..18890f6e1f 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -658,6 +658,7 @@ for a_target in $TARGETS_TO_BUILD; do
[LLVM architecture name for the native architecture, if available])
LLVM_NATIVE_TARGET="LLVMInitialize${LLVM_NATIVE_ARCH}Target"
LLVM_NATIVE_TARGETINFO="LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo"
+ LLVM_NATIVE_MCASMINFO="LLVMInitialize${LLVM_NATIVE_ARCH}MCAsmInfo"
LLVM_NATIVE_ASMPRINTER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter"
if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/Makefile ; then
LLVM_NATIVE_ASMPARSER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser"
@@ -666,6 +667,8 @@ for a_target in $TARGETS_TO_BUILD; do
[LLVM name for the native Target init function, if available])
AC_DEFINE_UNQUOTED(LLVM_NATIVE_TARGETINFO, $LLVM_NATIVE_TARGETINFO,
[LLVM name for the native TargetInfo init function, if available])
+ AC_DEFINE_UNQUOTED(LLVM_NATIVE_MCASMINFO, $LLVM_NATIVE_MCASMINFO,
+ [LLVM name for the native MCAsmInfo init function, if available])
AC_DEFINE_UNQUOTED(LLVM_NATIVE_ASMPRINTER, $LLVM_NATIVE_ASMPRINTER,
[LLVM name for the native AsmPrinter init function, if available])
if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/Makefile ; then
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 1a2cba528f..46f33de8d7 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -336,6 +336,7 @@ else ()
message(STATUS "Native target architecture is ${LLVM_NATIVE_ARCH}")
set(LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target)
set(LLVM_NATIVE_TARGETINFO LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo)
+ set(LLVM_NATIVE_MCASMINFO LLVMInitialize${LLVM_NATIVE_ARCH}MCAsmInfo)
set(LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter)
endif ()
diff --git a/configure b/configure
index 7d16620219..ae7fcd77a9 100755
--- a/configure
+++ b/configure
@@ -5120,6 +5120,7 @@ _ACEOF
LLVM_NATIVE_TARGET="LLVMInitialize${LLVM_NATIVE_ARCH}Target"
LLVM_NATIVE_TARGETINFO="LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo"
+ LLVM_NATIVE_MCASMINFO="LLVMInitialize${LLVM_NATIVE_ARCH}MCAsmInfo"
LLVM_NATIVE_ASMPRINTER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter"
if test -f ${srcdir}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/Makefile ; then
LLVM_NATIVE_ASMPARSER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser"
@@ -5136,6 +5137,11 @@ _ACEOF
cat >>confdefs.h <<_ACEOF
+#define LLVM_NATIVE_MCASMINFO $LLVM_NATIVE_MCASMINFO
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
#define LLVM_NATIVE_ASMPRINTER $LLVM_NATIVE_ASMPRINTER
_ACEOF
diff --git a/include/llvm-c/Target.h b/include/llvm-c/Target.h
index 2cd15c3fa3..0c45ae51ca 100644
--- a/include/llvm-c/Target.h
+++ b/include/llvm-c/Target.h
@@ -41,6 +41,11 @@ typedef struct LLVMStructLayout *LLVMStructLayoutRef;
#include "llvm/Config/Targets.def"
#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
+#define LLVM_TARGET(TargetName) \
+ void LLVMInitialize##TargetName##MCAsmInfo(void);
+#include "llvm/Config/Targets.def"
+#undef LLVM_TARGET /* Explicit undef to make SWIG happier */
+
/** LLVMInitializeAllTargetInfos - The main program should call this function if
it wants access to all available targets that LLVM is configured to
support. */
@@ -67,6 +72,7 @@ static inline LLVMBool LLVMInitializeNativeTarget(void) {
#ifdef LLVM_NATIVE_TARGET
LLVM_NATIVE_TARGETINFO();
LLVM_NATIVE_TARGET();
+ LLVM_NATIVE_MCASMINFO();
return 0;
#else
return 1;
diff --git a/include/llvm/Config/config.h.cmake b/include/llvm/Config/config.h.cmake
index d07e0b2e61..0b8a0add7e 100644
--- a/include/llvm/Config/config.h.cmake
+++ b/include/llvm/Config/config.h.cmake
@@ -557,6 +557,9 @@
/* LLVM name for the native TargetInfo init function, if available */
#cmakedefine LLVM_NATIVE_TARGETINFO LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo
+/* LLVM name for the native MCAsmInfo init function, if available */
+#cmakedefine LLVM_NATIVE_MCASMINFO LLVMInitialize${LLVM_NATIVE_ARCH}MCAsmInfo
+
/* Define if this is Unixish platform */
#cmakedefine LLVM_ON_UNIX ${LLVM_ON_UNIX}
diff --git a/include/llvm/Config/config.h.in b/include/llvm/Config/config.h.in
index 10a8935f56..0a716ea797 100644
--- a/include/llvm/Config/config.h.in
+++ b/include/llvm/Config/config.h.in
@@ -573,6 +573,9 @@
/* LLVM name for the native AsmPrinter init function, if available */
#undef LLVM_NATIVE_ASMPRINTER
+/* LLVM name for the native MCAsmInfo init function, if available */
+#undef LLVM_NATIVE_MCASMINFO
+
/* LLVM name for the native Target init function, if available */
#undef LLVM_NATIVE_TARGET
diff --git a/include/llvm/Config/llvm-config.h.cmake b/include/llvm/Config/llvm-config.h.cmake
index ee81f7a732..5f948a2ab1 100644
--- a/include/llvm/Config/llvm-config.h.cmake
+++ b/include/llvm/Config/llvm-config.h.cmake
@@ -58,6 +58,9 @@
/* LLVM name for the native TargetInfo init function, if available */
#cmakedefine LLVM_NATIVE_TARGETINFO LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo
+/* LLVM name for the native MCAsmInfo init function, if available */
+#cmakedefine LLVM_NATIVE_MCASMINFO LLVMInitialize${LLVM_NATIVE_ARCH}MCAsmInfo
+
/* LLVM name for the native AsmPrinter init function, if available */
#cmakedefine LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter
diff --git a/include/llvm/Config/llvm-config.h.in b/include/llvm/Config/llvm-config.h.in
index 4766a7a2b2..bc8ddce56f 100644
--- a/include/llvm/Config/llvm-config.h.in
+++ b/include/llvm/Config/llvm-config.h.in
@@ -58,6 +58,9 @@
/* LLVM name for the native TargetInfo init function, if available */
#undef LLVM_NATIVE_TARGETINFO
+/* LLVM name for the native MCAsmInfo init function, if available */
+#undef LLVM_NATIVE_MCASMINFO
+
/* LLVM name for the native AsmPrinter init function, if available */
#undef LLVM_NATIVE_ASMPRINTER
diff --git a/include/llvm/Target/TargetRegistry.h b/include/llvm/Target/TargetRegistry.h
index 671000554c..7e0ce19f8f 100644
--- a/include/llvm/Target/TargetRegistry.h
+++ b/include/llvm/Target/TargetRegistry.h
@@ -66,8 +66,8 @@ namespace llvm {
typedef unsigned (*TripleMatchQualityFnTy)(const std::string &TT);
- typedef MCAsmInfo *(*AsmInfoCtorFnTy)(const Target &T,
- StringRef TT);
+ typedef MCAsmInfo *(*MCAsmInfoCtorFnTy)(const Target &T,
+ StringRef TT);
typedef MCInstrInfo *(*MCInstrInfoCtorFnTy)(void);
typedef MCRegisterInfo *(*MCRegInfoCtorFnTy)(void);
typedef MCSubtargetInfo *(*MCSubtargetInfoCtorFnTy)(StringRef TT,
@@ -128,9 +128,9 @@ namespace llvm {
/// HasJIT - Whether this target supports the JIT.
bool HasJIT;
- /// AsmInfoCtorFn - Constructor function for this target's MCAsmInfo, if
+ /// MCAsmInfoCtorFn - Constructor function for this target's MCAsmInfo, if
/// registered.
- AsmInfoCtorFnTy AsmInfoCtorFn;
+ MCAsmInfoCtorFnTy MCAsmInfoCtorFn;
/// MCInstrInfoCtorFn - Constructor function for this target's MCInstrInfo,
/// if registered.
@@ -240,17 +240,17 @@ namespace llvm {
/// @name Feature Constructors
/// @{
- /// createAsmInfo - Create a MCAsmInfo implementation for the specified
+ /// createMCAsmInfo - Create a MCAsmInfo implementation for the specified
/// target triple.
///
/// \arg Triple - This argument is used to determine the target machine
/// feature set; it should always be provided. Generally this should be
/// either the target triple from the module, or the target triple of the
/// host if that does not exist.
- MCAsmInfo *createAsmInfo(StringRef Triple) const {
- if (!AsmInfoCtorFn)
+ MCAsmInfo *createMCAsmInfo(StringRef Triple) const {
+ if (!MCAsmInfoCtorFn)
return 0;
- return AsmInfoCtorFn(*this, Triple);
+ return MCAsmInfoCtorFn(*this, Triple);
}
/// createMCInstrInfo - Create a MCInstrInfo implementation.
@@ -485,7 +485,7 @@ namespace llvm {
Target::TripleMatchQualityFnTy TQualityFn,
bool HasJIT = false);
- /// RegisterAsmInfo - Register a MCAsmInfo implementation for the
+ /// RegisterMCAsmInfo - Register a MCAsmInfo implementation for the
/// given target.
///
/// Clients are responsible for ensuring that registration doesn't occur
@@ -494,10 +494,10 @@ namespace llvm {
///
/// @param T - The target being registered.
/// @param Fn - A function to construct a MCAsmInfo for the target.
- static void RegisterAsmInfo(Target &T, Target::AsmInfoCtorFnTy Fn) {
+ static void RegisterMCAsmInfo(Target &T, Target::MCAsmInfoCtorFnTy Fn) {
// Ignore duplicate registration.
- if (!T.AsmInfoCtorFn)
- T.AsmInfoCtorFn = Fn;
+ if (!T.MCAsmInfoCtorFn)
+ T.MCAsmInfoCtorFn = Fn;
}
/// RegisterMCInstrInfo - Register a MCInstrInfo implementation for the
@@ -722,18 +722,18 @@ namespace llvm {
}
};
- /// RegisterAsmInfo - Helper template for registering a target assembly info
+ /// RegisterMCAsmInfo - Helper template for registering a target assembly info
/// implementation. This invokes the static "Create" method on the class to
/// actually do the construction. Usage:
///
/// extern "C" void LLVMInitializeFooTarget() {
/// extern Target TheFooTarget;
- /// RegisterAsmInfo<FooMCAsmInfo> X(TheFooTarget);
+ /// RegisterMCAsmInfo<FooMCAsmInfo> X(TheFooTarget);
/// }
template<class MCAsmInfoImpl>
- struct RegisterAsmInfo {
- RegisterAsmInfo(Target &T) {
- TargetRegistry::RegisterAsmInfo(T, &Allocator);
+ struct RegisterMCAsmInfo {
+ RegisterMCAsmInfo(Target &T) {
+ TargetRegistry::RegisterMCAsmInfo(T, &Allocator);
}
private:
static MCAsmInfo *Allocator(const Target &T, StringRef TT) {
@@ -742,17 +742,17 @@ namespace llvm {
};
- /// RegisterAsmInfoFn - Helper template for registering a target assembly info
+ /// Register