summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PTHLexer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* unique_ptrify PTHManager's PerIDCache using the newly added llvm::FreeDeleterDavid Blaikie2014-08-291-14/+12
| | | | llvm-svn: 216786
* unique_ptrify some parameters to PTHManager::PTHManagerDavid Blaikie2014-08-291-35/+29
| | | | | | | | | A couple of these arguments were passed by void* as a rather extreme example of pimpling. Adjusting this to a more classic form of the idiom (involving forward declarations) makes this more legible and allows explicit passing of ownership via std::unique_ptr. llvm-svn: 216785
* Update the call to llvm::sys::fs::UniqueID to match the definition: ↵Sylvestre Ledru2014-08-181-1/+1
| | | | | | | | UniqueID(uint64_t Device, uint64_t File) Fixes CID 1095247 llvm-svn: 215896
* unique_ptr-ify FileSystemStatCache::setNextStatCacheDavid Blaikie2014-08-111-2/+2
| | | | | | | | | | 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
* Improve memory ownership of vfs::Files in the FileSystemStatCache by using ↵David Blaikie2014-07-081-3/+2
| | | | | | | | | std::unique_ptr Spotted after a memory leak (due to the complexities of manual memory management) was fixed in 212466. llvm-svn: 212541
* PTH: use a variable instead of a macroAlp Toker2014-07-071-8/+10
| | | | | | Cleanup only. llvm-svn: 212457
* Update for llvm api change.Rafael Espindola2014-07-061-2/+4
| | | | llvm-svn: 212408
* Include system_error directly.Rafael Espindola2014-06-121-1/+1
| | | | llvm-svn: 210802
* [C++11] Use 'nullptr'. Lex edition.Craig Topper2014-05-171-18/+18
| | | | llvm-svn: 209083
* Teach users of OnDiskHashTable to define hash_value and offset typesJustin Bogner2014-04-181-8/+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
* Remove OnDiskHashTable.h, since it's been moved to llvmJustin Bogner2014-04-181-5/+4
| | | | llvm-svn: 206637
* Reapply "OnDiskHashTable: Use Endian.h to read little endian ostreams"Justin Bogner2014-03-281-29/+57
| | | | | | | | | | | | | Committed this by accident before it was done last time. Original message: Rather than rolling our own functions to read little endian data from a buffer, we can use the support in llvm's Endian.h. No functional change. llvm-svn: 205062
* Reapply "OnDiskHashTable: Use EndianStream.h to write little endian ostreams"Justin Bogner2014-03-281-0/+1
| | | | | | | | | | | | | 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
* Revert "OnDiskHashTable: Use Endian.h to read little endian ostreams"Justin Bogner2014-03-281-57/+29
| | | | | | This reverts commit r205045. llvm-svn: 205048
* Revert "OnDiskHashTable: Use EndianStream.h to write little endian ostreams"Justin Bogner2014-03-281-1/+0
| | | | | | This reverts commit r205044. llvm-svn: 205047
* OnDiskHashTable: Use Endian.h to read little endian ostreamsJustin Bogner2014-03-281-29/+57
| | | | | | | | | Rather than rolling our own functions to read little endian data from a buffer, we can use the support in llvm's Endian.h. No functional change. llvm-svn: 205045
* OnDiskHashTable: Use EndianStream.h to write little endian ostreamsJustin Bogner2014-03-281-0/+1
| | | | | | | | | 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
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-111-1/+1
| | | | | | class. llvm-svn: 203547
* [C++11] Replace OwningPtr include with <memory>.Ahmed Charles2014-03-091-1/+1
| | | | llvm-svn: 203389
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-4/+4
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* Change OwningPtr::take() to OwningPtr::release().Ahmed Charles2014-03-071-3/+3
| | | | | | This is a precursor to moving to std::unique_ptr. llvm-svn: 203275
* Reapply fixed "Honour 'use-external-names' in FileManager"Ben Langmuir2014-02-281-0/+1
| | | | | | | | | | | | | | | | Was r202442 There were two issues with the original patch that have now been fixed. 1. We were memset'ing over a FileEntry in a test case. After adding a std::string to FileEntry, this still happened to not break for me. 2. I didn't pass the FileManager into the new compiler instance in compileModule. This was hidden in some cases by the fact I didn't clear the module cache in the test. Also, I changed the copy constructor for FileEntry, which was memcpy'ing in a (now) unsafe way. llvm-svn: 202539
* Revert "Honour 'use-external-names' in FileManager"Ben Langmuir2014-02-271-1/+0
| | | | | | Revert r202442, which broke the buildbots. llvm-svn: 202443
* Honour 'use-external-names' in FileManagerBen Langmuir2014-02-271-0/+1
| | | | | | | | Pass through the externally-visible names that we got from the VFS down to FileManager, and test that this is the name showing up in __FILE__, diagnostics, and debug information. llvm-svn: 202442
* Recommit virtual file systemBen Langmuir2014-02-201-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
* Reverting the virtual file system implementation, because it triggers an ↵Juergen Ributzka2014-02-201-2/+2
| | | | | | | | | | assertion in our internal build bots. This reverts commits 201618, 201635, 201636, 201639, 201685, 201691, and 201696. llvm-svn: 201755
* Initial implementation of virtual file systemBen Langmuir2014-02-191-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
* Enforce safe usage of DiagnosticsEngine::getCustomDiagID()Alp Toker2014-01-261-1/+1
| | | | | | | | | | | | | | | | Replace the last incorrect uses and templatize the function to require a compile-time constant string preventing further misuse. The diagnostic formatter expects well-formed input and has undefined behaviour with arbitrary input or crafted user strings in source files. Accepting user input would also have caused unbounded generation of new diagnostic IDs which can be problematic in long-running sessions or language bindings. This completes the work to fix several incorrect callers that passed user input or raw messages to the diagnostics engine where a constant format string was expected. llvm-svn: 200132
* Make Preprocessor::Lex non-recursive.Eli Friedman2013-09-191-17/+8
| | | | | | | | | | | | | | | Before this patch, Lex() would recurse whenever the current lexer changed (e.g. upon entry into a macro). This patch turns the recursion into a loop: the various lex routines now don't return a token when the current lexer changes, and at the top level Preprocessor::Lex() now loops until it finds a token. Normally, the recursion wouldn't end up being very deep, but the recursion depth can explode in edge cases like a bunch of consecutive macros which expand to nothing (like in the testcase test/Preprocessor/macro_expand_empty.c in this patch). <rdar://problem/14569770> llvm-svn: 190980
* Use llvm::sys::fs::UniqueID for windows and unix.Rafael Espindola2013-08-011-28/+36
| | | | | | | | | | | | | | | | | | | 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
* Remove duplicate includes.Roman Divacky2012-12-211-1/+0
| | | | llvm-svn: 170903
* Extend stat query APIs to explicitly specify if the query is forArgyrios Kyrtzidis2012-12-111-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
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-4/+4
| | | | | | | | | | | | | 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
* Fix dead store found by static analyzer.Ted Kremenek2012-09-161-5/+2
| | | | llvm-svn: 163994
* Dont cast away const needlessly. Found by gcc48 -Wcast-qual.Roman Divacky2012-09-061-2/+2
| | | | llvm-svn: 163325
* Switch PTH format from a 7 byte magic number to an 8 byte one, to avoidRichard Smith2012-08-171-3/+3
| | | | | | misaligned reads throughout the file. Bump PTH format version to 10. llvm-svn: 162076
* Basic: import OwningPtr<> into clang namespaceDylan Noblesmith2012-02-051-3/+3
| | | | llvm-svn: 149798
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-3/+4
| | | | llvm-svn: 140478
* Simplify the last character check.David Blaikie2011-09-221-1/+1
| | | | llvm-svn: 140287
* Rename SourceLocation::getFileLocWithOffset -> getLocWithOffset.Argyrios Kyrtzidis2011-09-191-2/+2
| | | | | | It already works (and is useful with) macro locs as well. llvm-svn: 140057
* Support code-completion for C++ inline methods and ObjC buffering methods.Argyrios Kyrtzidis2011-09-041-1/+1
| | | | | | | | | | | | | | Previously we would cut off the source file buffer at the code-completion point; this impeded code-completion inside C++ inline methods and, recently, with buffering ObjC methods. Have the code-completion inserted into the source buffer so that it can be buffered along with a method body. When we actually hit the code-completion point the cut-off lexing or parsing. Fixes rdar://10056932&8319466 llvm-svn: 139086
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-2/+2
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* fix a bunch of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129559
* Rename tok::eom to tok::eod.Peter Collingbourne2011-02-281-1/+1
| | | | | | | | 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
* MemoryBuffer API update.Michael J. Spencer2010-12-161-4/+2
| | | | llvm-svn: 121956
* Use error_code instead of std::string* for MemoryBuffer.Michael J. Spencer2010-12-091-1/+5
| | | | llvm-svn: 121378
* change the 'is directory' indicator to be a null-or-notChris Lattner2010-11-231-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
* simplify the cache miss handling code, eliminating CacheMissing.Chris Lattner2010-11-231-3/+2
| | | | llvm-svn: 120038
* rework the stat cache, pulling it out of FileManager.h intoChris Lattner2010-11-231-13/+14
| | | | | | | its own header and giving it some more structure. No functionality change. llvm-svn: 120030
* don't allow remapping PTH file paths with -fworking-directory, theChris Lattner2010-11-231-3/+2
| | | | | | client should just pass in absolute paths. llvm-svn: 120012
OpenPOWER on IntegriCloud