[llvm] [readtapi] Add Merge functionality (PR #72656)

Juergen Ributzka via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 17 08:19:39 PST 2023


================
@@ -138,8 +155,22 @@ int main(int Argc, char **Argv) {
     }
   }
 
+  if (Args.hasArg(OPT_compact))
+    Ctx.Compact = true;
+
+  if (opt::Arg *A = Args.getLastArg(OPT_filetype_EQ)) {
+    Ctx.WriteFT = TextAPIWriter::parseFileType(A->getValue());
+    if (Ctx.WriteFT < FileType::TBD_V3 || Ctx.WriteFT == FileType::Invalid) {
+      llvm::errs() << "error: unsupported filetype '" << A->getValue() << "'\n";
+      return EXIT_FAILURE;
+    }
+  }
+
   if (Args.hasArg(OPT_compare))
----------------
ributzka wrote:

What happens if both flags are specified: `-compare` and `-merge`. Will there be a warning/error message?

I took a quick look at the lipo tool and that uses an action group to handle this.

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


More information about the llvm-commits mailing list