diff options
| author | Ben Noordhuis <info@bnoordhuis.nl> | 2018-04-06 00:10:15 +0200 |
|---|---|---|
| committer | Ben Noordhuis <info@bnoordhuis.nl> | 2018-04-06 00:31:55 +0200 |
| commit | 8980281184a5d60098f36f3db605181f08aa1caa (patch) | |
| tree | 92eb9c02ca411fe50e37bdfa14ce5cc537f03b7e /src/codegen.cpp | |
| parent | 8938429ea12ff2857ace5380932a7cd68d3b4ab1 (diff) | |
| download | zig-8980281184a5d60098f36f3db605181f08aa1caa.tar.gz zig-8980281184a5d60098f36f3db605181f08aa1caa.zip | |
fix llvm assert on version string with git sha
LLVM's CodeViewDebug pass misparses the version string when it contains
a git revision so stop doing that. This only affected Windows builds.
closes #898
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index bdd28b86fd..0dafcb9502 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -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), |
