Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove MSVC / ICC specific code #42703

Merged
merged 1 commit into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion THIRDPARTY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 0 additions & 2 deletions contrib/add_license_to_files.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 0 additions & 13 deletions src/aotcompile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<class T> // 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);
Expand Down
7 changes: 0 additions & 7 deletions src/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions src/ccalltest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
3 changes: 0 additions & 3 deletions src/clangsa/GCChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,6 @@ extern void _chkstk(void);
#endif
}

#if defined(_COMPILER_MICROSOFT_) && !defined(__alignof__)
#define __alignof__ __alignof
#endif

// llvm state
extern JITEventListener *CreateJuliaJITEventListener();

Expand Down
2 changes: 1 addition & 1 deletion src/crc32c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions src/dlload.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 0 additions & 4 deletions src/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
#include <dlfcn.h>
#endif

#ifndef _COMPILER_MICROSOFT_
#include "valgrind.h"
#else
#define RUNNING_ON_VALGRIND 0
#endif
#include "julia_assert.h"

#ifdef __cplusplus
Expand Down
8 changes: 0 additions & 8 deletions src/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

#include <stdlib.h>
#include <string.h>
#ifndef _MSC_VER
#include <strings.h>
#endif
#include <inttypes.h>
#include "julia.h"
#include "julia_threads.h"
Expand Down Expand Up @@ -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

Expand Down
147 changes: 0 additions & 147 deletions src/getopt.c

This file was deleted.

56 changes: 0 additions & 56 deletions src/getopt.h

This file was deleted.

4 changes: 0 additions & 4 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@
extern "C" {
#endif

#ifdef _MSC_VER
JL_DLLEXPORT char *dirname(char *);
#else
#include <libgen.h>
#endif

#ifdef _OS_WINDOWS_
extern int needsSymRefreshModuleList;
Expand Down
4 changes: 0 additions & 4 deletions src/ircode.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@
#include <dlfcn.h>
#endif

#ifndef _COMPILER_MICROSOFT_
#include "valgrind.h"
#else
#define RUNNING_ON_VALGRIND 0
#endif
#include "julia_assert.h"

#ifdef __cplusplus
Expand Down
5 changes: 0 additions & 5 deletions src/jl_uv.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@
#include "support/ios.h"
#include "uv.h"

#if defined(_COMPILER_MICROSOFT_) && !defined(write)
#include <io.h>
#define write _write
#endif

#include "julia_assert.h"

#ifdef __cplusplus
Expand Down
Loading