Skip to content

Commit a47b7f7

Browse files
committed
support-stdin-input-llvm-ir2vec
1 parent 61a45d2 commit a47b7f7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/tools/llvm-ir2vec/llvm-ir2vec.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ namespace ir2vec {
4848

4949
static cl::OptionCategory IR2VecToolCategory("IR2Vec Tool Options");
5050

51-
static cl::opt<std::string> InputFilename(cl::Positional,
52-
cl::desc("<input bitcode file>"),
53-
cl::Required,
54-
cl::cat(IR2VecToolCategory));
51+
static cl::opt<std::string>
52+
InputFilename(cl::Positional,
53+
cl::desc("<input bitcode file or '-' for stdin>"),
54+
cl::init("-"), cl::cat(IR2VecToolCategory));
5555

5656
static cl::opt<std::string> OutputFilename("o", cl::desc("Output filename"),
5757
cl::value_desc("filename"),
@@ -287,7 +287,7 @@ int main(int argc, char **argv) {
287287
if (Mode == TripletMode && Level.getNumOccurrences() > 0)
288288
errs() << "Warning: --level option is ignored in triplet mode\n";
289289

290-
// Parse the input LLVM IR file
290+
// Parse the input LLVM IR file or stdin
291291
SMDiagnostic Err;
292292
LLVMContext Context;
293293
std::unique_ptr<Module> M = parseIRFile(InputFilename, Err, Context);

0 commit comments

Comments
 (0)