top | up | prev | next

ValueStack Class

Definition at line 16 of ValueStack.hpp

Member Functions

void Dup() override
void* Pop() override
void Push(void* val) override
void Rotate() override
void Swap() override

Member Variables

std::vector<llvm::Value*> s

Member Function Details

Dup Member Function

void cmllvm::ValueStack::Dup() override

Definition at line 31 of ValueStack.hpp :
32 {
33     s.push_back(s.back());
34 }


Base class overridden functions: cmajor::ir::ValueStack::Dup


Pop Member Function

void * cmllvm::ValueStack::Pop() override

Definition at line 24 of ValueStack.hpp :
25 {
26     Assert(!s.empty()"value stack is empty");
27     llvm::Value* top = s.back();
28     s.pop_back();
29     return top;
30 }


Base class overridden functions: cmajor::ir::ValueStack::Pop


Push Member Function

void cmllvm::ValueStack::Push(void * val) override

Definition at line 19 of ValueStack.hpp :
20 {
21     llvm::Value* value = static_cast<llvm::Value*>(val);
22     s.push_back(value);
23 }


Base class overridden functions: cmajor::ir::ValueStack::Push


Rotate Member Function

void cmllvm::ValueStack::Rotate() override

Definition at line 39 of ValueStack.hpp :
40 {
41     std::swap(s[s.size() - 3]s[s.size() - 2]);
42     std::swap(s.back()s[s.size() - 2]);
43 }


Base class overridden functions: cmajor::ir::ValueStack::Rotate


Swap Member Function

void cmllvm::ValueStack::Swap() override

Definition at line 35 of ValueStack.hpp :
36 {
37     std::swap(s.back()s[s.size() - 2]);
38 }


Base class overridden functions: cmajor::ir::ValueStack::Swap


top | up | prev | next