52 return std::make_shared<TypeSystemFortran>();
74 return !type || llvm::isa<FortranType>(
static_cast<FortranType *
>(type));
108 const size_t index) {
113 llvm::ArrayRef<lldb_private::CompilerType> param_types =
115 if (index >= param_types.size())
118 return param_types[index];
146 switch (fortran_type->
GetKind()) {
152 return fortran_type->
GetName();
165 const char *default_name =
nullptr;
167 switch (dwarf_encoding) {
168 case dwarf::DW_ATE_boolean:
170 default_name =
"LOGICAL";
172 case dwarf::DW_ATE_float:
174 default_name =
"REAL";
176 case dwarf::DW_ATE_signed:
177 case dwarf::DW_ATE_signed_char:
179 default_name =
"INTEGER";
182 case dwarf::DW_ATE_unsigned:
184 default_name =
"UNSIGNED";
186 case dwarf::DW_ATE_complex_float:
188 default_name =
"COMPLEX";
195 if (name.
IsEmpty() && default_name)
208 FoldingSetInsertToken token;
211 return CompilerType(weak_from_this(), (
void *)candidate_type);
213 auto new_type_up = std::make_unique<FortranType>(kind, bitsize, name);
214 candidate_type = new_type_up.get();
216 m_types.push_back(std::move(new_type_up));
217 return CompilerType(weak_from_this(), (
void *)candidate_type);
224 llvm::FoldingSetNodeID id;
226 FoldingSetInsertToken token;
230 return CompilerType(weak_from_this(), (
void *)function_type);
232 auto new_type_up = std::make_unique<FortranFunction>(
233 name, parameters, parameter_names, return_type);
234 function_type = new_type_up.get();
237 m_types.push_back(std::move(new_type_up));
239 return CompilerType(weak_from_this(), (
void *)function_type);
244 return type ? lldb::eTypeClassBuiltin : lldb::eTypeClassInvalid;
288 switch (fortran_type->
GetKind()) {
353 switch (basic_type) {
This file defines the DWARF AST parser for the Fortran language.
This file defines the classes that describe the Fortran types.
#define LLDB_PLUGIN_DEFINE(PluginName)
uint32_t GetKind(uint32_t data)
Return the type kind encoded in the given data.
Generic representation of a type in a programming language.
A uniqued constant string class.
void SetCString(const char *cstr)
Set the C string value.
bool IsEmpty() const
Test for empty string.
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
static bool LanguageIsFortran(lldb::LanguageType language)
A class that describes an executable image and its associated object and symbol files.
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
static lldb::TypeSystemSP CreateInstance(lldb::LanguageType language, Module *module, Target *target)
bool IsFunctionType(lldb::opaque_compiler_type_t type) override
bool IsIntegerType(lldb::opaque_compiler_type_t type, bool &is_signed) override
plugin::dwarf::DWARFASTParser * GetDWARFParser() override
bool IsFloatingPointType(lldb::opaque_compiler_type_t type) override
llvm::SmallVector< std::unique_ptr< plugin::fortran::FortranType > > m_types
static LanguageSet GetSupportedLanguagesForExpressions()
llvm::FoldingSet< plugin::fortran::FortranFunction > m_functions
ConstString GetTypeName(lldb::opaque_compiler_type_t type, bool BaseOnly) override
Returns the type name upper-cased to follow Fortran's general style.
int GetFunctionArgumentCount(lldb::opaque_compiler_type_t type) override
size_t GetNumberOfFunctionArguments(lldb::opaque_compiler_type_t type) override
CompilerType GetBasicTypeFromAST(lldb::BasicType basic_type) override
llvm::FoldingSet< plugin::fortran::FortranType > m_basic_types
CompilerType GetCanonicalType(lldb::opaque_compiler_type_t type) override
static LanguageSet GetSupportedLanguagesForTypes()
lldb::TypeClass GetTypeClass(lldb::opaque_compiler_type_t type) override
CompilerType GetOrCreateFortranBaseType(int kind, uint64_t bitsize, ConstString name)
Creates the type if it has not been created before, otherwise it gets it from the type map.
CompilerType CreateBaseType(llvm::dwarf::TypeKind dwarf_encoding, uint64_t bitsize, ConstString name)
CompilerType GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding, size_t bit_size) override
CompilerType GetFunctionReturnType(lldb::opaque_compiler_type_t type) override
bool SupportsLanguage(lldb::LanguageType language) override
CompilerType CreateFortranFunction(ConstString name, const llvm::SmallVectorImpl< CompilerType > ¶meters, const llvm::SmallVectorImpl< llvm::StringRef > ¶meter_names, CompilerType return_type)
static llvm::StringRef GetPluginNameStatic()
CompilerType GetFunctionArgumentAtIndex(lldb::opaque_compiler_type_t type, const size_t index) override
std::unique_ptr< plugin::dwarf::DWARFASTParser > m_dwarf_ast_parser_up
lldb::BasicType GetBasicTypeEnumeration(lldb::opaque_compiler_type_t type) override
bool Verify(lldb::opaque_compiler_type_t type) override
Verify the integrity of the type to catch CompilerTypes that mix and match invalid TypeSystem/Opaque ...
llvm::Expected< uint64_t > GetBitSize(lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope) override
static FortranFunction * GetFunctionType(void *type)
void Profile(llvm::FoldingSetNodeID &id) const
size_t GetNumParams() const
CompilerType GetReturnType() const
llvm::ArrayRef< CompilerType > GetParamTypes() const
A simplified internal representation of a Fortran type.
void Profile(llvm::FoldingSetNodeID &ID) const
ConstString GetName() const
uint64_t GetBitSize() const
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::TypeSystem > TypeSystemSP
void * opaque_compiler_type_t
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
@ eBasicTypeUnsignedShort
@ eBasicTypeUnsignedInt128
@ eBasicTypeUnsignedLongLong
@ eBasicTypeDoubleComplex
LanguageType
Programming language type.
@ eLanguageTypeFortran08
ISO Fortran 2008.
@ eLanguageTypeFortran95
ISO Fortran 95.
@ eLanguageTypeFortran77
ISO Fortran 77.
@ eLanguageTypeFortran90
ISO Fortran 90.
@ eLanguageTypeFortran03
ISO Fortran 2003.
Encoding
Register encoding definitions.
@ eEncodingUint
unsigned integer
@ eEncodingSint
signed integer
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
void Insert(lldb::LanguageType language)