[llvm] Add PR check to suggest alternatives to using undef (PR #118506)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 7 09:15:59 PDT 2025


MacDue wrote:

> > nunoplopes Just using the word "undef" in a C++ comment will also trigger this. I think is very confusing.
> 
> Have you tested this? It should be specific to `.ll` files.

I reported this earlier too. It's not just `.ll` files that are check as the regex is:

```
regex = "([^a-zA-Z0-9#_-]undef[^a-zA-Z0-9_-]|UndefValue::get)"
```

`[^a-zA-Z0-9#_-]undef[^a-zA-Z0-9_-]` is for checking `*.ll` files, but `UndefValue::get` is for checking C++ files, but the regex makes no distinction and runs both checks on both file kinds. 


https://github.com/llvm/llvm-project/pull/118506


More information about the llvm-commits mailing list