-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSymbol.h
41 lines (32 loc) · 834 Bytes
/
Symbol.h
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
#ifndef BLANG_SYMBOL_H_
#define BLANG_SYMBOL_H_
#include <string>
#include <vector>
#include "llvm/Type.h"
#include "llvm/Value.h"
namespace BLang
{
class Symbol
{
public:
static Symbol *CreateSymbol( llvm::Type *type, const std::string &name )
{
return new Symbol( type, name );
}
static Symbol *CreateType( llvm::Type *type, const std::string &name )
{
return new Symbol( type, name );
}
virtual ~Symbol() {}
llvm::Type *getType() { return mType; }
std::string &getName() { return mName; }
void setValue( llvm::Value *v ) { mValue = v; }
llvm::Value *getValue() { return mValue; }
private:
Symbol( llvm::Type *type, const std::string &name ) : mType( type ), mName( name ) {}
llvm::Type *mType;
llvm::Value *mValue;
std::string mName;
};
};
#endif // BLANG_SYMBOL_H_