1#include "clang/AST/DeclCXX.h"
5#include "llvm/Support/Debug.h"
13 DEBUG_WITH_TYPE(
"DebugDestructors", llvm::dbgs() <<
"~PortDecl\n";);
24 template_type_{nullptr},
38 field_decl_{const_cast<
clang::Decl *>(fd)},
58 if (
auto ptr_type = fd->getType().getTypePtr()) {
59 return ptr_type->isPointerType();
64 if (
auto ptr_type = vd->getType().getTypePtr()) {
65 return ptr_type->isPointerType();
80 return clang::dyn_cast<clang::FieldDecl>(
field_decl_);
84 return clang::dyn_cast<clang::VarDecl>(
field_decl_);
91 std::string class_name{};
93 class_name = fd->getParent()->getName().str();
96 str +=
"signal_port_name: " + class_name +
"::" +
getName() +
"\n";
99 str +=
"is_array_type: true\n";
102 str +=
"is_array_type: false\n";
105 str +=
"is_pointer_type: true \n";
107 str +=
"is_pointer_type: false\n";
111 str +=
"array_sizes: ";
122 str +=
"decl_type: FieldDecl";
125 str +=
"decl_type: VarDecl";
std::string asString()
Returns the TemplateType data as a std::string.
std::string port_name_
Name of the port.
std::vector< llvm::APInt > array_sizes_
clang::VarDecl * getAsVarDecl() const
std::string getName() const
bool getArrayType() const
Get parameters.
std::string asString() const
Produce dump.
void setModuleName(const std::string &)
Set parameters.
void addArraySize(llvm::APInt size)
clang::FieldDecl * getAsFieldDecl() const
FindTemplateTypes * getTemplateType()
bool is_array_
Is it an array type.
clang::Decl * field_decl_
std::vector< llvm::APInt > getArraySizes() const
FindTemplateTypes * template_type_
This holds the types for the port declaration.
bool isPointerType() const
Clang forward declarations.
std::string toString(const T &i)