Adding Windows support for aligned memory allocation on Windows

This commit is contained in:
Dmitry Babokin
2013-04-26 22:07:30 +02:00
parent e084f1c311
commit 7497e86902
5 changed files with 116 additions and 50 deletions

View File

@@ -3234,7 +3234,12 @@ DeleteStmt::EmitCode(FunctionEmitContext *ctx) const {
// __delete_uniform() from the builtins expects.
exprValue = ctx->BitCastInst(exprValue, LLVMTypes::VoidPointerType,
"ptr_to_void");
llvm::Function *func = m->module->getFunction("__delete_uniform");
llvm::Function *func;
if (g->target->is32Bit()) {
func = m->module->getFunction("__delete_uniform_32rt");
} else {
func = m->module->getFunction("__delete_uniform_64rt");
}
AssertPos(pos, func != NULL);
ctx->CallInst(func, NULL, exprValue, "");
@@ -3244,7 +3249,12 @@ DeleteStmt::EmitCode(FunctionEmitContext *ctx) const {
// takes a vector of i64s (even for 32-bit targets). Therefore, we
// only need to extend to 64-bit values on 32-bit targets before
// calling it.
llvm::Function *func = m->module->getFunction("__delete_varying");
llvm::Function *func;
if (g->target->is32Bit()) {
func = m->module->getFunction("__delete_varying_32rt");
} else {
func = m->module->getFunction("__delete_varying_64rt");
}
AssertPos(pos, func != NULL);
if (g->target->is32Bit())
exprValue = ctx->ZExtInst(exprValue, LLVMTypes::Int64VectorType,