Skip to content

Commit

Permalink
[gn] Tag unneeded variable.
Browse files Browse the repository at this point in the history
When only building targets without assembly parsers (e.g. `llvm_targets_to_build
= ["NVPTX"]`), `all_targets` is empty and causes GN to warn about an
assigned-but-unused variable.

Differential Revision: https://reviews.llvm.org/D31727

llvm-svn: 365897
  • Loading branch information
bryant committed Jul 12, 2019
1 parent 701e2c0 commit 421c791
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
Expand Up @@ -383,6 +383,9 @@ template("write_target_def_file") {
foreach(target, all_targets) {
value = "$value${invoker.value}($target)\n"
}
if (all_targets == []) {
not_needed(invoker, [ "value" ])
}
values = [ "${invoker.key}=$value" ]
}
}
Expand Down

0 comments on commit 421c791

Please sign in to comment.