- 
                Notifications
    
You must be signed in to change notification settings  - Fork 15.1k
 
[IR2Vec][llvm-ir2vec] Add support for reading from stdin #149213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IR2Vec][llvm-ir2vec] Add support for reading from stdin #149213
Conversation
6efc8a8    to
    9e17794      
    Compare
  
    bc03736    to
    68ae9f5      
    Compare
  
    9e17794    to
    1e22261      
    Compare
  
    68ae9f5    to
    1d7ca80      
    Compare
  
    1e22261    to
    0903552      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nits at this point, otherwise LGTM.
1d7ca80    to
    01c6091      
    Compare
  
    0903552    to
    7fee589      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for reading LLVM IR from stdin by allowing "-" as the positional input filename and updating the parsing logic.
- Changed 
InputFilenameoption to default to"-"and updated its description for stdin support - Refactored 
mainto introduce a placeholder for stdin handling and unconditionally callparseIRFile 
Comments suppressed due to low confidence (1)
llvm/tools/llvm-ir2vec/llvm-ir2vec.cpp:54
- The new stdin support path isn't covered by existing tests. Consider adding unit or integration tests that pipe LLVM IR into stdin (using 
-) to verify the feature works end-to-end. 
                  cl::init("-"), cl::cat(IR2VecToolCategory));
01c6091    to
    f24c6f1      
    Compare
  
    36ecab5    to
    32275ce      
    Compare
  
    
          Merge activity
  | 
    
f24c6f1    to
    faf9baa      
    Compare
  
    32275ce    to
    a47b7f7      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have thought of this during the review: You might want to add a test somewhere that checks this actually works.

Add support for reading LLVM IR from stdin in the llvm-ir2vec tool.
This allows usage of the tool in pipelines where LLVM IR is generated or transformed on-the-fly just like the other llvm tools. Useful in upcoming PRs.
(Tracking issue - #141817)