Use clang codegen for android, linux, mingw.

This commit is contained in:
Sergey Bogolepov
2019-05-06 18:51:05 +07:00
committed by Sergey Bogolepov
parent a85b474fd0
commit 970f2a98f9
9 changed files with 78 additions and 88 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ model {
} else if (isWindows()) {
cppCompiler.args "-DKONAN_WINDOWS=1"
} else if (isLinux()) {
cppCompiler.args "-DKONAN_LINUX=1"
cppCompiler.args "-DKONAN_LINUX=1", "-D_GLIBCXX_USE_CXX11_ABI=0"
} else {
throw new Error("Unsupported host OS.")
}
@@ -224,9 +224,9 @@ void LLVMAddInstrProfPass(LLVMPassManagerRef passManagerRef, const char* outputF
passManager->add(createInstrProfilingLegacyPass(options));
}
LLVMTargetLibraryInfoRef LLVMGetTargetLibraryInfo(LLVMModuleRef moduleRef) {
auto* libraryInfo = new TargetLibraryInfoImpl(Triple(unwrap(moduleRef)->getTargetTriple()));
return llvm::wrap(libraryInfo);
void LLVMKotlinAddTargetLibraryInfoWrapperPass(LLVMPassManagerRef passManagerRef, const char* targetTriple) {
legacy::PassManagerBase *passManager = unwrap(passManagerRef);
passManager->add(new TargetLibraryInfoWrapperPass(Triple(targetTriple)));
}
void LLVMKotlinInitializeTargets() {
@@ -241,7 +241,14 @@ void LLVMKotlinInitializeTargets() {
INIT_LLVM_TARGET(X86)
INIT_LLVM_TARGET(WebAssembly)
#elif KONAN_LINUX
INIT_LLVM_TARGET(AArch64)
INIT_LLVM_TARGET(ARM)
INIT_LLVM_TARGET(Mips)
INIT_LLVM_TARGET(X86)
#elif KONAN_WINDOWS
INIT_LLVM_TARGET(AArch64)
INIT_LLVM_TARGET(ARM)
INIT_LLVM_TARGET(X86)
#endif
#undef INIT_LLVM_TARGET
@@ -72,7 +72,7 @@ LLVMValueRef LLVMCreatePGOFunctionNameVar(LLVMValueRef llvmFunction, const char
void LLVMAddInstrProfPass(LLVMPassManagerRef passManagerRef, const char* outputFileName);
LLVMTargetLibraryInfoRef LLVMGetTargetLibraryInfo(LLVMModuleRef moduleRef);
void LLVMKotlinAddTargetLibraryInfoWrapperPass(LLVMPassManagerRef passManagerRef, const char* targetTriple);
void LLVMKotlinInitializeTargets();