forked from OSchip/llvm-project
[ORC] Add dereference operator to SymbolStringPtr.
Dereference yields a StringRef. llvm-svn: 321836
This commit is contained in:
parent
8040e5047b
commit
183a059f76
|
@ -92,6 +92,8 @@ public:
|
|||
return S->getValue() < Other.S->getValue();
|
||||
}
|
||||
|
||||
StringRef operator*() const { return S->first(); }
|
||||
|
||||
private:
|
||||
|
||||
SymbolStringPtr(SymbolStringPool::PoolMapEntry *S)
|
||||
|
|
|
@ -34,6 +34,12 @@ TEST(SymbolStringPool, UniquingAndComparisons) {
|
|||
(void)(P1 < P3);
|
||||
}
|
||||
|
||||
TEST(SymbolStringPool, Dereference) {
|
||||
SymbolStringPool SP;
|
||||
auto Foo = SP.intern("foo");
|
||||
EXPECT_EQ(*Foo, "foo") << "Equality on dereferenced string failed";
|
||||
}
|
||||
|
||||
TEST(SymbolStringPool, ClearDeadEntries) {
|
||||
SymbolStringPool SP;
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue