snirk-lang / protosnirk

The beginnings of a programming language
MIT License
1 stars 1 forks source link

Set native platform info on LLVM modules #96

Closed SnirkImmington closed 5 years ago

SnirkImmington commented 5 years ago

This PR sets the data layout for modules to use the native data layout on LLVM modules. I've taken the liberty of renaming the bindings to use the word native. This enables better LLVM optimizations (although they're probably not relevant right now).

This does not fix #93. I'm going to merge anyway as this setting native target info is recommended by LLVM.

Here's an example of the module metadata (Linux on an x86, 64 bit Intel processor):

; ModuleID = 'if-expr-ok'
source_filename = "if-expr-ok"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"