summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
...
* Do not print inferred submodules explicitly in __inferred_module.mapBen Langmuir2014-04-231-0/+2
| | | | | | | | | | | | | | Otherwise including a header in your source file that is not included by framework's umbrella header will silently add an empty submodule with that name. is automatically translated to @import Foo.NotInModule; which then would have succeeded because the inferred module map contained an empty submodule called NotInModule. llvm-svn: 207024
* Add some missing checks for C++1y digit separators that don't in fact separateRichard Smith2014-04-221-0/+6
| | | | | | | | digits. Turns out we have completely separate lexing codepaths for floating point numbers depending on whether or not they start with a zero. Who knew... =) llvm-svn: 206932
* Allow submodule inferrences with a missing umbrella when the module is ↵Ben Langmuir2014-04-211-1/+2
| | | | | | | | | unavailable If the module is unavailable because of a missing header, don't diagnose a "module * {}" declaration for having a missing umbrella. llvm-svn: 206776
* Don't build modules with (submodules with) missing headersBen Langmuir2014-04-181-2/+10
| | | | | | | | Unless they are in submodules that aren't available anyway, due to requirements not being met. Also, mark children as unavailable when the parent is. llvm-svn: 206664
* 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
* Add more constness to module-related APIsDmitri Gribenko2014-04-181-2/+3
| | | | llvm-svn: 206595
* Lex: Fix __has_feature(cxx_exceptions) for objective C++Justin Bogner2014-04-161-1/+1
| | | | | | | | | | | | | | | At one point, -fexceptions was a synonym for -fcxx-exceptions. While the driver options still enables cxx-exceptions by default, the cc1 flag is purely about exception tables and this doesn't account for objective C exceptions. Because of this, checking for the cxx_exceptions feature in objective C++ often gives the wrong answer. The cxx_exceptions feature should be based on the -fcxx-exceptions cc1 flag, not -fexceptions. Furthermore, at some point the tests were changed to use cc1 even though they were testing the driver behaviour. We're better off testing both the driver and cc1 here. llvm-svn: 206352
* Fixed problem with exclude header. The exclude header argument needs to be ↵John Thompson2014-04-161-22/+0
| | | | | | relative to the module.map file. llvm-svn: 206342
* Allow multiple modules with the same name to coexist in the module cacheBen Langmuir2014-04-142-27/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To differentiate between two modules with the same name, we will consider the path the module map file that they are defined by* part of the ‘key’ for looking up the precompiled module (pcm file). Specifically, this patch renames the precompiled module (pcm) files from cache-path/<module hash>/Foo.pcm to cache-path/<module hash>/Foo-<hash of module map path>.pcm In addition, I’ve taught the ASTReader to re-resolve the names of imported modules during module loading so that if the header search context changes between when a module was originally built and when it is loaded we can rebuild it if necessary. For example, if module A imports module B first time: clang -I /path/to/A -I /path/to/B ... second time: clang -I /path/to/A -I /different/path/to/B ... will now rebuild A as expected. * in the case of inferred modules, we use the module map file that allowed the inference, not the __inferred_module.map file, since the inferred file path is the same for every inferred module. llvm-svn: 206201
* Add a test to distinguish between reserved tokens and normal identifiers.Yunzhong Gao2014-04-111-0/+4
| | | | | | | | | | | | The -fms-extensions option affects a number of subtle front-end C/C++ behaviors, and it would be useful to be able to distinguish MS keywords from regular identifiers in the ms-extensions mode even if the triple does not define a Windows target. It should make life easier if anyone needs to port their Windows codes to elsewhere. Differential Revision: http://reviews.llvm.org/D3034 llvm-svn: 206069
* Add -fmodules-strict-decluse to check that all headers are in modulesDaniel Jasper2014-04-111-1/+5
| | | | | Review: http://reviews.llvm.org/D3335 llvm-svn: 206027
* Move search for header in umbrella directories into its own functionBen Langmuir2014-04-101-75/+83
| | | | | | No functional change intended. llvm-svn: 205942
* [Preprocessor/CodeComplete] Don't add include guard macros to ↵Argyrios Kyrtzidis2014-04-092-1/+6
| | | | | | code-completion results. llvm-svn: 205917
* If a header is explicitly included in module A, and excluded from an umbrellaRichard Smith2014-04-081-6/+17
| | | | | | directory in module B, don't include it in module B! llvm-svn: 205762
* Revert r205436:Roman Divacky2014-04-031-28/+5
| | | | | | | | | | | | | | | | Extend the SSE2 comment lexing to AVX2. Only 16byte align when not on AVX2. This provides some 3% speedup when preprocessing gcc.c as a single file. The patch is wrong, it always uses SSE2, and when I fix that there's no speedup at all. I am not sure where the 3% came from previously. --Thi lie, and those below, will be ignored-- M Lex/Lexer.cpp llvm-svn: 205548
* Extend the SSE2 comment lexing to AVX2. Only 16byte align when not on AVX2.Roman Divacky2014-04-021-5/+28
| | | | | | This provides some 3% speedup when preprocessing gcc.c as a single file. llvm-svn: 205436
* Post-commit review coding style change: renaming HasAttribute to ↵Aaron Ballman2014-03-311-1/+1
| | | | | | hasAttribute. No functional changes. llvm-svn: 205201
* Reapplying r204952 a second time.Aaron Ballman2014-03-311-15/+3
| | | | | | | | | | Clean up the __has_attribute implementation without modifying its behavior. Replaces the tablegen-driven AttrSpellings.inc, which lived in the lexing layer with AttrHasAttributeImpl.inc, which lives in the basic layer. Updates the preprocessor to call through to this new functionality which can take additional information into account (such as scopes and syntaxes). Expose the ability for parts of the compiler to ask whether an attribute is supported for a given spelling (including scope), syntax, triple and language options. llvm-svn: 205181
* [HeaderSearch] Make sure we clear the mapped name from the ↵Argyrios Kyrtzidis2014-03-291-1/+1
| | | | | | | | LookupFileCacheInfo when we reset the start point. rdar://16462455 llvm-svn: 205071
* 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
* Reverting r204968 and r204969; while more build bots are happy with the ↵Aaron Ballman2014-03-271-3/+15
| | | | | | results, some still have link errors. llvm-svn: 204974
* Reapplying r204952 with fixes which should hopefully resolve linking issues ↵Aaron Ballman2014-03-271-15/+3
| | | | | | with non-MSVC compilers. llvm-svn: 204968
* Reverting r204952, while I figure out what's going on with the makefile build.Aaron Ballman2014-03-271-3/+15
| | | | llvm-svn: 204955
* Clean up the __has_attribute implementation without modifying its behavior. Aaron Ballman2014-03-271-15/+3
| | | | | | | | Replaces the tablegen-driven AttrSpellings.inc, which lived in the lexing layer with AttrHasAttributeImpl.inc, which lives in the basic layer. Updates the preprocessor to call through to this new functionality which can take additional information into account (such as scopes and syntaxes). Expose the ability for parts of the compiler to ask whether an attribute is supported for a given spelling (including scope), syntax, triple and language options. llvm-svn: 204952
* Prevent lookup of subframework modules by name without parent frameworkBen Langmuir2014-03-201-24/+3
| | | | | | | | | | | | | We were 'allowing' the following import @import Sub; where Sub is a subframework of Foo and we had a -F path inside Foo.framework/Frameworks and no module map file for Sub. This would later hit assertion failures in debug builds. Now we should correctly diagnose this as a module not found error. llvm-svn: 204368
* Silencing an MSVC warning about not all control paths returning a value. No ↵Aaron Ballman2014-03-201-0/+1
| | | | | | functional change intended. llvm-svn: 204345
* Add a new spelling for module map files 'module.modulemap'Ben Langmuir2014-03-192-67/+106
| | | | | | | | | | | | | | | This name, while more verbose, plays more nicely with tools that use file extensions to determine file types. The existing spelling 'module.map' will continue to work, but the new spelling will take precedence. In frameworks, this new filename will only go in a new 'Modules' sub-directory. Similarly, add a module.private.modulemap corresponding to module_private.map. llvm-svn: 204261
* Use the expansion location of the file name when finding the module.Manuel Klimek2014-03-191-1/+1
| | | | | | | | The spelling location of stringified strings is not a file location. Optimally, we'll want to solve the problem (as the FIXME states) by handing in the right FileEntry of the #include location. llvm-svn: 204220
* Added a __has_feature() for 'is_constructible'Marshall Clow2014-03-181-0/+1
| | | | llvm-svn: 204153
* Preprocessor: Clarify the ownership of the IncludeMacroStack with unique_ptr.Benjamin Kramer2014-03-151-5/+1
| | | | llvm-svn: 204007
* Implement the MS extension __identifier properly: take a token and strip it ofRichard Smith2014-03-151-6/+47
| | | | | | its keywordliness. llvm-svn: 203987
* Add two missing entries to the C++11 support page. Bump one relevant diagnosticRichard Smith2014-03-141-2/+3
| | | | | | | | (for an integer too large for any signed type) from Warning to ExtWarn -- it's ill-formed in C++11 and C99 onwards, and UB during translation in C89 and C++98. Add diagnostic groups for two relevant diagnostics. llvm-svn: 203974
* Don't verify module inclusions in assembler files.Daniel Jasper2014-03-141-1/+1
| | | | llvm-svn: 203929
* Prevent outputting HeaderFileInfos for files not used as headersBen Langmuir2014-03-131-0/+12
| | | | | | | | | | | When building an AST file, we don't want to output HeaderFileInfo structures for files that are not actually used as headers in the current context. This can lead to assuming that unrelated files have include counts of 0, defeating multiple-include prevention. This is accomplished by adding an IsValid bit to the HFI. llvm-svn: 203813
* Only allow streaming exactly type 'bool' to a DiagnosticBuilder, not anythingRichard Smith2014-03-121-1/+2
| | | | | | | that implicitly converts to 'bool' (such as pointers, and the first operand of ?:). Clean up issues found by this. Patch by Stephan Tolksdorf! llvm-svn: 203735
* Lex: reduce buffer size, add a testSaleem Abdulrasool2014-03-121-1/+1
| | | | | | | Reduce the stack usage as hopefully include paths are usually not too long. Add a test case for the path normalisation behaviour. llvm-svn: 203632
* lex: improve include handling on Linux for WindowsSaleem Abdulrasool2014-03-111-10/+22
| | | | | | | | | | Normalise the path separator character on non-windows platforms. Although this would work on Windows as well (most newer versions of Windows support either '/' or '\' as a path separator character), it could potentially cause problems with full UNC paths. This change enables the use of the Windows SDK on Linux which will not accept '\' as a path separator. llvm-svn: 203614
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-112-35/+35
| | | | | | class. llvm-svn: 203547
* [HeaderSearch] Fix issue where if a headermap entry maps the filename to a ↵Argyrios Kyrtzidis2014-03-111-10/+28
| | | | | | | | | | framework import (non-absolute path) then we fail to find it if it is re-included later on. rdar://16285490 llvm-svn: 203542
* [C++11] Replace OwningPtr include with <memory>.Ahmed Charles2014-03-092-2/+2
| | | | llvm-svn: 203389
* Remove uses of SmallString::equals in favor of SmallVectorImpl<char>'s ↵David Blaikie2014-03-091-1/+1
| | | | | | operator== llvm-svn: 203373
* [Preprocessor] Only check for -Wunused-macros if the translation unit kind ↵Argyrios Kyrtzidis2014-03-081-1/+1
| | | | | | is TU_Complete. llvm-svn: 203360
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-072-5/+5
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* Change OwningPtr::take() to OwningPtr::release().Ahmed Charles2014-03-073-6/+6
| | | | | | This is a precursor to moving to std::unique_ptr. llvm-svn: 203275
OpenPOWER on IntegriCloud