Enable memory alignment management via compiler options

This commit is contained in:
Dmitry Babokin
2013-05-17 22:15:57 +04:00
parent 7bedb4a081
commit 1a7ac8b804
4 changed files with 14 additions and 0 deletions

View File

@@ -996,6 +996,11 @@ DefineStdlib(SymbolTable *symbolTable, llvm::LLVMContext *ctx, llvm::Module *mod
lDefineConstantInt("__have_native_transcendentals", g->target->hasTranscendentals(),
module, symbolTable);
if (g->forceAlignment != -1) {
llvm::GlobalVariable *alignment = module->getGlobalVariable("memory_alignment", true);
alignment->setInitializer(LLVMInt32(g->forceAlignment));
}
if (includeStdlibISPC) {
// If the user wants the standard library to be included, parse the
// serialized version of the stdlib.ispc file to get its