mini-llvm 0.1.0
Loading...
Searching...
No Matches
StackSlot.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2
3#pragma once
4
6
7namespace mini_llvm::mir {
8
9class StackFrame;
10
12public:
13 StackSlot(int size, int alignment) : size_(size), alignment_(alignment) {}
14 StackSlot(const StackSlot &) = delete;
15 StackSlot(StackSlot &&) = delete;
16 StackSlot &operator=(const StackSlot &) = delete;
18
19 int size() const {
20 return size_;
21 }
22
23 int alignment() const {
24 return alignment_;
25 }
26
27 StackFrame *frame() const {
28 return frame_;
29 }
30
31 int offset() const;
32
33private:
34 int size_, alignment_;
35 mutable StackFrame *frame_{};
36 mutable int offset_{};
37
38 friend class StackFrame;
39};
40
41} // namespace mini_llvm::mir
#define MINI_LLVM_EXPORT
Definition Compiler.h:17
Definition StackFrame.h:17
StackSlot(StackSlot &&)=delete
StackSlot(const StackSlot &)=delete
int alignment() const
Definition StackSlot.h:23
StackFrame * frame() const
Definition StackSlot.h:27
friend class StackFrame
Definition StackSlot.h:38
StackSlot(int size, int alignment)
Definition StackSlot.h:13
int size() const
Definition StackSlot.h:19
StackSlot & operator=(const StackSlot &)=delete
StackSlot & operator=(StackSlot &&)=delete
Definition BasicBlock.h:22