-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvarg.h
More file actions
63 lines (51 loc) · 1.69 KB
/
varg.h
File metadata and controls
63 lines (51 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef __VARG_HPP__
#define __VARG_HPP__
#include "typeinfo.h"
namespace llvm
{
class Function;
};
class GeneratorException : public std::exception
{
std::string error_string;
public:
GeneratorException (const char *e) : error_string(e) {}
GeneratorException (std::string e) : error_string(e) {}
~GeneratorException() throw() {}
const char* what() const throw() { return error_string.c_str(); }
};
class GeneratorArgumentInfo
{
public:
typedef enum {
ARG_AGG_SINGLE,
ARG_AGG_REF,
ARG_AGG_ARRAY
} ArgAggEnum;
private:
ArgAggEnum aggregation;
nanjit::TypeInfo type;
bool aligned;
int alias_index;
public:
GeneratorArgumentInfo();
GeneratorArgumentInfo(std::string str);
void setAligned(bool is_aligned);
void setAggregation(ArgAggEnum agg);
void setAlias(int a);
void parse(std::string str);
std::string toStr() const;
bool getAligned() const;
ArgAggEnum getAggregation() const;
bool getIsAlias() const;
int getAlias() const;
nanjit::TypeInfo getType() const;
llvm::Type *getLLVMBaseType() const;
llvm::Type *getLLVMType() const;
};
std::string llvm_type_to_string(const Type *type);
llvm::Function *llvm_def_for(Module *module, const std::string &function_name, std::list<GeneratorArgumentInfo> &target_arg_list);
llvm::Function *llvm_void_def_for(Module *module, const std::string &function_name, std::list<GeneratorArgumentInfo> &target_arg_list);
llvm::Function *llvm_def_for_range(Module *module, const std::string &function_name, std::list<GeneratorArgumentInfo> &target_arg_list);
llvm::Function *llvm_void_def_for_range(Module *module, const std::string &function_name, std::list<GeneratorArgumentInfo> &target_arg_list);
#endif /* __VARG_HPP__ */