Niddodi, Chaitra via llvm-dev
2019-Nov-10 08:51 UTC
[llvm-dev] Convert std::string to Instruction*
Hello, How to correctly convert std::string str to Instruction* inst and perform operations like inst->getNextNode() ? Thanks, Chaitra -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191110/67507693/attachment.html>
Tim Northover via llvm-dev
2019-Nov-14 13:26 UTC
[llvm-dev] Convert std::string to Instruction*
Hi Chiatra, On Wed, 13 Nov 2019 at 20:32, Niddodi, Chaitra via llvm-dev <llvm-dev at lists.llvm.org> wrote:> How to correctly convert std::string str to Instruction* inst and perform operations like inst->getNextNode() ?There's no way to do that in general. The smallest thing containing instructions LLVM lets you independently parse is a Function. The "parseAssemblyInto" function in Parser.h will let you parse a Function and add it to the given Module. Cheers. Tim.