[llvm-dev] Functions have two types, one can be mutated but not the other

Andy Ayers via llvm-dev llvm-dev at lists.llvm.org
Tue Nov 24 09:50:08 PST 2015


Correction: there are 3 Type * members - one on Function, one on GlobalValue, and one on Value. The last is mutable, but not the other two.

From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Andy Ayers via llvm-dev
Sent: Tuesday, November 24, 2015 9:26 AM
To: llvm-dev at lists.llvm.org
Subject: [llvm-dev] Functions have two types, one can be mutated but not the other

Function has its own FunctionType* member as well as a Type* member that it inherits from GlobalValue. The latter can be mutated but not the former, leading to potential strange inconsistencies.

While I realize using mutateType is probably going to trigger a bunch of "you're doing it wrong" replies, it seems like mutateType, as a necessary evil, should be virtual and do the right wrong thing for Functions too.

Thoughts?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151124/b7605b45/attachment.html>


More information about the llvm-dev mailing list