tipc
A TIP to LLVM compiler
ASTRecordExpr.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "ASTExpr.h"
4 #include "ASTFieldExpr.h"
5 
8 class ASTRecordExpr : public ASTExpr {
9  std::vector<std::shared_ptr<ASTFieldExpr>> FIELDS;
10 
11 public:
12  std::vector<std::shared_ptr<ASTNode>> getChildren() override;
13  ASTRecordExpr(std::vector<std::shared_ptr<ASTFieldExpr>> FIELDS);
14  std::vector<ASTFieldExpr *> getFields() const;
15  void accept(ASTVisitor *visitor) override;
16  llvm::Value *codegen() override;
17 
18 protected:
19  std::ostream &print(std::ostream &out) const override;
20 };
Abstract class for all expression subtypes.
Definition: ASTExpr.h:7
Class for defining a record.
Definition: ASTRecordExpr.h:8
std::ostream & print(std::ostream &out) const override
Definition: ASTRecordExpr.cpp:26
std::vector< std::shared_ptr< ASTNode > > getChildren() override
Return all of the children for the node.
Definition: ASTRecordExpr.cpp:41
ASTRecordExpr(std::vector< std::shared_ptr< ASTFieldExpr >> FIELDS)
Definition: ASTRecordExpr.cpp:5
llvm::Value * codegen() override
Perform code generation and return an LLVM value the code.
Definition: CodeGenFunctions.cpp:658
void accept(ASTVisitor *visitor) override
Visit the children of this node and apply the visitor.
Definition: ASTRecordExpr.cpp:17
std::vector< ASTFieldExpr * > getFields() const
Definition: ASTRecordExpr.cpp:13
Base class for AST visitors.
Definition: ASTVisitor.h:23