diff options
| author | Nagi5Yeq <wu@x-nagi.com> | 2020-05-13 00:40:23 +0800 |
|---|---|---|
| committer | Nagi5Yeq <wu@x-nagi.com> | 2020-05-13 00:40:23 +0800 |
| commit | c7d52437db42232d98e585a52ed2fdf75eb7f1af (patch) | |
| tree | 46f6c75f49de6c53937b53266fcf153cc0f8c510 /node | |
| parent | 61d670dda6f95aa414b4ea4a7dcaba25890b9e6b (diff) | |
code refactoring
Diffstat (limited to 'node')
| -rw-r--r-- | node/BaseNode.hh | 7 | ||||
| -rw-r--r-- | node/LiteralNode.cc | 2 | ||||
| -rw-r--r-- | node/LiteralNode.hh | 4 | ||||
| -rw-r--r-- | node/Node.hh | 8 |
4 files changed, 15 insertions, 6 deletions
diff --git a/node/BaseNode.hh b/node/BaseNode.hh index ae0ccea..60e25bd 100644 --- a/node/BaseNode.hh +++ b/node/BaseNode.hh @@ -1,12 +1,11 @@ -#ifndef PCC_BASE_H -#define PCC_BASE_H +#ifndef PCC_BASENODE_H +#define PCC_BASENODE_H #include <llvm/IR/Value.h> -#include "Driver.hh" - namespace pcc { using Value = llvm::Value*; +class Driver; class BaseNode { public: diff --git a/node/LiteralNode.cc b/node/LiteralNode.cc index 57cc65b..dd84ff9 100644 --- a/node/LiteralNode.cc +++ b/node/LiteralNode.cc @@ -1,4 +1,4 @@ -#include "LiteralNode.hh" +#include "Node.hh" namespace pcc { StringLiteralNode::StringLiteralNode(Driver* driver, char* value) diff --git a/node/LiteralNode.hh b/node/LiteralNode.hh index 2e9b43a..4f9a61a 100644 --- a/node/LiteralNode.hh +++ b/node/LiteralNode.hh @@ -1,6 +1,8 @@ #ifndef PCC_LITERALNODE_H #define PCC_LITERALNODE_H +#include <string> + #include "BaseNode.hh" namespace pcc { @@ -10,7 +12,7 @@ class StringLiteralNode : public BaseNode { Value CodeGen() override; private: - char* value_; + std::string value_; }; } // namespace pcc diff --git a/node/Node.hh b/node/Node.hh new file mode 100644 index 0000000..3a02689 --- /dev/null +++ b/node/Node.hh @@ -0,0 +1,8 @@ +#ifndef PCC_NODE_H +#define PCC_NODE_H + +#include "Driver.hh" +#include "BaseNode.hh" +#include "LiteralNode.hh" + +#endif // !PCC_NODE_H |
