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