diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-25 20:26:24 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-25 20:26:24 +0000 |
commit | 5f8e3302242cf94de2f8e46d10167f57fcf747c3 (patch) | |
tree | 39d2866bd5c544f2745e8658fb92c557251d0f9f /lib/Frontend/PCHReader.cpp | |
parent | 5da8161bdff1c81ab93b55ddd0fd45dc2123ef85 (diff) |
Revert my changes that try to avoid creating StringMap entries for
identifiers. They don't yet work, but will inhibit future
optimizations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70071 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index 918fd93fdd..005436dccf 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -1245,8 +1245,8 @@ public: static std::pair<unsigned, unsigned> ReadKeyDataLength(const unsigned char*& d) { using namespace clang::io; - unsigned DataLen = ReadUnalignedLE16(d); unsigned KeyLen = ReadUnalignedLE16(d); + unsigned DataLen = ReadUnalignedLE16(d); return std::make_pair(KeyLen, DataLen); } @@ -1282,7 +1282,8 @@ public: // the new IdentifierInfo. IdentifierInfo *II = KnownII; if (!II) - II = &Reader.BuildIdentifierInfoInsidePCH((const unsigned char *)k.first); + II = &Reader.getIdentifierTable().CreateIdentifierInfo( + k.first, k.first + k.second); Reader.SetIdentifierInfo(ID, II); // Set or check the various bits in the IdentifierInfo structure. @@ -2848,19 +2849,6 @@ IdentifierInfo *PCHReader::DecodeIdentifierInfo(unsigned ID) { return IdentifiersLoaded[ID - 1]; } -IdentifierInfo & -PCHReader::BuildIdentifierInfoInsidePCH(const unsigned char *Str) { - // Allocate the object. - std::pair<IdentifierInfo,const unsigned char*> *Mem = - Alloc.Allocate<std::pair<IdentifierInfo,const unsigned char*> >(); - - // Build the IdentifierInfo itself. - Mem->second = Str; - assert(Str[0] != '\0'); - IdentifierInfo *II = new ((void*) Mem) IdentifierInfo(); - return *II; -} - Selector PCHReader::DecodeSelector(unsigned ID) { if (ID == 0) return Selector(); |