LLDB mainline
FortranTypes.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// This file defines the classes that describe the Fortran types.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLDB_SOURCE_PLUGINS_TYPESYSTEM_FORTRAN_FORTRANTYPES_H
15#define LLDB_SOURCE_PLUGINS_TYPESYSTEM_FORTRAN_FORTRANTYPES_H
16
21
22#include "llvm/ADT/ArrayRef.h"
23#include "llvm/ADT/FoldingSet.h"
24#include "llvm/ADT/SmallVector.h"
25
26namespace lldb_private {
27namespace plugin {
28namespace fortran {
29
30/// A simplified internal representation of a Fortran type.
31class FortranType : public llvm::FoldingSetNode {
32 // LLVM RTTI support
33 static char ID;
34
35public:
36 // llvm casting support
37 virtual bool isA(const void *ClassID) const { return ClassID == &ID; }
38
39 static bool classof(const FortranType *ft) { return ft->isA(&ID); }
40
49
50 FortranType(int32_t kind, uint64_t bitsize, const ConstString &name)
51 : m_kind(kind), m_bitsize(bitsize), m_type_name(name) {}
52 virtual ~FortranType();
53 int GetKind() const { return m_kind; }
54 uint64_t GetBitSize() const { return m_bitsize; }
55 ConstString GetName() const { return m_type_name; }
56
57 void Profile(llvm::FoldingSetNodeID &ID) const {
59 }
60
61 static void Profile(llvm::FoldingSetNodeID &ID, int32_t kind,
62 uint64_t bitsize) {
63 ID.AddInteger(kind);
64 ID.AddInteger(bitsize);
65 }
66
67private:
68 int32_t m_kind;
69 uint64_t m_bitsize;
71};
72
73} // namespace fortran
74} // namespace plugin
75} // namespace lldb_private
76
77#endif // LLDB_SOURCE_PLUGINS_TYPESYSTEM_FORTRAN_FORTRANTYPES_H
A uniqued constant string class.
Definition ConstString.h:40
void Profile(llvm::FoldingSetNodeID &ID) const
static void Profile(llvm::FoldingSetNodeID &ID, int32_t kind, uint64_t bitsize)
virtual bool isA(const void *ClassID) const
FortranType(int32_t kind, uint64_t bitsize, const ConstString &name)
static bool classof(const FortranType *ft)
A class that represents a running process on the host machine.