[PATCH] D115024: [ifs] Patch llvm-ifs to allow output multiple types of stub file at the same time

Haowei Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 9 11:33:45 PST 2021


haowei added inline comments.


================
Comment at: llvm/tools/llvm-ifs/llvm-ifs.cpp:496
+    // Check if output path for individual format.
+    if (OutputELFFilePath.getNumOccurrences() == 1) {
+      Error TargetError = validateIFSTarget(Stub, true);
----------------
phosek wrote:
> haowei wrote:
> > phosek wrote:
> > > Does this mean that if someone passes `--output-elf=foo --output-elf=bar` we won't take this branch because `OutputELFFilePath.getNumOccurrences() == 2`?
> > Ah, you got a point. Yes, it won't take this branch. I should add error that these flags cannot be used more than once, at least in this revision.
> Another option would be to allow these flags to be set multiple times and follow the "last one wins" strategy.
```
./llvm-ifs --input-format=ELF --strip-ifs-target --output-ifs=./testA.ifs --output-ifs=./testB.ifs ./llvm-ifs
llvm-ifs: for the --output-ifs option: may only occur zero or one times!
```

Looks like by default, 'cl::opt' only support zero or 1 time so this is not an issue. 


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

https://reviews.llvm.org/D115024



More information about the llvm-commits mailing list