https://github.com/svkeerthy updated https://github.com/llvm/llvm-project/pull/149213
>From 36ecab51e81c5715ca22912d18b5ae5fac33c52c Mon Sep 17 00:00:00 2001 From: svkeerthy <venkatakeer...@google.com> Date: Wed, 16 Jul 2025 22:01:47 +0000 Subject: [PATCH] support-stdin-input-llvm-ir2vec --- llvm/tools/llvm-ir2vec/llvm-ir2vec.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/llvm/tools/llvm-ir2vec/llvm-ir2vec.cpp b/llvm/tools/llvm-ir2vec/llvm-ir2vec.cpp index 4e88282e85c14..5743ec0f4c1e9 100644 --- a/llvm/tools/llvm-ir2vec/llvm-ir2vec.cpp +++ b/llvm/tools/llvm-ir2vec/llvm-ir2vec.cpp @@ -48,10 +48,10 @@ namespace ir2vec { static cl::OptionCategory IR2VecToolCategory("IR2Vec Tool Options"); -static cl::opt<std::string> InputFilename(cl::Positional, - cl::desc("<input bitcode file>"), - cl::Required, - cl::cat(IR2VecToolCategory)); +static cl::opt<std::string> + InputFilename(cl::Positional, + cl::desc("<input bitcode file or '-' for stdin>"), + cl::init("-"), cl::cat(IR2VecToolCategory)); static cl::opt<std::string> OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"), @@ -287,10 +287,11 @@ int main(int argc, char **argv) { if (Mode == TripletMode && Level.getNumOccurrences() > 0) errs() << "Warning: --level option is ignored in triplet mode\n"; - // Parse the input LLVM IR file + // Parse the input LLVM IR file or stdin SMDiagnostic Err; LLVMContext Context; std::unique_ptr<Module> M = parseIRFile(InputFilename, Err, Context); + if (!M) { Err.print(argv[0], errs()); return 1; _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits