summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Basic
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* [CMake] Update target_link_libraries() and LLVM_LINK_COMPONENTS for each ↵NAKAMURA Takumi2013-12-101-0/+4
| | | | | | CMakeLists.txt. llvm-svn: 196916
* Use the same SourceManager for ModuleMaps and compilations.Manuel Klimek2013-10-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows using virtual file mappings on the original SourceManager to map in virtual module.map files. Without this patch, the ModuleMap search will find a module.map file (as the FileEntry exists in the FileManager), but will be unable to get the content from the SourceManager (as ModuleMap previously created its own SourceManager). Two problems needed to be fixed which this patch exposed: 1. Storing the inferred module map When writing out a module, the ASTWriter stores the names of the files in the main source manager; when loading the AST again, the ASTReader errs out if such a file is found missing, unless it is overridden. Previously CompilerInstance's compileModule method would store the inferred module map to a temporary file; the problem with this approach is that now that the module map is handled by the main source manager, the ASTWriter stores the name of the temporary module map as source to the compilation; later, when the module is loaded, the temporary file has already been deleted, which leads to a compilation error. This patch changes the inferred module map to instead inject a virtual file into the source manager. This both saves some disk IO, and works with how the ASTWriter/ASTReader handle overridden source files. 2. Changing test input in test/Modules/Inputs/* Now that the module map file is handled by the main source manager, the VerifyDiagnosticConsumer will not ignore diagnostics created while parsing the module map file. The module test test/Modules/renamed.m uses -I test/Modules/Inputs and triggers recursive loading of all module maps in test/Modules/Inputs, some of which had conflicting names, thus leading errors while parsing the module maps. Those diagnostics already occur on trunk, but before this patch they would not break the test, as they were ignored by the VerifyDiagnosticConsumer. This patch thus changes the module maps that have been recently introduced which broke the invariant of compatible modules maps in test/Modules/Inputs. llvm-svn: 193314
* Use llvm::sys::fs::UniqueID for windows and unix.Rafael Espindola2013-08-011-13/+10
| | | | | | | | | | | | | | | | | | | 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
* Fix handling of "clang c:foo"Rafael Espindola2013-07-291-0/+17
| | | | | | | | | | | | | On windows, c:foo is a valid file path, but stat fails on just "c:". This causes a problem for clang since its file manager wants to cache data about the parent directory. There are refactorings to be done in here, but this gives clang the correct behavior and testing first. Patch by Yunzhong Gao! llvm-svn: 187359
* [Preprocessor] For the MacroExpands preprocessor callback, also pass the ↵Argyrios Kyrtzidis2013-05-031-1/+1
| | | | | | | | MacroArgs object that provides information about the argument tokens for a function macro. llvm-svn: 181065
* <rdar://problem/12368093> Extend module maps with a 'conflict' declaration, ↵Douglas Gregor2013-03-201-1/+2
| | | | | | and warn when a newly-imported module conflicts with an already-imported module. llvm-svn: 177577
* [preprocessor] Use MacroDirective in the preprocessor callbacks to make ↵Argyrios Kyrtzidis2013-02-241-3/+4
| | | | | | | | available the full information about the macro (e.g if it was imported and where). llvm-svn: 175978
* Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.Jordan Rose2013-02-081-0/+122
| | | | | | | Nearly all of these changes are one-to-one replacements; the few that aren't have to do with custom identifier validation. llvm-svn: 174768
* Pull Lexer's CharInfo table out for general use throughout Clang.Jordan Rose2013-02-082-0/+378
| | | | | | | | | | | Rewriting the same predicates over and over again is bad for code size and code maintainence. Using the functions in <ctype.h> is generally unsafe unless they are specified to be locale-independent (i.e. only isdigit and isxdigit). The next commit will try to clean up uses of <ctype.h> functions within Clang. llvm-svn: 174765
* For ModuleLoader::makeModuleVisible() also pass the source location where theArgyrios Kyrtzidis2013-02-011-1/+2
| | | | | | module import occurred. llvm-svn: 174191
* clang/unittests: Fixup corresponding to r172290.NAKAMURA Takumi2013-01-121-0/+3
| | | | llvm-svn: 172295
* Extend stat query APIs to explicitly specify if the query is forArgyrios Kyrtzidis2012-12-111-1/+1
| | | | | | | | | | 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 the #include lines for unittests/...Chandler Carruth2012-12-042-6/+4
| | | | | | I've tried to place sensible headers at the top as main-module headers. llvm-svn: 169243
* Fix unit tests for ModuleLoader change in r168961.Douglas Gregor2012-11-301-4/+5
| | | | llvm-svn: 168962
* clang/unittests: Fixup corresponding to Doug's r168136.NAKAMURA Takumi2012-11-161-1/+1
| | | | llvm-svn: 168137
* Teach the preprocessor to hold onto the preprocessor options.Douglas Gregor2012-10-241-6/+4
| | | | llvm-svn: 166599
* Update unit tests for HeaderSearch changeDouglas Gregor2012-10-241-3/+7
| | | | llvm-svn: 166584
* More unit-test fixesDouglas Gregor2012-10-231-0/+1
| | | | llvm-svn: 166511
* Fixup unit tests for DiagnosticOptions changeDouglas Gregor2012-10-231-1/+1
| | | | llvm-svn: 166509
* Fix the handling of target options in our unit tests.Douglas Gregor2012-10-171-4/+5
| | | | llvm-svn: 166079
* Clang side of a refactoring of the CMake unit test build strategy.Chandler Carruth2012-06-211-0/+9
| | | | | | | | | | | | | | | | The fundamental change is to put a CMakeLists.txt file in the unittest directory, with a single test binary produced from it. This has several advantages. Among other fundamental advantages, we start to get the checking logic for when a file is missing from the CMake build, and this caught one missing file already! More fun details in the LLVM commit corresponding to this one. Note that the LLVM commit and this one most both be applied, or neither. Sorry for any skew issues. llvm-svn: 158910
* Fix the location of the fixit for -Wnewline-eof.Jordan Rose2012-06-191-0/+48
| | | | | | | It turns out SourceManager treating the "one-past-the-end" location as invalid, but then failing to set the invalid flag properly. llvm-svn: 158699
* [preprocessor] Handle correctly inclusion directives that have macro ↵Argyrios Kyrtzidis2012-03-271-0/+115
| | | | | | | | | | | | | | | | | | expansions, e.g "#include MACRO(STUFF)". -As an inclusion position for the included file, use the file location of the file where it was included but *after* the macro expansions. We want the macro expansions to be considered as before-in-translation-unit for everything in the included file. -In the preprocessing record take into account that only inclusion directives can be encountered as "out-of-order" (by comparing the start of the range which for inclusions is the hash location) and use binary search if there is an extreme number of macro expansions in the include directive. Fixes rdar://11111779 llvm-svn: 153527
OpenPOWER on IntegriCloud