aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/PTHLexer.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-10-11Turn FileManager DirectoryEntry::Name from raw pointer to StringRef (NFC)Mehdi Amini1-3/+3
llvm-svn: 283856
2016-10-10Store FileEntry::Filename as a StringRef instead of raw pointer (NFC)Mehdi Amini1-3/+3
llvm-svn: 283815
2016-08-24Remove excessive padding from PTHStatData (NFC)Mehdi Amini1-2/+2
This diff reorders the fields and removes excessive padding. This fixes the following warning: PTHLexer.cpp:629:7: warning: Excessive padding in 'class (anonymous namespace)::PTHStatData' (14 padding bytes, where 6 is optimal). Optimal fields order: Size, ModTime, UniqueID, HasData, IsDirectory, consider reordering the fields or adding explicit padding members. Patch by: Alexander Shaposhnikov <shal1t712@gmail.com> Differential Revision: https://reviews.llvm.org/D23826 llvm-svn: 279607
2016-07-18[NFC] Header cleanupMehdi Amini1-1/+0
Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 llvm-svn: 275882
2015-10-20Roll-back r250822.Angel Garcia Gomez1-1/+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/+1
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-06-22Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko1-1/+1
llvm-svn: 240353
2015-06-22Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko1-1/+1
The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
2015-06-01Replace a few std::string& with StringRef. NFC.Rafael Espindola1-2/+1
Patch by Косов Евгений! llvm-svn: 238774
2014-08-29unique_ptrify PTHManager's PerIDCache using the newly added llvm::FreeDeleterDavid Blaikie1-14/+12
llvm-svn: 216786
2014-08-29unique_ptrify some parameters to PTHManager::PTHManagerDavid Blaikie1-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
2014-08-18Update the call to llvm::sys::fs::UniqueID to match the definition: ↵Sylvestre Ledru1-1/+1
UniqueID(uint64_t Device, uint64_t File) Fixes CID 1095247 llvm-svn: 215896
2014-08-11unique_ptr-ify FileSystemStatCache::setNextStatCacheDavid Blaikie1-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
2014-07-08Improve memory ownership of vfs::Files in the FileSystemStatCache by using ↵David Blaikie1-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
2014-07-07PTH: use a variable instead of a macroAlp Toker1-8/+10
Cleanup only. llvm-svn: 212457
2014-07-06Update for llvm api change.Rafael Espindola1-2/+4
llvm-svn: 212408
2014-06-12Include system_error directly.Rafael Espindola1-1/+1
llvm-svn: 210802
2014-05-17[C++11] Use 'nullptr'. Lex edition.Craig Topper1-18/+18
llvm-svn: 209083
2014-04-18Teach users of OnDiskHashTable to define hash_value and offset typesJustin Bogner1-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
2014-04-18Remove OnDiskHashTable.h, since it's been moved to llvmJustin Bogner1-5/+4
llvm-svn: 206637
2014-03-28Reapply "OnDiskHashTable: Use Endian.h to read little endian ostreams"Justin Bogner1-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
2014-03-28Reapply "OnDiskHashTable: Use EndianStream.h to write little endian ostreams"Justin Bogner1-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
2014-03-28Revert "OnDiskHashTable: Use Endian.h to read little endian ostreams"Justin Bogner1-57/+29
This reverts commit r205045. llvm-svn: 205048
2014-03-28Revert "OnDiskHashTable: Use EndianStream.h to write little endian ostreams"Justin Bogner1-1/+0
This reverts commit r205044. llvm-svn: 205047
2014-03-28OnDiskHashTable: Use Endian.h to read little endian ostreamsJustin Bogner1-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
2014-03-28OnDiskHashTable: Use EndianStream.h to write little endian ostreamsJustin Bogner1-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
2014-03-11[C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper1-1/+1
class. llvm-svn: 203547
2014-03-09[C++11] Replace OwningPtr include with <memory>.Ahmed Charles1-1/+1
llvm-svn: 203389
2014-03-07Replace OwningPtr with std::unique_ptr.Ahmed Charles1-4/+4
This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
2014-03-07Change OwningPtr::take() to OwningPtr::release().Ahmed Charles1-3/+3
This is a precursor to moving to std::unique_ptr. llvm-svn: 203275
2014-02-28Reapply fixed "Honour 'use-external-names' in FileManager"Ben Langmuir1-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
2014-02-27Revert "Honour 'use-external-names' in FileManager"Ben Langmuir1-1/+0
Revert r202442, which broke the buildbots. llvm-svn: 202443
2014-02-27Honour 'use-external-names' in FileManagerBen Langmuir1-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
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
2014-01-26Enforce safe usage of DiagnosticsEngine::getCustomDiagID()Alp Toker1-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
2013-09-19Make Preprocessor::Lex non-recursive.Eli Friedman1-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
2013-08-01Use llvm::sys::fs::UniqueID for windows and unix.Rafael Espindola1-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
2012-12-21Remove duplicate includes.Roman Divacky1-1/+0
llvm-svn: 170903
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-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
2012-09-16Fix dead store found by static analyzer.Ted Kremenek1-5/+2
llvm-svn: 163994
2012-09-06Dont cast away const needlessly. Found by gcc48 -Wcast-qual.Roman Divacky1-2/+2
llvm-svn: 163325
2012-08-17Switch PTH format from a 7 byte magic number to an 8 byte one, to avoidRichard Smith1-3/+3
misaligned reads throughout the file. Bump PTH format version to 10. llvm-svn: 162076
2012-02-05Basic: import OwningPtr<> into clang namespaceDylan Noblesmith1-3/+3
llvm-svn: 149798
2011-09-25Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie1-3/+4
llvm-svn: 140478
2011-09-22Simplify the last character check.David Blaikie1-1/+1
llvm-svn: 140287
2011-09-19Rename SourceLocation::getFileLocWithOffset -> getLocWithOffset.Argyrios Kyrtzidis1-2/+2
It already works (and is useful with) macro locs as well. llvm-svn: 140057
2011-09-04Support code-completion for C++ inline methods and ObjC buffering methods.Argyrios Kyrtzidis1-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