aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CacheTokens.cpp
AgeCommit message (Collapse)AuthorFilesLines
2015-11-02[PTH] Fix data length used for stat cache entriesReid Kleckner1-1/+1
This came up in a boost build, which apparently uses PTH. This was broken in r187619 when we migrated it to uses llvm::fs instead of raw stat calls. Constructing a test case with a hash table collision in-tree is tough. Instead, I have a pending change to OnDiskChainedHashTable that asserts that the reported length of the data agrees with the data actually written. All of the existing in-tree tests find the bug with this assert. llvm-svn: 251828
2015-11-02Sink some PTHManager includes out of Preprocessor.hReid Kleckner1-0/+1
This reduces the number of .cpp files needed to be rebuilt after touching OnDiskHashTable from 120 to 21 for me. llvm-svn: 251810
2015-10-20Roll-back r250822.Angel Garcia Gomez1-2/+2
Summary: It breaks the build for the ASTMatchers Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13893 llvm-svn: 250827
2015-10-20Apply modernize-use-default to clang.Angel Garcia Gomez1-2/+2
Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 llvm-svn: 250822
2015-04-14Use raw_pwrite_stream in clang.Rafael Espindola1-10/+19
This is a small improvement to -emit-pth and allows llvm to start requiring it. llvm-svn: 234897
2015-04-11Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko1-1/+1
Summary: The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix Reviewers: dblaikie Reviewed By: dblaikie Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D8926 llvm-svn: 234678
2014-11-19Standardize on StringMap::insert, removing uses of StringMap::GetOrCreateValue.David Blaikie1-5/+5
llvm-svn: 222306
2014-08-11unique_ptr-ify FileSystemStatCache::setNextStatCacheDavid Blaikie1-2/+4
And in the process, discover that FileManager::removeStatCache had a double-delete when removing an element from the middle of the list (at the beginning or the end of the list, there was no problem) and add a unit test to exercise the code path (which successfully crashed when run (with modifications to match the old API) without this patch applied) llvm-svn: 215388
2014-07-08Improve memory ownership of vfs::Files in the FileSystemStatCache by using ↵David Blaikie1-1/+2
std::unique_ptr Spotted after a memory leak (due to the complexities of manual memory management) was fixed in 212466. llvm-svn: 212541
2014-05-22[C++11] Use 'nullptr'. Frontend edition.Craig Topper1-3/+3
llvm-svn: 209389
2014-04-18Teach users of OnDiskHashTable to define hash_value and offset typesJustin Bogner1-2/+8
This paves the way to making OnDiskHashTable work with hashes that are not 32 bits wide and to making OnDiskHashTable work very large hash tables. The LLVM change to use these types is upcoming. llvm-svn: 206640
2014-04-18Remove OnDiskHashTable.h, since it's been moved to llvmJustin Bogner1-6/+10
llvm-svn: 206637
2014-03-28Reapply "OnDiskHashTable: Use EndianStream.h to write little endian ostreams"Justin Bogner1-20/+39
Committed this by accident before it was done last time. Original message: Rather than rolling our own functions to write little endian data to an ostream, we can use the support in llvm's EndianStream.h. No functional change. llvm-svn: 205061
2014-03-28Revert "OnDiskHashTable: Use EndianStream.h to write little endian ostreams"Justin Bogner1-39/+20
This reverts commit r205044. llvm-svn: 205047
2014-03-28OnDiskHashTable: Use EndianStream.h to write little endian ostreamsJustin Bogner1-20/+39
Rather than rolling our own functions to write little endian data to an ostream, we can use the support in llvm's EndianStream.h. No functional change. llvm-svn: 205044
2014-03-13[C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper1-1/+1
class. llvm-svn: 203758
2014-02-20Recommit virtual file systemBen Langmuir1-2/+2
Previously reverted in r201755 due to causing an assertion failure. I've removed the offending assertion, and taught the CompilerInstance to create a default virtual file system inside createFileManager. In the future, we should be able to reach into the CompilerInvocation to customize this behaviour without breaking clients that don't care. llvm-svn: 201818
2014-02-20Reverting the virtual file system implementation, because it triggers an ↵Juergen Ributzka1-2/+2
assertion in our internal build bots. This reverts commits 201618, 201635, 201636, 201639, 201685, 201691, and 201696. llvm-svn: 201755
2014-02-19Initial implementation of virtual file systemBen Langmuir1-2/+2
This adds the minimum virtual file system support to start migrating FileManager onto the VFS. Originally discussed here: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-February/035188.html Differential Revision: http://llvm-reviews.chandlerc.com/D2745 llvm-svn: 201618
2013-08-01Use llvm::sys::fs::UniqueID for windows and unix.Rafael Espindola1-23/+22
This unifies the unix and windows versions of FileManager::UniqueDirContainer and FileManager::UniqueFileContainer by using UniqueID. We cannot just replace "struct stat" with llvm::sys::fs::file_status, since we want to be able to construct fake ones, and file_status has different members on unix and windows. What the patch does is: * Record only the information that clang is actually using. * Use llvm::sys::fs::status instead of stat and fstat. * Use llvm::sys::fs::UniqueID * Delete the old windows versions of UniqueDirContainer and UniqueFileContainer since the "unix" one now works on windows too. llvm-svn: 187619
2012-12-11Extend stat query APIs to explicitly specify if the query is forArgyrios Kyrtzidis1-2/+2
a file or directory, allowing just a stat call if a file descriptor is not needed. Doing just 'stat' is faster than 'open/fstat/close'. This has the effect of cutting down system time for validating the input files of a PCH. llvm-svn: 169831
2012-12-04Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth1-1/+1
uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
2012-08-17Switch PTH format from a 7 byte magic number to an 8 byte one, to avoidRichard Smith1-1/+1
misaligned reads throughout the file. Bump PTH format version to 10. llvm-svn: 162076
2012-03-11Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie1-1/+1
(Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
2012-02-05Basic: import SmallString<> into clang namespaceDylan Noblesmith1-1/+1
(I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
2011-07-23remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner1-10/+10
LLVM.h imports them into the clang namespace. llvm-svn: 135852
2011-06-21Make more use of llvm::StringRef in various APIs. In particular, don'tJay Foad1-4/+3
use the deprecated forms of llvm::StringMap::GetOrCreateValue(). llvm-svn: 133515
2011-03-05Currently we can only remap a file by creating a MemoryBuffer and replacing ↵Argyrios Kyrtzidis1-1/+1
the file contents with it. Allow remapping a file by specifying another filename whose contents should be loaded if the original file gets loaded. This allows to override files without having to create & load buffers in advance. llvm-svn: 127052
2011-02-28Rename tok::eom to tok::eod.Peter Collingbourne1-2/+2
The previous name was inaccurate as this token in fact appears at the end of every preprocessing directive, not just macro definitions. No functionality change, except for a diagnostic tweak. llvm-svn: 126631
2010-12-22Introduced raw_identifier token kind.Abramo Bagnara1-4/+4
llvm-svn: 122394
2010-12-21Replace all uses of PathV1::makeAbsolute with PathV2::fs::make_absolute.Michael J. Spencer1-2/+3
llvm-svn: 122340
2010-12-17Replace all uses of PathV1::isAbsolute with PathV2::is_{absolute,relative}.Michael J. Spencer1-3/+2
llvm-svn: 122087
2010-11-29Merge System into Support.Michael J. Spencer1-1/+1
llvm-svn: 120297
2010-11-23change the 'is directory' indicator to be a null-or-notChris Lattner1-2/+3
pointer that is passed down through the APIs, and make FileSystemStatCache::get be the one that filters out directory lookups that hit files. This also paves the way to have stat queries be able to return opened files. llvm-svn: 120060
2010-11-23simplify the cache miss handling code, eliminating CacheMissing.Chris Lattner1-8/+3
llvm-svn: 120038
2010-11-23rework the stat cache, pulling it out of FileManager.h intoChris Lattner1-13/+19
its own header and giving it some more structure. No functionality change. llvm-svn: 120030
2010-09-04zap dead code.Chris Lattner1-2/+0
llvm-svn: 113074
2010-07-27PTH generation: Don't save the leading '#' token in a null directive. This ↵Ted Kremenek1-4/+9
unbreaks using PTH with Boost (<rdar://problem/8227989>). llvm-svn: 109484
2010-04-20push some source location information down through the compiler,Chris Lattner1-3/+2
into ContentCache::getBuffer. This allows it to produce diagnostics on the broken #include line instead of without a location. llvm-svn: 101939
2010-03-18Make some typedefs privateKovarththanan Rajaratnam1-2/+3
llvm-svn: 98817
2010-03-18Rename variable to indicate what it is being used forKovarththanan Rajaratnam1-4/+4
llvm-svn: 98816
2010-03-17Entering the main source file in the preprocessor can fail if theDouglas Gregor1-1/+2
source file has been changed. Handle that failure more gracefully. llvm-svn: 98727
2010-03-16Use SourceManager's Diagnostic object for all file-reading errors,Douglas Gregor1-1/+1
simplifying the SourceManager interfaces somewhat. llvm-svn: 98598
2010-03-14Add EmitString helper methodKovarththanan Rajaratnam1-2/+6
llvm-svn: 98488
2010-03-14Unbreak last commit. This should have been part of r98478.Kovarththanan Rajaratnam1-3/+3
llvm-svn: 98480
2010-03-14Pass file string by referenceKovarththanan Rajaratnam1-6/+4
llvm-svn: 98478
2010-03-14Use makeAbsolute()Kovarththanan Rajaratnam1-7/+2
llvm-svn: 98472
2010-03-14Move to anonymous namespaceKovarththanan Rajaratnam1-1/+1
llvm-svn: 98469
2010-03-13No need to call setIdentifierInfo() after LookUpIdentifierInfo() which ↵Kovarththanan Rajaratnam1-3/+2
LookUpIdentifierInfo() will automatically do llvm-svn: 98435
2010-03-07Don't rely on implicit conversionKovarththanan Rajaratnam1-2/+2
llvm-svn: 97916