summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Basic
Commit message (Collapse)AuthorAgeFilesLines
* Make DiagnosticErrorTrap work even if SuppressAllDiagnostics is enabled.Richard Smith2014-12-052-0/+50
| | | | | | Patch by Brad King! llvm-svn: 223525
* Make VFS and FileManager match the current MemoryBuffer API.Benjamin Kramer2014-10-261-8/+2
| | | | | | | This eliminates converting back and forth between the 3 formats and gives us a more homogeneous interface. llvm-svn: 220657
* Adds 'override' to overriding methods. NFC.Fariborz Jahanian2014-10-011-2/+2
| | | | | | These were uncoveredby my yet undelivered patch. llvm-svn: 218774
* Unique_ptrify PPCallbacks ownership.Craig Topper2014-09-101-1/+1
| | | | | | Unique_ptr creation stil needs to be moved earlier at some of the call sites. llvm-svn: 217474
* unique_ptrify SourceManager::createFileIDDavid Blaikie2014-08-291-4/+4
| | | | llvm-svn: 216715
* Overload SourceManager::overrideFileContents so that unconditionally passing ↵David Blaikie2014-08-271-2/+2
| | | | | | | | | | ownership is explicitly done using unique_ptr. Only those callers who are dynamically passing ownership should need the 3 argument form. Those accepting the default ("do pass ownership") should do so explicitly with a unique_ptr now. llvm-svn: 216614
* Update for LLVM api change.Rafael Espindola2014-08-272-15/+15
| | | | llvm-svn: 216585
* Create a std::unique_ptr earlier.Rafael Espindola2014-08-171-3/+3
| | | | | | Thanks to David Blaikie for the suggestion. llvm-svn: 215865
* Convert a few ownership comments with std::unique_ptr.Rafael Espindola2014-08-171-1/+2
| | | | llvm-svn: 215853
* unique_ptr-ify FileSystemStatCache::setNextStatCacheDavid Blaikie2014-08-111-13/+22
| | | | | | | | | | 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
* Update unit test for signature change.Benjamin Kramer2014-07-081-2/+3
| | | | llvm-svn: 212545
* Use non-intrusive refcounting for TargetOptionsAlp Toker2014-07-061-2/+2
| | | | llvm-svn: 212388
* Track IntrusiveRefCntPtr::get() changes from LLVM r212366Alp Toker2014-07-051-36/+36
| | | | llvm-svn: 212369
* Add vfs::recursive_directory_iteratorBen Langmuir2014-06-251-6/+102
| | | | | | | | | For now, this is only used by its unit tests. It is similar to the API in llvm::sys::fs::recursive_directory_iterator, but without some of the more complex features like requesting that the iterator not recurse into the next directory, for example. llvm-svn: 211732
* VirtualFileSystemTest.cpp: Get rid of initializer list on std::vector, to ↵NAKAMURA Takumi2014-06-251-21/+29
| | | | | | appease msc17. llvm-svn: 211662
* Reformat.NAKAMURA Takumi2014-06-251-10/+9
| | | | llvm-svn: 211661
* Fix test issues from r211623 and remove test-only APIBen Langmuir2014-06-241-18/+21
| | | | | | | | | | | 1) missing iterator bits needed by libstdc++4.7 Using find_if was convenient, but since operator++ wasn't a good interface anyway, I just replaced with a range-based for loop and removed operator++ from the directory_iterator class. 2) stop relying on order of iterating real files llvm-svn: 211633
* Disable the bits of r211623 that broke the botsBen Langmuir2014-06-241-15/+16
| | | | | | | Part of my test seems to rely on iterator bits that I didn't implement, at least in the gcc bots. Disabling while I investigate. llvm-svn: 211625
* Add directory_iterator for (non-recursive) iteration of VFS directoriesBen Langmuir2014-06-241-0/+242
| | | | | | | | The API is based on sys::fs::directory_iterator, but it allows iterating over overlays and the yaml-based VFS. For now, it isn't used by anything (except its tests). llvm-svn: 211623
* Update for llvm api change.Rafael Espindola2014-06-131-6/+7
| | | | llvm-svn: 210921
* Refer to error_code with the std prefix.Rafael Espindola2014-06-121-13/+14
| | | | llvm-svn: 210817
* Fix msvc unittest build.Rafael Espindola2014-06-121-1/+1
| | | | | | Looks like msvc has an asymmetrical operator ==. llvm-svn: 210768
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-111-5/+6
| | | | | | This is an update for a llvm api change. llvm-svn: 210688
* [C++11] Use 'nullptr'. Unittests edition.Craig Topper2014-06-083-57/+57
| | | | llvm-svn: 210423
* Remove the last remaining llvm/Config/config.h includesAlp Toker2014-06-042-2/+2
| | | | | | | | | | | | This corrects long-standing misuses of LLVM's internal config.h. In most cases the public llvm-config.h header was intended and we can now remove the old hacks thanks to LLVM r210144. The config.h header is private, won't be installed and should no longer be included by clang or other modules. llvm-svn: 210145
* There is no std::errc:success, remove the llvm one.Rafael Espindola2014-05-311-39/+39
| | | | llvm-svn: 209959
* Use make_error_code in preparation for making errc an enum class.Rafael Espindola2014-05-311-1/+1
| | | | llvm-svn: 209956
* SourceManager: Use setMainFileID() consistentlyAlp Toker2014-05-211-4/+7
| | | | | | | | | | | Eliminate createMainFileID() / createMainFileIDForMemBuffer() utility functions. These didn't add much convenience and conflated two distinct operations. This change makes things easier to follow by providing a consistent interface and getting rid of a bunch of cast-to-voids. llvm-svn: 209266
* Reformat code following Preprocessor constructor updatesAlp Toker2014-05-021-9/+9
| | | | | | Landing this separately to make the previous commits easy to follow at home. llvm-svn: 207826
* Factor TargetInfo pointer/DelayInitialization bool pair out of Preprocessor ctorAlp Toker2014-05-021-9/+9
| | | | | | | | The Preprocessor::Initialize() function already offers a clear interface to achieve this, further reducing the confusing number of states a newly constructed preprocessor can have. llvm-svn: 207825
* Quick fix for layering that broke shared library build.John Thompson2014-04-231-9/+11
| | | | llvm-svn: 207011
* Initial implementation of -modules-earch-all option, for searching for ↵John Thompson2014-04-231-0/+3
| | | | | | symbols in non-imported modules. llvm-svn: 206977
* Check for LLVM_ON_WIN32 instead of _WIN32.Hans Wennborg2014-03-121-4/+5
| | | | | | This is a follow-up to r203624 to address Anton's comment. llvm-svn: 203668
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-2/+3
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* Attempt to re-enable the VFS unittests on WindowsBen Langmuir2014-03-051-72/+72
| | | | | | | Using a //net/ path to hopefully avoid problems with non-absolute paths on Windows. llvm-svn: 203010
* Disable BasicTests/VFS on win32 for now. Investigating.NAKAMURA Takumi2014-03-051-0/+2
| | | | | | | | | | | Failing Tests (5): Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.CaseInsensitive Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.MappedFiles Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.MultiComponentPath Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.TrailingSlashes Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.UseExternalName llvm-svn: 202952
* Reapply fixed "Honour 'use-external-names' in FileManager"Ben Langmuir2014-02-281-3/+6
| | | | | | | | | | | | | | | | 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
* Add a 'use-external-names' option to VFS overlay filesBen Langmuir2014-02-271-2/+52
| | | | | | | | | | | | | | | | When true, sets the name of the file to be the name from 'external-contents'. Otherwise, you get the virtual path that the file was looked up by. This will not affect any non-virtual paths, or fully virtual paths (for which there is no reasonable 'external' name anyway). The setting is available globally, but can be overriden on a per-file basis. The goal is that this setting will control which path you see in debug info, diagnostics, etc. which are sensitive to which path is used. That will come in future patches that pass the name through to FileManager. llvm-svn: 202329
* Allow multi-component paths in VFS file nodesBen Langmuir2014-02-251-0/+61
| | | | | | | | | | | | | | | | This allows the 'name' field to contain a path, like { 'type': 'directory', 'name': '/path/to/dir', 'contents': [ ... ] } which not only simplifies reading and writing these files (for humans), but makes it possible to easily modify locations via textual replacement, which would not have worked in the old scheme. E.g. sed s:<ROOT>:<NEW ROOT> llvm-svn: 202109
* Improve some gtest assertionsBen Langmuir2014-02-241-26/+26
| | | | | | | As requested during review, compare pointers to NULL explicitly to make what's going on more clear. llvm-svn: 202090
* Pass through context for DiagHandler in VFSBen Langmuir2014-02-241-27/+31
| | | | | | | This allows the unit tests to not use global state when checking diagnostics. llvm-svn: 202072
* Add a VFSFromYAML class and a parser to create itBen Langmuir2014-02-211-15/+263
| | | | | | | | | | | | | | | Provides a way to create a virtual file system using a YAML file that supports mapping a file to a path on an 'external' file system. The external file system will typically be the 'real' file system, but for testing it can be changed. A future patch will add a clang option to allow the user to specify such a file and overlay it, but for now this code is only exercised by the unit tests. Differential Revision: http://llvm-reviews.chandlerc.com/D2835 llvm-svn: 201905
* Recommit virtual file systemBen Langmuir2014-02-203-1/+218
| | | | | | | | | | | 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-203-218/+1
| | | | | | | | | | assertion in our internal build bots. This reverts commits 201618, 201635, 201636, 201639, 201685, 201691, and 201696. llvm-svn: 201755
* Fix some test issues in VirtualFileSystemTestBen Langmuir2014-02-191-14/+9
| | | | | | Use camel-case names, remove some dead code, and fix a copy-and-pasted test. llvm-svn: 201691
* Attempt to appease C++11 buildbotsBen Langmuir2014-02-191-20/+38
| | | | | | | | Explicit operator bool doesn't not play nicely with gtest assertion macros (i.e. it performs as advertised and I wish that gtest subverted it for me). llvm-svn: 201639
* Add an OverlayFileSystem classBen Langmuir2014-02-192-0/+204
| | | | | | | Provides a way to merge multiple vfs::FileSystem objects into a single filesystem. llvm-svn: 201635
* Initial implementation of virtual file systemBen Langmuir2014-02-191-1/+1
| | | | | | | | | | | | 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
OpenPOWER on IntegriCloud