summaryrefslogtreecommitdiff
path: root/gcc/d/dmd/identifier.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/d/dmd/identifier.h')
-rw-r--r--gcc/d/dmd/identifier.h32
1 files changed, 12 insertions, 20 deletions
diff --git a/gcc/d/dmd/identifier.h b/gcc/d/dmd/identifier.h
index 278ce9b8a76..790d5a036d4 100644
--- a/gcc/d/dmd/identifier.h
+++ b/gcc/d/dmd/identifier.h
@@ -10,40 +10,32 @@
#pragma once
-#include "root/root.h"
-#include "root/stringtable.h"
+#include "root/dcompat.h"
+#include "root/object.h"
class Identifier : public RootObject
{
private:
int value;
- const char *string;
- size_t len;
+ bool isAnonymous_;
+ DString string;
public:
- Identifier(const char *string, size_t length, int value);
- Identifier(const char *string);
static Identifier* create(const char *string);
- bool equals(RootObject *o);
- int compare(RootObject *o);
- void print();
- const char *toChars();
+ bool equals(const RootObject *o) const;
+ const char *toChars() const;
int getValue() const;
- const char *toHChars2();
- int dyncast() const;
+ bool isAnonymous() const;
+ const char *toHChars2() const;
+ DYNCAST dyncast() const;
- static StringTable stringtable;
- static Identifier *generateId(const char *prefix);
- static Identifier *generateId(const char *prefix, size_t i);
- static Identifier *idPool(const char *s, size_t len);
- static Identifier *idPool(const char *s, size_t len, int value);
+ static Identifier *generateId(const char *prefix, size_t length, size_t suffix);
+ static Identifier *idPool(const char *s, unsigned len);
static inline Identifier *idPool(const char *s)
{
- return idPool(s, strlen(s));
+ return idPool(s, static_cast<unsigned>(strlen(s)));
}
static bool isValidIdentifier(const char *p);
- static Identifier *lookup(const char *s, size_t len);
- static void initTable();
};