Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

gmh5225/llvm-msvc-compatibility

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

llvm-msvc-compatibility

This project was aimed to be used for llvm-msvc [link]

1.clang/lib/sema/SemaExpr.cpp

Problem:

if (StrStr(windows_name_, pInfo->windows_name_) > 0)

Patch

2.clang/include/clang/Lex/Preprocessor.h clang/lib/Lex/PPMacroExpansion.cpp

Problem:

printf(__FUNCTION__ "Hello, world!\n");

Patch

3.lld/COFF/Writer.cpp

Problem:

Fix the characteristics of some sections like ".voltbl". Or the program will be crash sometimes.

Patch

4.clang/lib/AST/ASTContext.cpp

Problem:

void OutputTrace(int place_holder, ...)
{
	va_list args;
	va_start(args, place_holder);
	bool unicode = va_arg(args, bool);
}

Patch

5.lld/COFF/Driver.cpp

Problem:

1>lld-link : error : could not open '/RELEASE': no such file or directory
1>lld-link : error : could not open '/kernel': no such file or directory
1>lld-link : error : could not open '/pdbcompress': no such file or directory

Patch

6.lld/COFF/SymbolTable.cpp

Problem:

1>lld-link : error : duplicate symbol: g_GlobalNotifyRecord
1>>>> defined at x64\Debug\Broadcast.obj
1>>>> defined at x64\Debug\Vpid.obj

Patch

7.clang/include/clang/Driver/Options.td

Problem:

Null ptr is invalid.

Patch

8.lld/COFF/Writer.cpp

Problem:

Unused IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE

Patch

9.llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp

Problem:

#define ZERO_MEMORY(addr,size) while (size-->0)\
								{\
									*addr++ = 0;\
								}\
->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
will be optimized to 'memset'.

Patch

10.clang/lib/Parse/ParseDecl.cpp clang/lib/Parse/ParseDecl.cpp

Problem:

template <typename R, typename... Args>
struct MyTestTemplate;

template <typename R, typename... Args>
struct MyTestTemplate<R(__stdcall)(Args...)>
{
};
->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
error : function cannot return function type 'R (Args...)'

Patch

11.clang/tools/driver/driver.cpp

Problem:

 __m128i x1, x2;
 __m128i x3 = _mm_shuffle_epi8(x1, x2);
 ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 _mm_shuffle_epi8 needs '-mssse3'

Patch

12.lld/COFF/Driver.cpp

Problem:

#pragma comment(linker, "/ALIGN:0x10000")
->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Error:/ALIGN: is not allowed in .drectve

Patch

13.clang\include\clang\Basic\DiagnosticSemaKinds.td

Problem:

error : invalid application of 'sizeof' to an incomplete type 'xxx'

Patch

14.clang\include\clang\Basic\DiagnosticSemaKinds.td

Problem:

error : static_cast from a to b, which are not related by inheritance, is not allowed

Patch

15.clang/lib/Lex/TokenLexer.cpp

Problem:

#define MY_TEST 6
#define TEST_222(major) (0x##major)
int
main()
{
    int test2 = TEST_222(MY_TEST);
    return 0;
}
->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
error : invalid suffix 'xMY_TEST' on integer constant

Patch

16.clang/lib/Basic/SourceManager.cpp

Problem:

1>util\log.c(492,10): fatal error : UTF-16 (LE) byte order mark detected in 'util/ioctl.inc', but encoding is not supported

Patch

17.clang/lib/Lex/TokenLexer.cpp

Problem:

#define DBGKP_FIELD_FROM_IMAGE_OPTIONAL_HEADER(hdrs, field) ((hdrs)->OptionalHeader.##field)
CreateThreadArgs->StartAddress = UlongToPtr(
                            DBGKP_FIELD_FROM_IMAGE_OPTIONAL_HEADER((PIMAGE_NT_HEADERS32)NtHeaders, ImageBase) +
                            DBGKP_FIELD_FROM_IMAGE_OPTIONAL_HEADER(
                                (PIMAGE_NT_HEADERS32)NtHeaders, AddressOfEntryPoint));
->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>				
error : pasting formed '.AddressOfEntryPoint', an invalid preprocessing token [-Winvalid-token-paste]

Patch