LLVM Types

Richard Trieu via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 6 20:28:22 PDT 2019


To avoid confusion, there's both a LLVM Type and a Clang Type.  The LLVM
Type is used in the LLVM IR while the Clang Type represents types in a
language, like C++.

The Clang Doxygen pages have this hierarchy, although it's truncated
because Type is so large, but you can click through to get the missing
nodes.  It's available at:
https://clang.llvm.org/doxygen/classclang_1_1Type.html

There's also "clang/AST/TypeNode.def" which has the Type classes available
as macro calls.  You define the macros, include the file, then the
preprocessor will do all the work of filling in hierarchy.  You can see
this in action by how Type fills up an enum:

class alignas(8) Type : public ExtQualsTypeCommonBase {
public:
  enum TypeClass {
#define TYPE(Class, Base) Class,
#define LAST_TYPE(Class) TypeLast = Class,
#define ABSTRACT_TYPE(Class, Base)
#include "clang/AST/TypeNodes.def"
    TagFirst = Record, TagLast = Enum
  };

On Tue, Aug 6, 2019 at 8:15 AM Monalisa Rout via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Hello,
> Can I dump LLVM Type hierarchies somehow ??
>
> Types which are declared in this file ("clang/AST/Type.h
> <https://clang.llvm.org/doxygen/Type_8h_source.html>"  )
>
> Regards,
> Mona
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190806/640b3049/attachment.html>


More information about the cfe-commits mailing list