[PATCH] D60766: Fixed error message printing in write_cmake_config.py

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 06:58:47 PDT 2019


thakis added inline comments.


================
Comment at: llvm/trunk/utils/gn/build/write_cmake_config.py:102
+            '\n'.join([x[0] or x[1] for x in leftovers]),
+            file=sys.stderr)
         return 1
----------------
thakis wrote:
> Huh, did you actually hit this? I always thought this branch is effectively dead code after a refactoring: `in_lien = var_re.sub(repl, in_line)` should call repl() on all matches on each line, and if some pattern doesn't have a value in the `values` dict, then `return values[key]` will throw. I always wanted to make that set a bool instead and then print this error based on that bool, and remove the findall call down here (since I thought I shouldn't happen), but didn't get around to it yet.
>From IRC, the way to hit this is by invoking a variable whose substitution is a variable reference: `llvm/utils/gn/build/write_cmake_config.py -o foo llvm/include/llvm/Config/AsmParsers.def.in 'LLVM_ENUM_ASM_PARSERS=@LLVM_ENUM_ASM_PARSERS@'`


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60766/new/

https://reviews.llvm.org/D60766





More information about the llvm-commits mailing list