summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PreprocessorLexer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Factor out repeated code parsing and concatenating header-names fromRichard Smith2019-03-191-7/+1
| | | | | | | | | | | tokens. We now actually form an angled_string_literal token for a header name by concatenation rather than just working out what its contents would be. This substantially simplifies downstream processing and is necessary for C++20 header unit imports. llvm-svn: 356433
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-1/+1
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 llvm-svn: 331834
* [Lex] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-12-041-5/+6
| | | | | | minor fixes (NFC). llvm-svn: 319714
* Make Preprocessor::Lex non-recursive.Eli Friedman2013-09-191-1/+4
| | | | | | | | | | | | | | | Before this patch, Lex() would recurse whenever the current lexer changed (e.g. upon entry into a macro). This patch turns the recursion into a loop: the various lex routines now don't return a token when the current lexer changes, and at the top level Preprocessor::Lex() now loops until it finds a token. Normally, the recursion wouldn't end up being very deep, but the recursion depth can explode in edge cases like a bunch of consecutive macros which expand to nothing (like in the testcase test/Preprocessor/macro_expand_empty.c in this patch). <rdar://problem/14569770> llvm-svn: 190980
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-2/+2
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Revert r167801, "[preprocessor] When #including something that contributes noDaniel Dunbar2012-11-131-1/+1
| | | | | | tokens at all,". This change broke External/Nurbs in LLVM test-suite. llvm-svn: 167858
* [preprocessor] When #including something that contributes no tokens at all,Argyrios Kyrtzidis2012-11-131-1/+1
| | | | | | | | | don't recursively continue lexing. This avoids a stack overflow with a sequence of many empty #includes. rdar://11988695 llvm-svn: 167801
* Documentation cleanup: Use \brief for summaries, and escape # characters.James Dennett2012-06-171-1/+1
| | | | llvm-svn: 158619
* Unweaken vtables as per ↵David Blaikie2011-12-201-0/+2
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146959
* Boost the efficiency of SourceManager::getMacroArgExpandedLocation.Argyrios Kyrtzidis2011-08-211-0/+8
| | | | | | | | | | | | | | | | | | Currently getMacroArgExpandedLocation is very inefficient and for the case of a location pointing at the main file it will end up checking almost all of the SLocEntries. Make it faster: -Use a map of macro argument chunks to their expanded source location. The map is for a single source file, it's stored in the file's ContentCache and lazily computed, like the source lines cache. -In SLocEntry's FileInfo add an 'unsigned NumCreatedFIDs' field that keeps track of the number of FileIDs (files and macros) that were created during preprocessing of that particular file SLocEntry. This is useful when computing the macro argument map in skipping included files while scanning for macro arg FileIDs that lexed from a specific source file. Due to padding, the new field does not increase the size of SLocEntry. llvm-svn: 138225
* Rename tok::eom to tok::eod.Peter Collingbourne2011-02-281-1/+1
| | | | | | | | 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
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-2/+2
| | | | llvm-svn: 81346
* move library-specific diagnostic headers into library private dirs. ReduceChris Lattner2009-01-291-1/+1
| | | | | | redundant #includes. Patch by Anders Johnsen! llvm-svn: 63271
* Split the single monolithic DiagnosticKinds.def file into oneChris Lattner2009-01-271-1/+1
| | | | | | | | | .def file for each library. This means that adding a diagnostic to sema doesn't require all the other libraries to be rebuilt. Patch by Anders Johnsen! llvm-svn: 63111
* this massive patch introduces a simple new abstraction: it makesChris Lattner2009-01-171-8/+6
| | | | | | | | | | | | | | | "FileID" a concept that is now enforced by the compiler's type checker instead of yet-another-random-unsigned floating around. This is an important distinction from the "FileID" currently tracked by SourceLocation. *That* FileID may refer to the start of a file or to a chunk within it. The new FileID *only* refers to the file (and its #include stack and eventually #line data), it cannot refer to a chunk. FileID is a completely opaque datatype to all clients, only SourceManager is allowed to poke and prod it. llvm-svn: 62407
* Change some terminology in SourceLocation: instead of referring to Chris Lattner2009-01-161-1/+1
| | | | | | | the "physical" location of tokens, refer to the "spelling" location. This is more concrete and useful, tokens aren't really physical objects! llvm-svn: 62309
* remove a sneaky version of Diag hiding in PreprocessorLexer.Chris Lattner2008-11-221-7/+1
| | | | llvm-svn: 59858
* Change the Lexer::Diag method to not magically silence warnings,Chris Lattner2008-11-221-2/+0
| | | | | | | force the caller to check instead. This eliminates the need (and the risk!) of weird null DiagnosticBuilder's floating around. llvm-svn: 59856
* - Default initialize ParsingPreprocessorDirective, ParsingFilename, andTed Kremenek2008-11-201-1/+4
| | | | | | | | LexingRawMode in the ctor of PreprocessorLexer. - PTHLexer: Use "LastToken" instead of "NumToken" llvm-svn: 59690
* - Move static function IsNonPragmaNonMacroLexer into Preprocessor.h.Ted Kremenek2008-11-191-0/+3
| | | | | | | | | | | | | - Add variants of IsNonPragmaNonMacroLexer to accept an IncludeMacroStack entry (simplifies some uses). - Use IsNonPragmaNonMacroLexer in Preprocessor::LookupFile. - Add 'FileID' to PreprocessorLexer, and have Preprocessor query this fileid when looking up the FileEntry for a file Performance testing of -Eonly on Cocoa.h shows no performance regression because of this patch. llvm-svn: 59666
* Remove the last of the old-style Preprocessor::Diag methods.Chris Lattner2008-11-181-1/+1
| | | | llvm-svn: 59554
* Move some diagnostic handling to PreprocessorLexer.Ted Kremenek2008-11-121-0/+7
| | | | llvm-svn: 59191
* Add virtual dtor to PreprocessorLexer.Ted Kremenek2008-11-121-0/+2
| | | | llvm-svn: 59188
* Move LexIncludeFilename from Lexer to PreprocessorLexer.Ted Kremenek2008-11-121-0/+40
PreprocessorLexer now has a virtual method "IndirectLex" which allows it to call the lex method of its subclasses. This is not for performance intensive operations. llvm-svn: 59185
OpenPOWER on IntegriCloud