[llvm-dev] Subclassing LLVM Type

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Fri Jun 9 16:23:35 PDT 2017


On 9 June 2017 at 16:17, Jajoo, Malhar via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> I don't want to change my AST structure to accept a
> non-concrete type.

That sounds like a hack to me. If it's expected to convey no actual
information what about an llvm::Optional, or even the dreaded nullptr?
A Type that's sort of valid sometimes but not really seems like the
worst of all possible worlds.

> Would changing the enum in the llvm::Type
> class be enough ?

No, you'd also have to implement "classof" in your DummyType.

Cheers.

Tim.


More information about the llvm-dev mailing list