diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-03-15 12:18:40 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-03-17 21:19:13 +0100 |
| commit | 3e872ba1c495feafaafac97cc449f81d8a4d451f (patch) | |
| tree | 226599ef99be6db51449573b4a00a119cfe38612 | |
| parent | 749688d22abef3f3cb9a0480e15c19a3f2ed8e13 (diff) | |
pkg/compiler: emit warnings after generate stage
Description generation can also produce errors.
We don't want to emit warnings if there are any errors.
Move warnings emission to the very end of compilation.
| -rw-r--r-- | pkg/compiler/compiler.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/compiler/compiler.go b/pkg/compiler/compiler.go index a88e44d70..2291d349e 100644 --- a/pkg/compiler/compiler.go +++ b/pkg/compiler/compiler.go @@ -99,9 +99,6 @@ func Compile(desc *ast.Description, consts map[string]uint64, target *targets.Ta if comp.errors != 0 { return nil } - for _, w := range comp.warnings { - eh(w.pos, w.msg) - } syscalls := comp.genSyscalls() prg := &Prog{ Resources: comp.genResources(), @@ -112,6 +109,9 @@ func Compile(desc *ast.Description, consts map[string]uint64, target *targets.Ta if comp.errors != 0 { return nil } + for _, w := range comp.warnings { + eh(w.pos, w.msg) + } return prg } |
