aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/IdentifierTable.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-25 20:21:25 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-25 20:21:25 +0000
commit5da8161bdff1c81ab93b55ddd0fd45dc2123ef85 (patch)
tree22d0bac4193cddc685951032d08bb0971cfc7302 /include/clang/Basic/IdentifierTable.h
parent654599454c8e6cc83b1b9b3af43c49c2f66a26cb (diff)
Start implementing the PTH IdentifierInfo-saving trick in PCH,
allocating IdentifierInfos with a pointer into the string data stored in the PCH file rather than having an entry in the identifier table's string map. However, we don't actually get these savings at the moment, because we go through the IdentifierTable when loading identifiers from the on-disk hash table. This commit is for record-keeping purposes only. I'll be reverting this change (and the PCH layout tweak that preceded it) because it appears that implementing this optimization will collide with another, future optimization to reduce the size of the on-disk hash table for identifiers. That optimization is likely to provide more benefit (with less voodoo). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70070 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/IdentifierTable.h')
-rw-r--r--include/clang/Basic/IdentifierTable.h28
1 files changed, 0 insertions, 28 deletions
diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h
index 235c19081c..99580a17fe 100644
--- a/include/clang/Basic/IdentifierTable.h
+++ b/include/clang/Basic/IdentifierTable.h
@@ -293,34 +293,6 @@ public:
return *II;
}
- /// \brief Creates a new IdentifierInfo from the given string.
- ///
- /// This is a lower-level version of get() that requires that this
- /// identifier not be known previously and that does not consult an
- /// external source for identifiers. In particular, external
- /// identifier sources can use this routine to build IdentifierInfo
- /// nodes and then introduce additional information about those
- /// identifiers.
- IdentifierInfo &CreateIdentifierInfo(const char *NameStart,
- const char *NameEnd) {
- llvm::StringMapEntry<IdentifierInfo*> &Entry =
- HashTable.GetOrCreateValue(NameStart, NameEnd);
-
- IdentifierInfo *II = Entry.getValue();
- assert(!II && "IdentifierInfo already exists");
-
- // Lookups failed, make a new IdentifierInfo.
- void *Mem = getAllocator().Allocate<IdentifierInfo>();
- II = new (Mem) IdentifierInfo();
- Entry.setValue(II);
-
- // Make sure getName() knows how to find the IdentifierInfo
- // contents.
- II->Entry = &Entry;
-
- return *II;
- }
-
IdentifierInfo &get(const char *Name) {
return get(Name, Name+strlen(Name));
}