[llvm-dev] Setting a function in a module to extern

Gaier, Bjoern via llvm-dev llvm-dev at lists.llvm.org
Thu Jan 10 05:55:37 PST 2019


Hello,

Finally I was able to test the suggestion of deleting the body. So I did:
                     mainModue->getFunction("?hello_worldEx@@YAHXZ")->setLinkage(llvm::GlobalValue::LinkageTypes::ExternalLinkage);
                     mainModue->getFunction("?hello_worldEx@@YAHXZ")->deleteBody();

Wit the result, that the function “hello_worldEx” disappeared completely – it was not set to an external function which I could resolve again.
“setLinkage” seems not to influence the code at all
“deleteBody” deletes the functions but also all calls to it…

So what can I do?

Kind greetings
Björn

From: Philip Pfaffe <philip.pfaffe at gmail.com>
Sent: Donnerstag, 13. Dezember 2018 15:01
To: Gaier, Bjoern <Bjoern.Gaier at horiba.com>
Cc: Boldizsar.Palotas at esa.int; llvm-dev <llvm-dev at lists.llvm.org>
Subject: Re: [llvm-dev] Setting a function in a module to extern

You need to delete the body of the function then.

Cheers,
Philip

On Thu, Dec 13, 2018 at 2:30 PM Gaier, Bjoern via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote:
But in my module this function already exist… I first want to delete it but without also deleting the calls to it…


From: Boldizsar.Palotas at esa.int<mailto:Boldizsar.Palotas at esa.int> <Boldizsar.Palotas at esa.int<mailto:Boldizsar.Palotas at esa.int>>
Sent: Donnerstag, 13. Dezember 2018 10:53
To: Gaier, Bjoern <Bjoern.Gaier at horiba.com<mailto:Bjoern.Gaier at horiba.com>>
Cc: LLVM Developers Mailing List <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>>
Subject: Re: [llvm-dev] Setting a function in a module to extern

I think you just need to llvm::Function::Create(Type, Linkage, Name, Module) it and not add any basic blocks to it.

Boldizsár Palotás



From:        "Gaier, Bjoern via llvm-dev" <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>>
To:        LLVM Developers Mailing List <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>>
Date:        2018.12.13 08:14
Subject:        [llvm-dev] Setting a function in a module to extern
Sent by:        "llvm-dev" <llvm-dev-bounces at lists.llvm.org<mailto:llvm-dev-bounces at lists.llvm.org>>
________________________________


Hello again,



as mentioned in a different mail, I’m a beginner with the LLVM and writing a JIT-Client under Windows.



In my llvm::Module I have a certain function – now I want to delete this function, but keep all the calls and references to it. I kind of want to set the function to an external function.

Is this possible?



Kind greetings

Björn

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
_______________________________________________
LLVM Developers mailing list
llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

This message is intended only for the recipient(s) named above. It may contain proprietary information and/or

protected content. Any unauthorised disclosure, use, retention or dissemination is prohibited. If you have received

this e-mail in error, please notify the sender immediately. ESA applies appropriate organisational measures to protect

personal data, in case of data privacy queries, please contact the ESA Data Protection Officer (dpo at esa.int<mailto:dpo at esa.int>).
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
_______________________________________________
LLVM Developers mailing list
llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190110/f2085eda/attachment-0001.html>


More information about the llvm-dev mailing list