]> granicus.if.org Git - clang/commitdiff
Declare PerIDCache as IdentifierInfo** instead of void*. This is just cleaner. ...
authorTed Kremenek <kremenek@apple.com>
Wed, 10 Dec 2008 19:40:23 +0000 (19:40 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 10 Dec 2008 19:40:23 +0000 (19:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60843 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Lex/PTHManager.h
lib/Lex/PTHLexer.cpp

index c9b7b52ec1a73085da79072e3a3d1bdbe4578688..e0c4776d4b21229bf62f7a37ca4ef59e71c0474f 100644 (file)
@@ -38,7 +38,7 @@ class PTHManager {
   
   /// IdMap - A lazily generated cache mapping from persistent identifiers to
   ///  IdentifierInfo*.
-  void* PerIDCache;
+  IdentifierInfo** PerIDCache;
   
   /// FileLookup - Abstract data structure used for mapping between files
   ///  and token data in the PTH file.
@@ -59,7 +59,8 @@ class PTHManager {
   /// This constructor is intended to only be called by the static 'Create'
   /// method.
   PTHManager(const llvm::MemoryBuffer* buf, void* fileLookup,
-             const char* idDataTable, void* perIDCache, Preprocessor& pp);
+             const char* idDataTable, IdentifierInfo** perIDCache,
+             Preprocessor& pp);
 
   // Do not implement.
   PTHManager();
index 96099308782d4860d8b3193a8456a248fb2a3d14..a92d578518ba46b54fb74e138c1a69f79bbdade4 100644 (file)
@@ -236,7 +236,7 @@ public:
 //===----------------------------------------------------------------------===//
 
 PTHManager::PTHManager(const llvm::MemoryBuffer* buf, void* fileLookup,
-                       const char* idDataTable, void* perIDCache, 
+                       const char* idDataTable, IdentifierInfo** perIDCache, 
                        Preprocessor& pp)
 : Buf(buf), PerIDCache(perIDCache), FileLookup(fileLookup),
   IdDataTable(idDataTable), ITable(pp.getIdentifierTable()), PP(pp) {}
@@ -324,7 +324,7 @@ IdentifierInfo* PTHManager::ReadIdentifierInfo(const char*& D) {
   --persistentID;
   
   // Check if the IdentifierInfo has already been resolved.
-  IdentifierInfo*& II = ((IdentifierInfo**) PerIDCache)[persistentID];
+  IdentifierInfo*& II = PerIDCache[persistentID];
   if (II) return II;
   
   // Look in the PTH file for the string data for the IdentifierInfo object.