summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
...
* Eat the UTF-8 BOM at the beginning of a file since it's ignored anyhow.Eric Christopher2011-04-091-1/+14
| | | | | | | | Nom Nom Nom. Patch by Anton Korobeynikov! llvm-svn: 129174
* Fix getLocForEndOfToken to not double-count spurious internal characters John McCall2011-04-061-1/+1
| | | | | | | within a token, like trigraphs and escaped newlines. Patch by Marcin Kowalczyk! llvm-svn: 128978
* Add a __has_feature check for the 'availability' attributeDouglas Gregor2011-03-261-0/+1
| | | | llvm-svn: 128337
* we can now claim to fully support the override control feature in C++0x.Anders Carlsson2011-03-251-0/+1
| | | | llvm-svn: 128281
* Lexer: Add extremely limited support for -traditional-cpp, ignoring BCPLDaniel Dunbar2011-03-181-3/+5
| | | | | | comments. llvm-svn: 127910
* Having FileManager::getFile always open the file, brought much consternation ↵Argyrios Kyrtzidis2011-03-161-7/+8
| | | | | | | | | | | and leaking of file descriptors. Add 'openFile' bool to FileManager::getFile to specify whether we want to have the file opened or not, have it false by default, and enable it only in HeaderSearch.cpp where the open+fstat optimization matters. Fixes rdar://9139899. llvm-svn: 127748
* Add a 'RawPath' parameter to the PPCallbacks interface. This allowsChandler Carruth2011-03-166-36/+68
| | | | | | | | | | | | | | | clients to observe the exact path through which an #included file was located. This is very useful when trying to record and replay inclusion operations without it beind influenced by the aggressive caching done inside the FileManager to avoid redundant system calls and filesystem operations. The work to compute and return this is only done in the presence of callbacks, so it should have no effect on normal compilation. Patch by Manuel Klimek. llvm-svn: 127742
* Create __has_feature(cxx_noexcept) and mark it as working.Sebastian Redl2011-03-151-0/+1
| | | | | | | Find out that our C++0x status has only one field for noexcept expression and specification together, and that it was accidentally already marked as fully implemented. This completes noexcept specification work. llvm-svn: 127701
* Fix my earlier commit to work with escaped newlines and leave breadcrumbsJohn McCall2011-03-082-11/+48
| | | | | | | in case we want to make a world where we can check intermediate instantiations for this kind of breadcrumb. llvm-svn: 127221
* Add an API call to retrieve the spelling data of a token from its ↵John McCall2011-03-081-0/+10
| | | | | | SourceLocation. llvm-svn: 127216
* Provide an attribute, objc_method_family, to allow the inferred familyJohn McCall2011-03-021-0/+1
| | | | | | | | | | of an Objective-C method to be overridden on a case-by-case basis. This is a higher-level tool than ns_returns_retained &c.; it lets users specify that not only does a method have different retain/release semantics, but that it semantically acts differently than one might assume from its name. This in turn is quite useful to static analysis. llvm-svn: 126839
* Rename tok::eom to tok::eod.Peter Collingbourne2011-02-289-91/+91
| | | | | | | | 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
* Reimplement __pragma support using a TokenLexerPeter Collingbourne2011-02-222-36/+30
| | | | llvm-svn: 126221
* Make TokenLexer capable of storing preprocessor directive tokensPeter Collingbourne2011-02-223-4/+12
| | | | llvm-svn: 126220
* Turn on __has_feature(cxx_auto_type). The feature is now fully implemented.Richard Smith2011-02-201-1/+1
| | | | llvm-svn: 126078
* Warn for missing terminating " or ' instead of error for gcc compatibility. ↵Argyrios Kyrtzidis2011-02-151-2/+2
| | | | | | Fixed rdar://8914293. llvm-svn: 125616
* Move support for "#pragma STDC FP_CONTRACT" to Parser; add Sema actionsPeter Collingbourne2011-02-141-15/+0
| | | | llvm-svn: 125474
* Make LexOnOffSwitch a Preprocessor member functionPeter Collingbourne2011-02-141-35/+35
| | | | llvm-svn: 125473
* Add CMake dependencies so that LLVM_USED_LIBS order doesn't matter.Jeffrey Yasskin2011-02-111-0/+2
| | | | | | | I also sorted the tools/driver dependencies since their order no longer matters. llvm-svn: 125417
* Implement two related optimizations that make de-serialization ofDouglas Gregor2011-02-101-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AST/PCH files more lazy: - Don't preload all of the file source-location entries when reading the AST file. Instead, load them lazily, when needed. - Only look up header-search information (whether a header was already #import'd, how many times it's been included, etc.) when it's needed by the preprocessor, rather than pre-populating it. Previously, we would pre-load all of the file source-location entries, which also populated the header-search information structure. This was a relatively minor performance issue, since we would end up stat()'ing all of the headers stored within a AST/PCH file when the AST/PCH file was loaded. In the normal PCH use case, the stat()s were cached, so the cost--of preloading ~860 source-location entries in the Cocoa.h case---was relatively low. However, the recent optimization that replaced stat+open with open+fstat turned this into a major problem, since the preloading of source-location entries would now end up opening those files. Worse, those files wouldn't be closed until the file manager was destroyed, so just opening a Cocoa.h PCH file would hold on to ~860 file descriptors, and it was easy to blow through the process's limit on the number of open file descriptors. By eliminating the preloading of these files, we neither open nor stat the headers stored in the PCH/AST file until they're actually needed for something. Concretely, we went from *** HeaderSearch Stats: 835 files tracked. 364 #import/#pragma once files. 823 included exactly once. 6 max times a file is included. 3 #include/#include_next/#import. 0 #includes skipped due to the multi-include optimization. 1 framework lookups. 0 subframework lookups. *** Source Manager Stats: 835 files mapped, 3 mem buffers mapped. 37460 SLocEntry's allocated, 11215575B of Sloc address space used. 62 bytes of files mapped, 0 files with line #'s computed. with a trivial program that uses a chained PCH including a Cocoa PCH to *** HeaderSearch Stats: 4 files tracked. 1 #import/#pragma once files. 3 included exactly once. 2 max times a file is included. 3 #include/#include_next/#import. 0 #includes skipped due to the multi-include optimization. 1 framework lookups. 0 subframework lookups. *** Source Manager Stats: 3 files mapped, 3 mem buffers mapped. 37460 SLocEntry's allocated, 11215575B of Sloc address space used. 62 bytes of files mapped, 0 files with line #'s computed. for the same program. llvm-svn: 125286
* CMake: LLVM_NO_RTTI must be obsolete now!NAKAMURA Takumi2011-02-101-2/+0
| | | | llvm-svn: 125275
* Lexer: add CUDA kernel call tokensPeter Collingbourne2011-02-091-0/+8
| | | | llvm-svn: 125218
* Add a __has_feature check for default template arguments in functionDouglas Gregor2011-02-051-0/+1
| | | | | | templates, a C++0x feature. llvm-svn: 124973
* Add __has_feature() for each of the type traitsDouglas Gregor2011-02-031-0/+19
| | | | llvm-svn: 124820
* Harden Lexer::GetBeginningOfToken() against bogus source locations andDouglas Gregor2011-01-311-0/+6
| | | | | | the disappearance/alteration of files. llvm-svn: 124616
* Wire up attributes 'ns_consumed' and 'cf_consumed' in the static analyzer's ↵Ted Kremenek2011-01-271-0/+2
| | | | | | ObjC retain/release checker. llvm-svn: 124386
* Hook up attribute ns_consumes_self in the ObjC retain/release checker in the ↵Ted Kremenek2011-01-271-0/+1
| | | | | | static analyzer. llvm-svn: 124360
* Add __has_feature(cxx_reference_qualified_functions); update tests andDouglas Gregor2011-01-261-0/+1
| | | | | | documentation. llvm-svn: 124322
* Clean up the C++0x __has_feature tests. Specifically:Douglas Gregor2011-01-261-10/+11
| | | | | | | | | | | | | - Don't publicize a C++0x feature through __has_feature if we aren't in C++0x mode (even if the feature is available only with a warning). - "auto" is not implemented well enough for its __has_feature to be turned on. - Fix the test of C++0x __has_feature to actually test what we're trying to test. Searching for the substring "foo" when our options are "foo" and "no_foo" doesn't work :) llvm-svn: 124291
* Downgrade the error about rvalue references to an extension warningDouglas Gregor2011-01-251-2/+2
| | | | | | | | and turn on __has_feature(cxx_rvalue_references). The core rvalue references proposal seems to be fully implemented now, pending lots more testing. llvm-svn: 124169
* Eradicate any mention of C++0x concepts.Douglas Gregor2011-01-191-1/+0
| | | | llvm-svn: 123860
* Variadic templates are fully implemented.Douglas Gregor2011-01-191-1/+1
| | | | | | | | Turn on the __has_feature switch for variadic templates, document their completion, and put the ExtWarn into the c++0x-extensions warning group. llvm-svn: 123854
* When redefining a macro don't warn twice if it's not used and don't warn for ↵Argyrios Kyrtzidis2011-01-181-1/+3
| | | | | | | | duplicate definition by command line options. Fixes rdar://8875916. llvm-svn: 123767
* clean up some dead code around __has_include() processing code identified by ↵Chris Lattner2011-01-151-13/+12
| | | | | | | | the ted-o-matic. rdar://8867482 llvm-svn: 123522
* Microsoft integer suffix changes:Francois Pichet2011-01-111-7/+18
| | | | | | | | | i64 is like LL i32 is like L Also set isMicrosoftInteger to true only if the suffix is well formed. llvm-svn: 123230
* Replace all uses of PathV1::exists with PathV2::fs::exists.Michael J. Spencer2011-01-101-2/+3
| | | | llvm-svn: 123150
* fix rdar://8823139, a crash on a comment in a preprocessed .s fileChris Lattner2011-01-061-0/+6
| | | | | | that contains the ## operator. llvm-svn: 122946
* Fix PR8654, ensuring each branch of an #if, #elif, #else, ... chainChandler Carruth2011-01-031-1/+12
| | | | | | | | receives a PPCallback. Patch by Richard Smith. llvm-svn: 122755
* Change all self assignments X=X to (void)X, so that we can turn on aJeffrey Yasskin2010-12-231-2/+2
| | | | | | | | | new gcc warning that complains on self-assignments and self-initializations. Fix one bug found by the warning, in which one clang::OverloadCandidate constructor failed to initialize its FunctionTemplate member. llvm-svn: 122459
* Introduced raw_identifier token kind.Abramo Bagnara2010-12-226-52/+65
| | | | llvm-svn: 122394
* Add missing standard includes. Patch by Joerg Sonnenberger!Nick Lewycky2010-12-191-0/+1
| | | | llvm-svn: 122194
* Replace all uses of PathV1::isAbsolute with PathV2::is_{absolute,relative}.Michael J. Spencer2010-12-171-1/+1
| | | | llvm-svn: 122087
* MemoryBuffer API update.Michael J. Spencer2010-12-161-4/+2
| | | | llvm-svn: 121956
* Fix diagnostic pragmas.Argyrios Kyrtzidis2010-12-156-22/+40
| | | | | | | | | | | | Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state. Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect a lot of places, like C++ inline methods, template instantiations, the lexer, etc. Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location. Fixes rdar://8365684. llvm-svn: 121873
* Don't crash when code-completing after "#include <". It would be farDouglas Gregor2010-12-091-0/+6
| | | | | | | better to actually produce a decent set of completions by checking the system include paths, but not today. Fixes PR8744. llvm-svn: 121431
* Use error_code instead of std::string* for MemoryBuffer.Michael J. Spencer2010-12-091-1/+5
| | | | llvm-svn: 121378
* Fix diagnostic for reporting bad escape sequence.Ted Kremenek2010-12-031-1/+1
| | | | | | Patch by Paul Curtis! llvm-svn: 120759
* Merge System into Support.Michael J. Spencer2010-11-292-2/+2
| | | | llvm-svn: 120297
* 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
OpenPOWER on IntegriCloud