source: icGREP/icgrep-devel/icgrep/pablo/pe_string.h @ 4257

Last change on this file since 4257 was 4257, checked in by nmedfort, 5 years ago

Pablo Compiler now generates phi nodes created for carry variables. zStarHeight showed 33% improvement. Had to manually merge in last check-in's changes.

File size: 875 bytes
Line 
1#ifndef PE_STRING_H
2#define PE_STRING_H
3
4#include <pablo/pabloAST.h>
5#include <string>
6
7namespace pablo {
8
9class String : public PabloAST {
10    friend String * makeString(const std::string value) noexcept;
11public:
12    static inline bool classof(const PabloAST * e) {
13        return e->getClassTypeId() == ClassTypeId::String;
14    }
15    static inline bool classof(const void *) {
16        return false;
17    }
18    virtual ~String(){
19
20    }
21    inline const std::string & str() const {
22        return mValue;
23    }
24    inline std::string str() {
25        return mValue;
26    }
27protected:
28    String(const std::string && value) noexcept
29    : PabloAST(ClassTypeId::String)
30    , mValue(value)
31    {
32
33    }
34private:
35    const std::string mValue;
36};
37
38inline String * makeString(const std::string value) noexcept {
39    return new String(std::move(value));
40}
41
42
43}
44
45#endif // PE_STRING_H
Note: See TracBrowser for help on using the repository browser.