What does that mean for my code and the idea? I'm a really unexperienced LLVM user... -----Original Message----- From: Tim Northover <t.p.northover at gmail.com> Sent: Dienstag, 15. Januar 2019 15:19 To: Gaier, Bjoern <Bjoern.Gaier at horiba.com> Cc: Stefan Gränitz <stefan.graenitz at gmail.com>; Mehdi AMINI <joker.eph at gmail.com>; llvm-dev <llvm-dev at lists.llvm.org> Subject: Re: [llvm-dev] Function - replaceAllUsesWith On Tue, 15 Jan 2019 at 14:04, Gaier, Bjoern <Bjoern.Gaier at horiba.com> wrote:> Is there a way to copy the value? I want to ensure to use the correct type...I don't think copying is the issue, you're just passing pointers within a single Context around by the looks of it. I have just noticed the getPointerCast actually only does ptrtoint but you want inttoptr, without assertions it's possible that's doing bad things in a non-obvious way. It should certainly be getIntToPtr anyway. Cheers. Tim. Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi Nagano, Takeshi Fukushima. Junichi Tajika
On Tue, 15 Jan 2019 at 14:50, Gaier, Bjoern <Bjoern.Gaier at horiba.com> wrote:> What does that mean for my code and the idea?You should definitely change getPointerCast to getIntToPtr (the interface looks otherwise identical). It may solve your problems, or it may not. You should also build LLVM with assertions and probably debug mode, as I said before. The output when that crashes is 100x more useful to people trying to help you than anything you'll get from a release build. Cheers. Tim.
Hey Tim, Using "getIntToPtr" worked fine! Thank you! Kind greetings Björn -----Original Message----- From: Tim Northover <t.p.northover at gmail.com> Sent: Dienstag, 15. Januar 2019 16:02 To: Gaier, Bjoern <Bjoern.Gaier at horiba.com> Cc: Stefan Gränitz <stefan.graenitz at gmail.com>; Mehdi AMINI <joker.eph at gmail.com>; llvm-dev <llvm-dev at lists.llvm.org> Subject: Re: [llvm-dev] Function - replaceAllUsesWith On Tue, 15 Jan 2019 at 14:50, Gaier, Bjoern <Bjoern.Gaier at horiba.com> wrote:> What does that mean for my code and the idea?You should definitely change getPointerCast to getIntToPtr (the interface looks otherwise identical). It may solve your problems, or it may not. You should also build LLVM with assertions and probably debug mode, as I said before. The output when that crashes is 100x more useful to people trying to help you than anything you'll get from a release build. Cheers. Tim. Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi Nagano, Takeshi Fukushima. Junichi Tajika