From 0895359c13475de4024729d95210c577516c341f Mon Sep 17 00:00:00 2001 From: Bryant Wong Date: Fri, 12 Jul 2019 13:09:39 +0000 Subject: [PATCH] [gn] Tag unneeded variable. 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365897 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn b/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn index 582e3eec7bf..f09d8a29ef4 100644 --- a/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn +++ b/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn @@ -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" ] } } -- 2.40.0