X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FSupport%2FStringPool.cpp;h=1ee917f119f7e446538cfa395715043f9bf93877;hb=2fd100a4cb6c7c013f9bf78fc06b655515b0851c;hp=b9c1fd0465bd69d1171955cadcb71fddcfc56c20;hpb=4ee451de366474b9c228b4e5fa573795a715216d;p=oota-llvm.git diff --git a/lib/Support/StringPool.cpp b/lib/Support/StringPool.cpp index b9c1fd0465b..1ee917f119f 100644 --- a/lib/Support/StringPool.cpp +++ b/lib/Support/StringPool.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/StringPool.h" -#include "llvm/Support/Streams.h" +#include "llvm/ADT/StringRef.h" using namespace llvm; @@ -22,12 +22,12 @@ StringPool::~StringPool() { assert(InternTable.empty() && "PooledStringPtr leaked!"); } -PooledStringPtr StringPool::intern(const char *Begin, const char *End) { - table_t::iterator I = InternTable.find(Begin, End); +PooledStringPtr StringPool::intern(const StringRef &Key) { + table_t::iterator I = InternTable.find(Key); if (I != InternTable.end()) return PooledStringPtr(&*I); - entry_t *S = entry_t::Create(Begin, End); + entry_t *S = entry_t::Create(Key.begin(), Key.end()); S->getValue().Pool = this; InternTable.insert(S);