[cfe-commits] r63159 - in /cfe/trunk: include/clang/Basic/FileManager.h lib/Basic/FileManager.cpp
Ted Kremenek
kremenek at apple.com
Tue Jan 27 16:44:13 PST 2009
Author: kremenek
Date: Tue Jan 27 18:44:12 2009
New Revision: 63159
URL: http://llvm.org/viewvc/llvm-project?rev=63159&view=rev
Log:
FileManager: Use a BumpPtrAllocator for the StringMaps DirEntries and FileEntries.
Performance impact (clang -fsyntax-only INPUTS/Cocoa_h.m):
non-PTH: 0.4% improvement
PTH: 0.8% improvement
Modified:
cfe/trunk/include/clang/Basic/FileManager.h
cfe/trunk/lib/Basic/FileManager.cpp
Modified: cfe/trunk/include/clang/Basic/FileManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/FileManager.h?rev=63159&r1=63158&r2=63159&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/FileManager.h (original)
+++ cfe/trunk/include/clang/Basic/FileManager.h Tue Jan 27 18:44:12 2009
@@ -16,6 +16,7 @@
#include "llvm/ADT/StringMap.h"
#include "llvm/Bitcode/SerializationFwd.h"
+#include "llvm/Support/Allocator.h"
#include <map>
#include <set>
#include <string>
@@ -86,8 +87,8 @@
/// DirEntries/FileEntries - This is a cache of directory/file entries we have
/// looked up. The actual Entry is owned by UniqueFiles/UniqueDirs above.
///
- llvm::StringMap<DirectoryEntry*> DirEntries;
- llvm::StringMap<FileEntry*> FileEntries;
+ llvm::StringMap<DirectoryEntry*, llvm::BumpPtrAllocator> DirEntries;
+ llvm::StringMap<FileEntry*, llvm::BumpPtrAllocator> FileEntries;
/// NextFileUID - Each FileEntry we create is assigned a unique ID #.
///
Modified: cfe/trunk/lib/Basic/FileManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/FileManager.cpp?rev=63159&r1=63158&r2=63159&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/FileManager.cpp (original)
+++ cfe/trunk/lib/Basic/FileManager.cpp Tue Jan 27 18:44:12 2009
@@ -22,7 +22,6 @@
#include "llvm/Bitcode/Serialize.h"
#include "llvm/Bitcode/Deserialize.h"
#include "llvm/Support/Streams.h"
-#include "llvm/Support/Allocator.h"
#include "llvm/Config/config.h"
using namespace clang;
More information about the cfe-commits
mailing list