Commit 54e39742 by Sergey Ulanov

Fix compiler warnings when compiling swiftshader for Fuchsia

LLVM_DEFAULT_TARGET_TRIPLE was defined in config.h and llvm-config.h, which was causing warnings when compiling it for Fuchsia. Also made some other cleanups in llvm-config.h, particularly removed i386 and arm ifdefs. There are still some other warnings not fixed in this CL ('using namespace' in headers), but these don't look Fuchsia-specific. Bug: 881334 Change-Id: Iaf54e622e9d31553268afe960d6330dcb5920321 Reviewed-on: https://swiftshader-review.googlesource.com/c/21689Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarSergey Ulanov <sergeyu@chromium.org>
parent 847fc0b2
...@@ -22,13 +22,9 @@ ...@@ -22,13 +22,9 @@
/* Target triple LLVM will generate code for by default */ /* Target triple LLVM will generate code for by default */
#if defined(__x86_64__) #if defined(__x86_64__)
#define LLVM_DEFAULT_TARGET_TRIPLE "x86_64-unknown-linux-gnu" #define LLVM_DEFAULT_TARGET_TRIPLE "x86_64-unknown-fuchsia"
#elif defined(__i386__)
#define LLVM_DEFAULT_TARGET_TRIPLE "i686-pc-linux-gnu"
#elif defined(__arm__)
#define LLVM_DEFAULT_TARGET_TRIPLE "armv7-linux-gnueabihf"
#elif defined(__aarch64__) #elif defined(__aarch64__)
#define LLVM_DEFAULT_TARGET_TRIPLE "aarch64-linux-gnu" #define LLVM_DEFAULT_TARGET_TRIPLE "aarch64-unknown-fuchsia"
#else #else
#error "unknown architecture" #error "unknown architecture"
#endif #endif
...@@ -41,13 +37,9 @@ ...@@ -41,13 +37,9 @@
/* Host triple LLVM will be executed on */ /* Host triple LLVM will be executed on */
#if defined(__x86_64__) #if defined(__x86_64__)
#define LLVM_HOST_TRIPLE "x86_64-unknown-linux-gnu" #define LLVM_HOST_TRIPLE "x86_64-unknown-fuchsia"
#elif defined(__i386__)
#define LLVM_HOST_TRIPLE "i686-pc-linux-gnu"
#elif defined(__arm__)
#define LLVM_HOST_TRIPLE "armv7-linux-gnueabihf"
#elif defined(__aarch64__) #elif defined(__aarch64__)
#define LLVM_HOST_TRIPLE "aarch64-linux-gnu" #define LLVM_HOST_TRIPLE "aarch64-unknown-fuchsia"
#else #else
#error "unknown architecture" #error "unknown architecture"
#endif #endif
...@@ -55,9 +47,7 @@ ...@@ -55,9 +47,7 @@
/* LLVM architecture name for the native architecture, if available */ /* LLVM architecture name for the native architecture, if available */
#if defined(__aarch64__) #if defined(__aarch64__)
#define LLVM_NATIVE_ARCH AArch64 #define LLVM_NATIVE_ARCH AArch64
#elif defined(__arm__) #elif defined(__x86_64__)
#define LLVM_NATIVE_ARCH ARM
#elif defined(__i386__) || defined(__x86_64__)
#define LLVM_NATIVE_ARCH X86 #define LLVM_NATIVE_ARCH X86
#else #else
#error "unknown architecture" #error "unknown architecture"
...@@ -66,9 +56,7 @@ ...@@ -66,9 +56,7 @@
/* LLVM name for the native AsmParser init function, if available */ /* LLVM name for the native AsmParser init function, if available */
#if defined(__aarch64__) #if defined(__aarch64__)
#define LLVM_NATIVE_ASMPARSER LLVMInitializeAArch64AsmParser #define LLVM_NATIVE_ASMPARSER LLVMInitializeAArch64AsmParser
#elif defined(__arm__) #elif defined(__x86_64__)
#define LLVM_NATIVE_ASMPARSER LLVMInitializeARMAsmParser
#elif defined(__i386__) || defined(__x86_64__)
#define LLVM_NATIVE_ASMPARSER LLVMInitializeX86AsmParser #define LLVM_NATIVE_ASMPARSER LLVMInitializeX86AsmParser
#else #else
#error "unknown architecture" #error "unknown architecture"
...@@ -79,7 +67,7 @@ ...@@ -79,7 +67,7 @@
#define LLVM_NATIVE_ASMPRINTER LLVMInitializeAArch64AsmPrinter #define LLVM_NATIVE_ASMPRINTER LLVMInitializeAArch64AsmPrinter
#elif defined(__arm__) #elif defined(__arm__)
#define LLVM_NATIVE_ASMPRINTER LLVMInitializeARMAsmPrinter #define LLVM_NATIVE_ASMPRINTER LLVMInitializeARMAsmPrinter
#elif defined(__i386__) || defined(__x86_64__) #elif defined(__x86_64__)
#define LLVM_NATIVE_ASMPRINTER LLVMInitializeX86AsmPrinter #define LLVM_NATIVE_ASMPRINTER LLVMInitializeX86AsmPrinter
#else #else
#error "unknown architecture" #error "unknown architecture"
...@@ -88,9 +76,7 @@ ...@@ -88,9 +76,7 @@
/* LLVM name for the native Disassembler init function, if available */ /* LLVM name for the native Disassembler init function, if available */
#if defined(__aarch64__) #if defined(__aarch64__)
#define LLVM_NATIVE_DISASSEMBLER LLVMInitializeAArch64Disassembler #define LLVM_NATIVE_DISASSEMBLER LLVMInitializeAArch64Disassembler
#elif defined(__arm__) #elif defined(__x86_64__)
#define LLVM_NATIVE_DISASSEMBLER LLVMInitializeARMDisassembler
#elif defined(__i386__) || defined(__x86_64__)
#define LLVM_NATIVE_DISASSEMBLER LLVMInitializeX86Disassembler #define LLVM_NATIVE_DISASSEMBLER LLVMInitializeX86Disassembler
#else #else
#error "unknown architecture" #error "unknown architecture"
...@@ -99,9 +85,7 @@ ...@@ -99,9 +85,7 @@
/* LLVM name for the native Target init function, if available */ /* LLVM name for the native Target init function, if available */
#if defined(__aarch64__) #if defined(__aarch64__)
#define LLVM_NATIVE_TARGET LLVMInitializeAArch64Target #define LLVM_NATIVE_TARGET LLVMInitializeAArch64Target
#elif defined(__arm__) #elif defined(__x86_64__)
#define LLVM_NATIVE_TARGET LLVMInitializeARMTarget
#elif defined(__i386__) || defined(__x86_64__)
#define LLVM_NATIVE_TARGET LLVMInitializeX86Target #define LLVM_NATIVE_TARGET LLVMInitializeX86Target
#else #else
#error "unknown architecture" #error "unknown architecture"
...@@ -110,9 +94,7 @@ ...@@ -110,9 +94,7 @@
/* LLVM name for the native TargetInfo init function, if available */ /* LLVM name for the native TargetInfo init function, if available */
#if defined(__aarch64__) #if defined(__aarch64__)
#define LLVM_NATIVE_TARGETINFO LLVMInitializeAArch64TargetInfo #define LLVM_NATIVE_TARGETINFO LLVMInitializeAArch64TargetInfo
#elif defined(__arm__) #elif defined(__x86_64__)
#define LLVM_NATIVE_TARGETINFO LLVMInitializeARMTargetInfo
#elif defined(__i386__) || defined(__x86_64__)
#define LLVM_NATIVE_TARGETINFO LLVMInitializeX86TargetInfo #define LLVM_NATIVE_TARGETINFO LLVMInitializeX86TargetInfo
#else #else
#error "unknown architecture" #error "unknown architecture"
...@@ -121,9 +103,7 @@ ...@@ -121,9 +103,7 @@
/* LLVM name for the native target MC init function, if available */ /* LLVM name for the native target MC init function, if available */
#if defined(__aarch64__) #if defined(__aarch64__)
#define LLVM_NATIVE_TARGETMC LLVMInitializeAArch64TargetMC #define LLVM_NATIVE_TARGETMC LLVMInitializeAArch64TargetMC
#elif defined(__arm__) #elif defined(__x86_64__)
#define LLVM_NATIVE_TARGETMC LLVMInitializeARMTargetMC
#elif defined(__i386__) || defined(__x86_64__)
#define LLVM_NATIVE_TARGETMC LLVMInitializeX86TargetMC #define LLVM_NATIVE_TARGETMC LLVMInitializeX86TargetMC
#else #else
#error "unknown architecture" #error "unknown architecture"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment