mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
Argument.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
3
#pragma once
4
5
#include <cstdlib>
6
#include <memory>
7
#include <string>
8
#include <utility>
9
10
#include "
mini-llvm/ir/Type.h
"
11
#include "
mini-llvm/ir/Value.h
"
12
13
namespace
mini_llvm::ir
{
14
15
class
Argument
final :
public
Value
{
16
public
:
17
explicit
Argument
(std::unique_ptr<Type>
type
) : type_(std::move(
type
)) {}
18
19
std::unique_ptr<Type>
type
()
const override
{
20
return
type_->clone();
21
}
22
23
std::string
format
()
const override
{
24
abort();
25
}
26
27
std::string
formatAsOperand
()
const override
{
28
return
"%"
+
formatName
();
29
}
30
31
std::unique_ptr<Value>
clone
()
const override
{
32
abort();
33
}
34
35
private
:
36
std::unique_ptr<Type> type_;
37
};
38
39
}
// namespace mini_llvm::ir
Type.h
Value.h
mini_llvm::ir::Argument::formatAsOperand
std::string formatAsOperand() const override
Definition
Argument.h:27
mini_llvm::ir::Argument::clone
std::unique_ptr< Value > clone() const override
Definition
Argument.h:31
mini_llvm::ir::Argument::type
std::unique_ptr< Type > type() const override
Definition
Argument.h:19
mini_llvm::ir::Argument::Argument
Argument(std::unique_ptr< Type > type)
Definition
Argument.h:17
mini_llvm::ir::Argument::format
std::string format() const override
Definition
Argument.h:23
mini_llvm::ir::Value::formatName
std::string formatName() const
mini_llvm::ir::Value::Value
Value()=default
mini_llvm::ir
Definition
Argument.h:13
include
mini-llvm
ir
Argument.h
Generated by
1.17.0