Giter VIP home page Giter VIP logo

Comments (3)

cgranade avatar cgranade commented on August 29, 2024 1

but we'd have to see if they are willing to take it and publish an update the crate.

In the most extreme case, may be able to specify a [patch] section in Cargo.toml. It sounds like we're in precisely one of the intended usecases:

â€ĸ You've submitted a fix to an upstream crate for a bug you found, but you'd like to immediately have your application start depending on the fixed version of the crate to avoid blocking on the bug fix getting merged.

from pyqir.

LaurentAjdnik avatar LaurentAjdnik commented on August 29, 2024

Indeed, llvm_ir only provides a from_bc_path(path) function. ☚ī¸

The source code relies on LLVMCreateMemoryBufferWithContentsOfFile() then LLVMParseBitcodeInContext2() (both from the llvm-sys crate) before calling Self::from_llvm_ref().

In order not to update the llvm_ir code, could we somehow (Rust definitely isn't my universe...) inherit / compose / embed / extend / encapsulate the Module struct and add a from_bc(buffer) function, with calls to only LLVMParseBitcodeInContext2() and Self::from_llvm_ref()?

from pyqir.

swernli avatar swernli commented on August 29, 2024

@LaurentAjdnik Given which traits and implementations are pub vs pub(crate) (Rust's rough equivalent to "internal"), this isn't something we can easily extend from the outside. The best bet would be contributing this as new functionality to llvm_ir directly. I don't think that code would be difficult to write, but we'd have to see if they are willing to take it and publish an update the crate.

from pyqir.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.