Nishant Sachdeva 6c51c17eec
[NFC][llvm-ir2vec] llvm_ir2vec.cpp breakup to extract a reusable header for IR2VecTool, and MIR2VecTool classes (#172304)
Refactor llvm-ir2vec: Extract reusable header for Python bindings

Separated the IR2Vec/MIR2Vec tool implementation into a header file
(`llvm-ir2vec.h`) and implementation file (`llvm-ir2vec.cpp`) to enable
reuse in Python bindings and other projects.

Changes
- **Created `llvm-ir2vec.h`**: Contains `IR2VecTool` and `MIR2VecTool`
class definitions with all implementations, making it a standalone
header-only library
- **Simplified `llvm-ir2vec.cpp`**: Now contains only command-line
interface code (options, main function, and helper functions)

Motivation
The original monolithic `.cpp` file made it impossible to use
IR2Vec/MIR2Vec functionality in Python bindings without compiling the
entire command-line tool. This refactoring enables clean separation
between the library interface and the CLI tool. This will enable easier
development for the upcoming python bindings
[HERE](https://github.com/llvm/llvm-project/issues/141839)

Testing
All existing tests pass without modification. No functional changes.
2025-12-19 11:28:22 +05:30
..