summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
* 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
* rework the stat cache, pulling it out of FileManager.h intoChris Lattner2010-11-231-13/+14
| | | | | | | its own header and giving it some more structure. No functionality change. llvm-svn: 120030
* don't allow remapping PTH file paths with -fworking-directory, theChris Lattner2010-11-231-3/+2
| | | | | | client should just pass in absolute paths. llvm-svn: 120012
* now the FileManager has a FileSystemOpts ivar, stop threadingChris Lattner2010-11-234-28/+18
| | | | | | | | | FileSystemOpts through a ton of apis, simplifying a lot of code. This also fixes a latent bug in ASTUnit where it would invoke methods on FileManager without creating one in some code paths in cindextext. llvm-svn: 120010
* tidy upChris Lattner2010-11-231-4/+4
| | | | llvm-svn: 119996
* remove old compatibility APIs, use StringRef versions instead.Chris Lattner2010-11-212-14/+8
| | | | llvm-svn: 119935
* Revert r119838 "Don't warn for empty 'if' body if there is a macro that ↵Argyrios Kyrtzidis2010-11-201-1/+1
| | | | | | | | | | expands to nothing" and use a better and more general approach, where NullStmt has a flag to indicate whether it was preceded by an empty macro. Thanks to Abramo Bagnara for the hint! llvm-svn: 119887
* Several PPCallbacks take an SourceLocation + IdentifierInfo, ratherCraig Silverstein2010-11-192-9/+9
| | | | | | | | | | | than a Token that holds the same information all in one easy-to-use package. There's no technical reason to prefer the former -- the information comes from a Token originally -- and it's clumsier to use, so I've changed the code to use tokens everywhere. Approved by clattner llvm-svn: 119845
* Don't warn for empty 'if' body if there is a macro that expands to nothing, e.g:Argyrios Kyrtzidis2010-11-191-0/+1
| | | | | | | | | if (condition) CALL(0); // empty macro but don't warn for empty body. Fixes rdar://8436021. llvm-svn: 119838
* move getSpelling from Preprocessor to Lexer, which it is more conceptually ↵Chris Lattner2010-11-173-114/+105
| | | | | | related to. llvm-svn: 119479
* propagate preprocessor out of StringLiteralParser. It is nowChris Lattner2010-11-171-10/+18
| | | | | | possible to create one without a preprocessor. llvm-svn: 119476
* push the preprocessor out of EncodeUCNEscapeChris Lattner2010-11-171-21/+14
| | | | llvm-svn: 119475
* move AdvanceToTokenCharacter and getLocForEndOfToken fromChris Lattner2010-11-173-65/+82
| | | | | | Preprocessor to Lexer where they make more sense. llvm-svn: 119474
* add a static version of PP::AdvanceToTokenCharacter.Chris Lattner2010-11-172-15/+21
| | | | llvm-svn: 119472
* push use of Preprocessor out farther.Chris Lattner2010-11-171-22/+18
| | | | llvm-svn: 119471
* push use of Preprocessor out of getOffsetOfStringByte Chris Lattner2010-11-171-6/+5
| | | | llvm-svn: 119470
* add a static form of the efficient PP::getSpelling method.Chris Lattner2010-11-172-3/+8
| | | | llvm-svn: 119469
OpenPOWER on IntegriCloud