Reduce large list of macros to the primary platform macros. Distingiush

between ELF (Linux, FreeBSD, NetBSD) and OSX as platform for the
assembler dialect.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186252 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Joerg Sonnenberger 2013-07-13 17:59:55 +00:00
parent 61a0bac2be
commit 0a14e71232

View File

@ -71,8 +71,11 @@ static void EmitBranchToAt(uint64_t At, uint64_t To, bool isCall, bool is64Bit){
extern "C" void PPC32CompilationCallback();
extern "C" void PPC64CompilationCallback();
#if (defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)) && \
!(defined(__ppc64__) || defined(__FreeBSD__))
#if !defined(__ppc__) || defined(__ppc64__)
void PPC32CompilationCallback() {
llvm_unreachable("This is not a 32bit PowerPC, you can't execute this!");
}
#elif !defined(__ELF__)
// CompilationCallback stub - We can't use a C function with inline assembly in
// it, because we the prolog/epilog inserted by GCC won't work for us. Instead,
// write our own wrapper, which does things our way, so we have complete control
@ -137,8 +140,8 @@ asm(
"bctr\n"
);
#elif defined(__PPC__) && !defined(__ppc64__)
// Linux & FreeBSD / PPC 32 support
#else
// ELF PPC 32 support
// CompilationCallback stub - We can't use a C function with inline assembly in
// it, because we the prolog/epilog inserted by GCC won't work for us. Instead,
@ -197,14 +200,13 @@ asm(
"mtlr 0\n"
"bctr\n"
);
#else
void PPC32CompilationCallback() {
llvm_unreachable("This is not a power pc, you can't execute this!");
}
#endif
#if (defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)) && \
defined(__ppc64__)
#ifndef __ppc64__
void PPC64CompilationCallback() {
llvm_unreachable("This is not a 64bit PowerPC, you can't execute this!");
}
#else
# ifdef __ELF__
asm(
".text\n"
@ -285,10 +287,6 @@ asm(
// XXX: any special TOC handling in the ELF case for JIT?
"bctr\n"
);
#else
void PPC64CompilationCallback() {
llvm_unreachable("This is not a power pc, you can't execute this!");
}
#endif
extern "C" {