[clang] [NFC][clang][Driver] Changed if-else to a StringSwitch in CreateFileHandler (PR #238231)

Jacob Lambert via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 2 23:54:30 PST 2026


lamb-j wrote:

Is the enum abstraction more readable?

One alternative thing we could do is collapse the if statements with the same return into one statement, example:

```
  if (FilesType == "i" || FilesType == "ii" ||
      FilesType == "cui" || FilesType == "hipi")
    return std::make_unique<TextFileHandler>("//");
```

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


More information about the cfe-commits mailing list