mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-29 07:22:07 +00:00
26 lines
387 B
C
26 lines
387 B
C
|
|
||
|
#pragma once
|
||
|
|
||
|
template<typename SSAVariable>
|
||
|
class SSAStack
|
||
|
{
|
||
|
public:
|
||
|
SSAStack()
|
||
|
: v(0)
|
||
|
{
|
||
|
v = SSAScope::alloca(SSAVariable::llvm_type());
|
||
|
}
|
||
|
|
||
|
SSAVariable load() const
|
||
|
{
|
||
|
return SSAVariable::from_llvm(SSAScope::builder().CreateLoad(v, SSAScope::hint()));
|
||
|
}
|
||
|
|
||
|
void store(const SSAVariable &new_value)
|
||
|
{
|
||
|
SSAScope::builder().CreateStore(new_value.v, v);
|
||
|
}
|
||
|
|
||
|
llvm::Value *v;
|
||
|
};
|