Merge pull request #899 from bnoordhuis/fix898

fix llvm assert on version string with git sha
This commit is contained in:
Andrew Kelley 2018-04-05 18:55:09 -04:00 committed by GitHub
commit 873641c123
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6207,7 +6207,9 @@ static void init(CodeGen *g) {
g->builder = LLVMCreateBuilder();
g->dbuilder = ZigLLVMCreateDIBuilder(g->module, true);
Buf *producer = buf_sprintf("zig %s", ZIG_VERSION_STRING);
// Don't use ZIG_VERSION_STRING here, llvm misparses it when it includes
// the git revision.
Buf *producer = buf_sprintf("zig %d.%d.%d", ZIG_VERSION_MAJOR, ZIG_VERSION_MINOR, ZIG_VERSION_PATCH);
const char *flags = "";
unsigned runtime_version = 0;
ZigLLVMDIFile *compile_unit_file = ZigLLVMCreateFile(g->dbuilder, buf_ptr(g->root_out_name),