diff --git a/THIRDPARTY.md b/THIRDPARTY.md index 32ef8eacd9ce4..9112c3e6278ad 100644 --- a/THIRDPARTY.md +++ b/THIRDPARTY.md @@ -6,7 +6,6 @@ for exceptions. - [crc32c.c](https://stackoverflow.com/questions/17645167/implementing-sse-4-2s-crc32c-in-software) (CRC-32c checksum code by Mark Adler) [[ZLib](https://opensource.org/licenses/Zlib)]. - [LDC](https://github.com/ldc-developers/ldc/blob/master/LICENSE) (for ccall/cfunction ABI definitions) [BSD-3]. The portion of code that Julia uses from LDC is [BSD-3] licensed. - [LLVM](https://releases.llvm.org/3.9.0/LICENSE.TXT) (for parts of src/disasm.cpp) [UIUC] -- [MUSL](https://git.musl-libc.org/cgit/musl/tree/COPYRIGHT) (for src/getopt.c and src/getopt.h) [MIT] - [MINGW](https://sourceforge.net/p/mingw/mingw-org-wsl/ci/legacy/tree/mingwrt/mingwex/dirname.c) (for dirname implementation on Windows) [MIT] - [NetBSD](https://www.netbsd.org/about/redistribution.html) (for setjmp, longjmp, and strptime implementations on Windows) [BSD-3] - [Python](https://docs.python.org/3/license.html) (for strtod implementation on Windows) [PSF] diff --git a/contrib/add_license_to_files.jl b/contrib/add_license_to_files.jl index 5f8fa65c143eb..9650422ee07ca 100644 --- a/contrib/add_license_to_files.jl +++ b/contrib/add_license_to_files.jl @@ -46,8 +46,6 @@ const skipfiles = [ "../src/abi_x86.cpp", "../src/abi_x86_64.cpp", "../src/disasm.cpp", - "../src/getopt.c", - "../src/getopt.h", "../src/support/END.h", "../src/support/ENTRY.amd64.h", "../src/support/ENTRY.i387.h", diff --git a/src/aotcompile.cpp b/src/aotcompile.cpp index be5739a1ada3b..ffd43ee8d48d7 100644 --- a/src/aotcompile.cpp +++ b/src/aotcompile.cpp @@ -58,24 +58,11 @@ namespace llvm { #include "jitlayers.h" #include "julia_assert.h" -// MSVC's link.exe requires each function declaration to have a Comdat section -// So rather than litter the code with conditionals, -// all global values that get emitted call this function -// and it decides whether the definition needs a Comdat section and adds the appropriate declaration template // for GlobalObject's static T *addComdat(T *G) { #if defined(_OS_WINDOWS_) if (!G->isDeclaration()) { - // Add comdat information to make MSVC link.exe happy - // it's valid to emit this for ld.exe too, - // but makes it very slow to link for no benefit -#if defined(_COMPILER_MICROSOFT_) - Comdat *jl_Comdat = G->getParent()->getOrInsertComdat(G->getName()); - // ELF only supports Comdat::Any - jl_Comdat->setSelectionKind(Comdat::NoDuplicates); - G->setComdat(jl_Comdat); -#endif // add __declspec(dllexport) to everything marked for export if (G->getLinkage() == GlobalValue::ExternalLinkage) G->setDLLStorageClass(GlobalValue::DLLExportStorageClass); diff --git a/src/ast.c b/src/ast.c index 7859d9fcdbc6d..ba326ee19560e 100644 --- a/src/ast.c +++ b/src/ast.c @@ -19,13 +19,6 @@ extern "C" { #endif -// MSVC complains about "julia_flisp.boot.inc : error C4335: Mac file format -// detected: please convert the source file to either DOS or UNIX format" -#ifdef _MSC_VER -#pragma warning(disable:4335) -#endif - - // head symbols for each expression type JL_DLLEXPORT jl_sym_t *jl_call_sym; JL_DLLEXPORT jl_sym_t *jl_invoke_sym; diff --git a/src/ccalltest.c b/src/ccalltest.c index b83a9a2c9615c..64a6a3aabfb0b 100644 --- a/src/ccalltest.c +++ b/src/ccalltest.c @@ -40,11 +40,7 @@ int c_int = 0; int xs[300] = {0,0,0,1,0}; //int testUcharX(unsigned char x); -#ifdef _COMPILER_MICROSOFT_ -int __declspec(noinline) -#else int __attribute__((noinline)) -#endif DLLEXPORT testUcharX(unsigned char x) { return xs[x]; } diff --git a/src/clangsa/GCChecker.cpp b/src/clangsa/GCChecker.cpp index 79f09046451bc..38bd012ff46fc 100644 --- a/src/clangsa/GCChecker.cpp +++ b/src/clangsa/GCChecker.cpp @@ -19,9 +19,6 @@ #if defined(__GNUC__) #define USED_FUNC __attribute__((used)) -#elif defined(_COMPILER_MICROSOFT_) -// Does MSVC have this? -#define USED_FUNC #else #define USED_FUNC #endif diff --git a/src/codegen.cpp b/src/codegen.cpp index fe2156f317466..b09eb8db04e07 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -137,10 +137,6 @@ extern void _chkstk(void); #endif } -#if defined(_COMPILER_MICROSOFT_) && !defined(__alignof__) -#define __alignof__ __alignof -#endif - // llvm state extern JITEventListener *CreateJuliaJITEventListener(); diff --git a/src/crc32c.c b/src/crc32c.c index 8bc9b0c23381b..1e57d8aef85db 100644 --- a/src/crc32c.c +++ b/src/crc32c.c @@ -80,7 +80,7 @@ JL_UNUSED static inline uint32_t crc32c_shift(const uint32_t zeros[][256], uint3 zeros[2][(crc >> 16) & 0xff] ^ zeros[3][crc >> 24]; } -#if (defined(_CPU_X86_64_) || defined(_CPU_X86_)) && !defined(_COMPILER_MICROSOFT_) +#if defined(_CPU_X86_64_) || defined(_CPU_X86_) # ifdef _CPU_X86_64_ # define CRC32_PTR "crc32q" # else diff --git a/src/dlload.c b/src/dlload.c index f9e4ba857b1f8..e6f08d205fdbe 100644 --- a/src/dlload.c +++ b/src/dlload.c @@ -58,17 +58,7 @@ static int endswith_extension(const char *path) JL_NOTSAFEPOINT } #ifdef _OS_WINDOWS_ -#ifdef _MSC_VER -#if (_MSC_VER >= 1930) || (_MSC_VER < 1800) -#error This version of MSVC has not been tested. -#elif _MSC_VER >= 1900 // VC++ 2015 / 2017 / 2019 -#define CRTDLL_BASENAME "vcruntime140" -#elif _MSC_VER >= 1800 // VC++ 2013 -#define CRTDLL_BASENAME "msvcr120" -#endif -#else #define CRTDLL_BASENAME "msvcrt" -#endif JL_DLLEXPORT const char *jl_crtdll_basename = CRTDLL_BASENAME; const char *jl_crtdll_name = CRTDLL_BASENAME ".dll"; diff --git a/src/dump.c b/src/dump.c index be6d312f9b8e1..84ab325bd08a1 100644 --- a/src/dump.c +++ b/src/dump.c @@ -16,11 +16,7 @@ #include #endif -#ifndef _COMPILER_MICROSOFT_ #include "valgrind.h" -#else -#define RUNNING_ON_VALGRIND 0 -#endif #include "julia_assert.h" #ifdef __cplusplus diff --git a/src/gc.h b/src/gc.h index 74eaf483f8451..8b420d28cffbc 100644 --- a/src/gc.h +++ b/src/gc.h @@ -11,9 +11,7 @@ #include #include -#ifndef _MSC_VER #include -#endif #include #include "julia.h" #include "julia_threads.h" @@ -376,13 +374,7 @@ unsigned ffs_u32(uint32_t bitvec) JL_NOTSAFEPOINT; #else STATIC_INLINE unsigned ffs_u32(uint32_t bitvec) { -#if defined(_COMPILER_MICROSOFT_) - unsigned long j; - _BitScanForward(&j, bitvec); - return j; -#else return __builtin_ffs(bitvec) - 1; -#endif } #endif diff --git a/src/getopt.c b/src/getopt.c deleted file mode 100644 index 1170ecb5c9a0a..0000000000000 --- a/src/getopt.c +++ /dev/null @@ -1,147 +0,0 @@ -/* This file is adapted from musl-libc ----------------------------------------------------------------------- -Copyright © 2005-2014 Rich Felker, et al. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- -*/ - -#include -#include -#include -#include -#include -#include -#include "getopt.h" - -char *optarg; -int optind=1, opterr=1, optopt, __optpos, __optreset=0; - -#define optpos __optpos - -int getopt(int argc, char * const argv[], const char *optstring) -{ - int i; - wchar_t c, d; - int k, l; - char *optchar; - - if (!optind || __optreset) { - __optreset = 0; - __optpos = 0; - optind = 1; - } - - if (optind >= argc || !argv[optind] || argv[optind][0] != '-' || !argv[optind][1]) - return -1; - if (argv[optind][1] == '-' && !argv[optind][2]) - return optind++, -1; - - if (!optpos) optpos++; - if ((k = mbtowc(&c, argv[optind]+optpos, MB_LEN_MAX)) < 0) { - k = 1; - c = 0xfffd; /* replacement char */ - } - optchar = argv[optind]+optpos; - optopt = c; - optpos += k; - - if (!argv[optind][optpos]) { - optind++; - optpos = 0; - } - - for (i=0; (l = mbtowc(&d, optstring+i, MB_LEN_MAX)) && d!=c; i+=l>0?l:1); - - if (d != c) { - if (optstring[0] != ':' && opterr) { - fprintf(stderr, "%s: illegal option: %c\n", argv[0], optchar); - } - return '?'; - } - if (optstring[i+1] == ':') { - if (optind >= argc) { - if (optstring[0] == ':') return ':'; - if (opterr) { - fprintf(stderr, "%s: option requires an argument: %c\n", argv[0], optchar); - } - return '?'; - } - if (optstring[i+2] == ':') optarg = 0; - if (optstring[i+2] != ':' || optpos) { - optarg = argv[optind++] + optpos; - optpos = 0; - } - } - return c; -} - -static int __getopt_long(int argc, char *const *argv, const char *optstring, const struct option *longopts, int *idx, int longonly) -{ - if (!optind || __optreset) { - __optreset = 0; - __optpos = 0; - optind = 1; - } - if (optind >= argc || !argv[optind] || argv[optind][0] != '-') return -1; - if ((longonly && argv[optind][1]) || - (argv[optind][1] == '-' && argv[optind][2])) - { - int i; - for (i=0; longopts[i].name; i++) { - const char *name = longopts[i].name; - char *opt = argv[optind]+1; - if (*opt == '-') opt++; - for (; *name && *name == *opt; name++, opt++); - if (*name || (*opt && *opt != '=')) continue; - if (*opt == '=') { - if (!longopts[i].has_arg) continue; - optarg = opt+1; - } else { - if (longopts[i].has_arg == required_argument) { - if (!(optarg = argv[++optind])) - return ':'; - } else optarg = NULL; - } - optind++; - if (idx) *idx = i; - if (longopts[i].flag) { - *longopts[i].flag = longopts[i].val; - return 0; - } - return longopts[i].val; - } - if (argv[optind][1] == '-') { - optind++; - return '?'; - } - } - return getopt(argc, argv, optstring); -} - -int getopt_long(int argc, char *const *argv, const char *optstring, const struct option *longopts, int *idx) -{ - return __getopt_long(argc, argv, optstring, longopts, idx, 0); -} - -int getopt_long_only(int argc, char *const *argv, const char *optstring, const struct option *longopts, int *idx) -{ - return __getopt_long(argc, argv, optstring, longopts, idx, 1); -} diff --git a/src/getopt.h b/src/getopt.h deleted file mode 100644 index 7bcf5fb94d40e..0000000000000 --- a/src/getopt.h +++ /dev/null @@ -1,56 +0,0 @@ -/* This file is adapted from musl-libc ----------------------------------------------------------------------- -Copyright © 2005-2014 Rich Felker, et al. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- -*/ - -#ifndef _GETOPT_H -#define _GETOPT_H - -#ifdef __cplusplus -extern "C" { -#endif - -int getopt(int, char * const [], const char *); -extern char *optarg; -extern int optind, opterr, optopt; - -struct option -{ - const char *name; - int has_arg; - int *flag; - int val; -}; - -int getopt_long(int, char *const *, const char *, const struct option *, int *); -int getopt_long_only(int, char *const *, const char *, const struct option *, int *); - -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/init.c b/src/init.c index d13d70e255f38..1eb2cccd73d68 100644 --- a/src/init.c +++ b/src/init.c @@ -34,11 +34,7 @@ extern "C" { #endif -#ifdef _MSC_VER -JL_DLLEXPORT char *dirname(char *); -#else #include -#endif #ifdef _OS_WINDOWS_ extern int needsSymRefreshModuleList; diff --git a/src/ircode.c b/src/ircode.c index 408301734b576..279e458728e24 100644 --- a/src/ircode.c +++ b/src/ircode.c @@ -14,11 +14,7 @@ #include #endif -#ifndef _COMPILER_MICROSOFT_ #include "valgrind.h" -#else -#define RUNNING_ON_VALGRIND 0 -#endif #include "julia_assert.h" #ifdef __cplusplus diff --git a/src/jl_uv.c b/src/jl_uv.c index 530aa08ddc457..2c9c129d7bbf6 100644 --- a/src/jl_uv.c +++ b/src/jl_uv.c @@ -22,11 +22,6 @@ #include "support/ios.h" #include "uv.h" -#if defined(_COMPILER_MICROSOFT_) && !defined(write) -#include -#define write _write -#endif - #include "julia_assert.h" #ifdef __cplusplus diff --git a/src/jloptions.c b/src/jloptions.c index 294fb7dd39aef..31c4995eaa598 100644 --- a/src/jloptions.c +++ b/src/jloptions.c @@ -5,12 +5,8 @@ #include "julia.h" -#ifndef _MSC_VER #include #include -#else -#include "getopt.h" -#endif #include "julia_assert.h" #ifdef _OS_WINDOWS_ diff --git a/src/julia.h b/src/julia.h index 59c4ac9b5116b..e6a039b238080 100644 --- a/src/julia.h +++ b/src/julia.h @@ -63,15 +63,6 @@ # define JL_USED_FUNC __attribute__((used)) # define JL_SECTION(name) __attribute__((section(name))) # define JL_THREAD_LOCAL __thread -#elif defined(_COMPILER_MICROSOFT_) -# define JL_NORETURN __declspec(noreturn) -// This is the closest I can find for __attribute__((const)) -# define JL_CONST_FUNC __declspec(noalias) -// Does MSVC have this? -# define JL_USED_FUNC -// TODO: Figure out what to do on MSVC -# define JL_SECTION(x) -# define JL_THREAD_LOCAL __declspec(threaD) #else # define JL_NORETURN # define JL_CONST_FUNC diff --git a/src/julia_atomics.h b/src/julia_atomics.h index 80ac85acfb9f2..1f1a7a46cc9b6 100644 --- a/src/julia_atomics.h +++ b/src/julia_atomics.h @@ -190,9 +190,8 @@ extern "C" { # define jl_atomic_store_relaxed(obj, val) \ atomic_store_explicit(obj, val, memory_order_relaxed) -# if defined(__clang__) || defined(__ICC) || defined(__INTEL_COMPILER) || \ - !(defined(_CPU_X86_) || defined(_CPU_X86_64_)) -// ICC and Clang doesn't have this bug... +# if defined(__clang__) || !(defined(_CPU_X86_) || defined(_CPU_X86_64_)) +// Clang doesn't have this bug... # define jl_atomic_store_release(obj, val) \ atomic_store_explicit(obj, val, memory_order_release) # else diff --git a/src/julia_internal.h b/src/julia_internal.h index a0fc62305c632..884af72feb51c 100644 --- a/src/julia_internal.h +++ b/src/julia_internal.h @@ -160,11 +160,7 @@ static inline uint64_t cycleclock(void) extern JL_DLLEXPORT _Atomic(uint8_t) jl_measure_compile_time_enabled; extern JL_DLLEXPORT _Atomic(uint64_t) jl_cumulative_compile_time; -#ifdef _COMPILER_MICROSOFT_ -# define jl_return_address() ((uintptr_t)_ReturnAddress()) -#else -# define jl_return_address() ((uintptr_t)__builtin_return_address(0)) -#endif +#define jl_return_address() ((uintptr_t)__builtin_return_address(0)) STATIC_INLINE uint32_t jl_int32hash_fast(uint32_t a) { diff --git a/src/llvm-multiversioning.cpp b/src/llvm-multiversioning.cpp index a9aca5575e96b..bc467ec12bff2 100644 --- a/src/llvm-multiversioning.cpp +++ b/src/llvm-multiversioning.cpp @@ -848,15 +848,6 @@ template inline T *CloneCtx::add_comdat(T *G) const { #if defined(_OS_WINDOWS_) - // Add comdat information to make MSVC link.exe happy - // it's valid to emit this for ld.exe too, - // but makes it very slow to link for no benefit -#if defined(_COMPILER_MICROSOFT_) - Comdat *jl_Comdat = G->getParent()->getOrInsertComdat(G->getName()); - // ELF only supports Comdat::Any - jl_Comdat->setSelectionKind(Comdat::NoDuplicates); - G->setComdat(jl_Comdat); -#endif // add __declspec(dllexport) to everything marked for export if (G->getLinkage() == GlobalValue::ExternalLinkage) G->setDLLStorageClass(GlobalValue::DLLExportStorageClass); diff --git a/src/llvm-ptls.cpp b/src/llvm-ptls.cpp index fe19006095640..c971774f23e6c 100644 --- a/src/llvm-ptls.cpp +++ b/src/llvm-ptls.cpp @@ -160,15 +160,6 @@ template inline T *LowerPTLS::add_comdat(T *G) const { #if defined(_OS_WINDOWS_) - // Add comdat information to make MSVC link.exe happy - // it's valid to emit this for ld.exe too, - // but makes it very slow to link for no benefit -#if defined(_COMPILER_MICROSOFT_) - Comdat *jl_Comdat = G->getParent()->getOrInsertComdat(G->getName()); - // ELF only supports Comdat::Any - jl_Comdat->setSelectionKind(Comdat::NoDuplicates); - G->setComdat(jl_Comdat); -#endif // add __declspec(dllexport) to everything marked for export if (G->getLinkage() == GlobalValue::ExternalLinkage) G->setDLLStorageClass(GlobalValue::DLLExportStorageClass); diff --git a/src/processor_x86.cpp b/src/processor_x86.cpp index 8d3c7df091510..1184d54e3e85a 100644 --- a/src/processor_x86.cpp +++ b/src/processor_x86.cpp @@ -6,9 +6,6 @@ extern "C" JL_DLLEXPORT void jl_cpuid(int32_t CPUInfo[4], int32_t InfoType) { -#if defined _MSC_VER - __cpuid(CPUInfo, InfoType); -#else asm volatile ( #if defined(__i386__) && defined(__PIC__) "xchg %%ebx, %%esi;" @@ -24,14 +21,10 @@ extern "C" JL_DLLEXPORT void jl_cpuid(int32_t CPUInfo[4], int32_t InfoType) "=d" (CPUInfo[3]) : "a" (InfoType) ); -#endif } extern "C" JL_DLLEXPORT void jl_cpuidex(int32_t CPUInfo[4], int32_t InfoType, int32_t subInfoType) { -#if defined _MSC_VER - __cpuidex(CPUInfo, InfoType, subInfoType); -#else asm volatile ( #if defined(__i386__) && defined(__PIC__) "xchg %%ebx, %%esi;" @@ -48,7 +41,6 @@ extern "C" JL_DLLEXPORT void jl_cpuidex(int32_t CPUInfo[4], int32_t InfoType, in "a" (InfoType), "c" (subInfoType) ); -#endif } namespace X86 { @@ -298,13 +290,9 @@ const int SIG_AMD = 0x68747541; // Auth static uint64_t get_xcr0(void) { -#if defined _MSC_VER - return _xgetbv(_XCR_XFEATURE_ENABLED_MASK); -#else uint32_t eax, edx; asm volatile ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0)); return (uint64_t(edx) << 32) | eax; -#endif } static CPU get_intel_processor_name(uint32_t family, uint32_t model, uint32_t brand_id, diff --git a/src/staticdata.c b/src/staticdata.c index c18aa1fef9d06..341f1a7e8c983 100644 --- a/src/staticdata.c +++ b/src/staticdata.c @@ -16,11 +16,7 @@ #include #endif -#ifndef _COMPILER_MICROSOFT_ #include "valgrind.h" -#else -#define RUNNING_ON_VALGRIND 0 -#endif #include "julia_assert.h" #ifdef __cplusplus diff --git a/src/support/END.h b/src/support/END.h index ec7b75d397b88..3a7c3ac00a9ac 100644 --- a/src/support/END.h +++ b/src/support/END.h @@ -36,14 +36,10 @@ #if defined(__linux__) || defined(__FreeBSD__) || defined(__ELF__) .size CNAME, . - CNAME #else -#ifdef _MSC_VER -CNAME endp -#else #ifdef _WIN64 .seh_endproc #endif #endif -#endif #undef CNAME diff --git a/src/support/ENTRY.amd64.h b/src/support/ENTRY.amd64.h index f18caa502ac5c..d4decb98e973a 100644 --- a/src/support/ENTRY.amd64.h +++ b/src/support/ENTRY.amd64.h @@ -51,7 +51,6 @@ EXT(CNAME): #define EXT_(csym) csym #define EXT(csym) EXT_(csym) -#ifndef _MSC_VER .intel_syntax noprefix .text _START_ENTRY @@ -67,9 +66,5 @@ _START_ENTRY .seh_proc EXT(CNAME) EXT(CNAME): .seh_endprologue -#else -.code -CNAME proc -#endif #endif diff --git a/src/support/ENTRY.i387.h b/src/support/ENTRY.i387.h index cb7b93466cc3e..7a857f22f855b 100644 --- a/src/support/ENTRY.i387.h +++ b/src/support/ENTRY.i387.h @@ -51,7 +51,6 @@ EXT(CNAME): #define EXT_(csym) _##csym #define EXT(csym) EXT_(csym) -#ifndef _MSC_VER .intel_syntax .text _START_ENTRY @@ -64,11 +63,5 @@ _START_ENTRY .type 32 .endef EXT(CNAME): -#else -.586 -.model small,C -.code -CNAME proc -#endif #endif diff --git a/src/support/MurmurHash3.c b/src/support/MurmurHash3.c index 94069eab02732..fce7351f90ffe 100644 --- a/src/support/MurmurHash3.c +++ b/src/support/MurmurHash3.c @@ -12,23 +12,6 @@ //----------------------------------------------------------------------------- // Platform-specific functions and macros -// Microsoft Visual Studio - -#if defined(_MSC_VER) - -#define FORCE_INLINE __forceinline - -#include - -#define ROTL32(x,y) _rotl(x,y) -#define ROTL64(x,y) _rotl64(x,y) - -#define BIG_CONSTANT(x) (x) - -// Other compilers - -#else // defined(_MSC_VER) - #define FORCE_INLINE inline __attribute__((always_inline)) static inline uint32_t rotl32 ( uint32_t x, int8_t r ) @@ -46,8 +29,6 @@ static inline uint64_t rotl64 ( uint64_t x, int8_t r ) #define BIG_CONSTANT(x) (x##LLU) -#endif // !defined(_MSC_VER) - //----------------------------------------------------------------------------- // Finalization mix - force all bits of a hash block to avalanche diff --git a/src/support/dirpath.h b/src/support/dirpath.h index 0657cc26de0b1..36b24d0001c78 100644 --- a/src/support/dirpath.h +++ b/src/support/dirpath.h @@ -6,7 +6,7 @@ #ifdef _OS_WINDOWS_ #define PATHSEPSTRING "\\" #define PATHLISTSEPSTRING ";" -#if defined(_MSC_VER) || defined(_COMPILER_CLANG_) +#if defined(_COMPILER_CLANG_) #define PATH_MAX MAX_PATH #endif #else diff --git a/src/support/dtypes.h b/src/support/dtypes.h index 7f2a7b2e6ad4a..a7e544542188d 100644 --- a/src/support/dtypes.h +++ b/src/support/dtypes.h @@ -10,11 +10,7 @@ #include #include #include -#if defined(_COMPILER_INTEL_) -#include -#else #include -#endif #include "platform.h" #include "analyzer_annotations.h" @@ -108,13 +104,7 @@ #define LLT_REALLOC(p,n) realloc((p),(n)) #define LLT_FREE(x) free(x) -#if defined(_OS_WINDOWS_) && defined(_COMPILER_INTEL_) -# define STATIC_INLINE static -#elif defined(_OS_WINDOWS_) && defined(_COMPILER_MICROSOFT_) -# define STATIC_INLINE static __inline -#else -# define STATIC_INLINE static inline -#endif +#define STATIC_INLINE static inline #if defined(_OS_WINDOWS_) && !defined(_COMPILER_GCC_) # define NOINLINE __declspec(noinline) @@ -124,13 +114,7 @@ # define NOINLINE_DECL(f) f __attribute__((noinline)) #endif -#ifdef _COMPILER_MICROSOFT_ -# ifdef _P64 -# define JL_ATTRIBUTE_ALIGN_PTRSIZE(x) __declspec(align(8)) x -# else -# define JL_ATTRIBUTE_ALIGN_PTRSIZE(x) __declspec(align(4)) x -# endif -#elif defined(__GNUC__) +#if defined(__GNUC__) # define JL_ATTRIBUTE_ALIGN_PTRSIZE(x) x __attribute__ ((aligned (sizeof(void*)))) #else # define JL_ATTRIBUTE_ALIGN_PTRSIZE(x) @@ -148,20 +132,6 @@ __builtin_assume(!!(cond_)); \ cond_; \ })) -#elif defined(_COMPILER_MICROSOFT_) && defined(__cplusplus) -template -static inline T -jl_assume(T v) -{ - __assume(!!v); - return v; -} -#elif defined(_COMPILER_INTEL_) -#define jl_assume(cond) (__extension__ ({ \ - __typeof__(cond) cond_ = (cond); \ - __assume(!!(cond_)); \ - cond_; \ - })) #elif defined(__GNUC__) static inline void jl_assume_(int cond) { @@ -180,12 +150,6 @@ static inline void jl_assume_(int cond) #if jl_has_builtin(__builtin_assume_aligned) || defined(_COMPILER_GCC_) #define jl_assume_aligned(ptr, align) __builtin_assume_aligned(ptr, align) -#elif defined(_COMPILER_INTEL_) -#define jl_assume_aligned(ptr, align) (__extension__ ({ \ - __typeof__(ptr) ptr_ = (ptr); \ - __assume_aligned(ptr_, align); \ - ptr_; \ - })) #elif defined(__GNUC__) #define jl_assume_aligned(ptr, align) (__extension__ ({ \ __typeof__(ptr) ptr_ = (ptr); \ diff --git a/src/support/platform.h b/src/support/platform.h index 8d29b44a92f8f..bb960f54d3c4e 100644 --- a/src/support/platform.h +++ b/src/support/platform.h @@ -14,8 +14,6 @@ * Compiler: * _COMPILER_CLANG_ * _COMPILER_GCC_ - * _COMPILER_INTEL_ - * _COMPILER_MICROSOFT_ * OS: * _OS_FREEBSD_ * _OS_LINUX_ @@ -35,19 +33,12 @@ * Compiler * *******************************************************************************/ -/* - * Note: Checking for Intel's compiler should be done before checking for - * Microsoft's. On Windows Intel's compiler also defines _MSC_VER as the - * acknowledgement of the fact that it is integrated with Visual Studio. - */ #if defined(__clang__) #define _COMPILER_CLANG_ -#elif defined(__INTEL_COMPILER) || defined(__ICC) -#define _COMPILER_INTEL_ -#elif defined(_MSC_VER) -#define _COMPILER_MICROSOFT_ #elif defined(__GNUC__) #define _COMPILER_GCC_ +#else +#error Unsupported compiler #endif #if defined(__has_feature) // Clang flavor diff --git a/src/support/utils.h b/src/support/utils.h index 4d77a1bb9fb9b..95e0b9f607fc3 100644 --- a/src/support/utils.h +++ b/src/support/utils.h @@ -33,14 +33,6 @@ int cmp_eq(void *a, numerictype_t atag, void *b, numerictype_t btag, #define bswap_16(x) __builtin_bswap16(x) #define bswap_32(x) __builtin_bswap32(x) #define bswap_64(x) __builtin_bswap64(x) -#elif defined(_MSC_VER) -#define bswap_16(x) _byteswap_ushort(x) -#define bswap_32(x) _byteswap_ulong(x) -#define bswap_64(x) _byteswap_uint64(x) -#elif defined(__INTEL_COMPILER) -#define bswap_16(x) _bswap16(x) -#define bswap_32(x) _bswap(x) -#define bswap_64(x) _bswap64(x) #else #define bswap_16(x) (((x) & 0x00ff) << 8 | ((x) & 0xff00) >> 8) #define bswap_32(x) \ diff --git a/src/sys.c b/src/sys.c index 0dff9825a7cf0..3719d0faccb99 100644 --- a/src/sys.c +++ b/src/sys.c @@ -48,11 +48,6 @@ #include #endif -#if defined _MSC_VER -#include -#include -#endif - #ifdef _COMPILER_MSAN_ENABLED_ #include #endif @@ -688,7 +683,7 @@ JL_DLLEXPORT jl_value_t *jl_environ(int i) // -- child process status -- -#if defined _MSC_VER || defined _OS_WINDOWS_ +#if defined _OS_WINDOWS_ /* Native Woe32 API. */ #include #define waitpid(pid,statusp,options) _cwait (statusp, pid, WAIT_CHILD) diff --git a/src/win32_ucontext.c b/src/win32_ucontext.c index df50eb209341e..de3cec5b778e5 100644 --- a/src/win32_ucontext.c +++ b/src/win32_ucontext.c @@ -26,11 +26,9 @@ JL_DLLEXPORT EXCEPTION_DISPOSITION NTAPI __julia_personality( EXCEPTION_DISPOSITION rval; switch (jl_exception_handler(&ExceptionInfo)) { -#ifndef _MSC_VER case EXCEPTION_EXECUTE_HANDLER: rval = ExceptionExecuteHandler; break; -#endif case EXCEPTION_CONTINUE_EXECUTION: rval = ExceptionContinueExecution; break;