summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* refactor the interface to StringLiteralParser::getOffsetOfStringByte,Chris Lattner2010-11-171-32/+39
| | | | | | pushing the dependency on the preprocessor out a bit. llvm-svn: 119468
* Make sure to always check the result ofDouglas Gregor2010-11-123-8/+20
| | | | | | | SourceManager::getPresumedLoc(), so that we don't try to make use of an invalid presumed location. Doing so can cause crashes. llvm-svn: 118885
* lib/Lex/PPMacroExpansion.cpp: Fixup to appease MSVC.NAKAMURA Takumi2010-11-091-0/+4
| | | | | | Confirmed on MSVS10. llvm-svn: 118496
* Appeasing MSVC, take 3Douglas Gregor2010-11-091-0/+1
| | | | llvm-svn: 118493
* Try to appease MSVCDouglas Gregor2010-11-091-0/+5
| | | | llvm-svn: 118487
* sprintf -> snprintf conversion, from Vladimir KirillovDouglas Gregor2010-11-091-3/+3
| | | | llvm-svn: 118478
* Document Clang's support for attributes on individual enumerators andJohn McCall2010-11-081-0/+3
| | | | | | | tweak the documentation for deprecation-with-message. Provide __has_feature tests for both. rdar://problem/8605692 llvm-svn: 118435
* Add PPCallbacks for #if/#ifdef/etc.Craig Silverstein2010-11-061-14/+37
| | | | | | | | | | | The callback info for #if/#elif is not great -- ideally it would give us a list of tokens in the #if, or even better, a little parse tree. But that's a lot more work. Instead, clients can retokenize using Lexer::LexFromRawLexer(). Reviewed by nlewycky. llvm-svn: 118318
* Implement -working-directory.Argyrios Kyrtzidis2010-11-034-18/+31
| | | | | | | | | | | | | | | | | | | When -working-directory is passed in command line, file paths are resolved relative to the specified directory. This helps both when using libclang (where we can't require the user to actually change the working directory) and to help reproduce test cases when the reproduction work comes along. --FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains the working directory value if set). --FileSystemOptions are passed around to various interfaces that perform file operations. --Opening & reading the content of files should be done only through FileManager. This is useful in general since file operations will be abstracted in the future for the reproduction mechanism. FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same FileManager but with different FileSystemOptions. Addresses rdar://8583824. llvm-svn: 118203
* Plug a leak in the preprocessing record's handling of inclusionDouglas Gregor2010-11-011-2/+18
| | | | | | | directives. We had a std::string in an object that was allocated via a BumpPtrAllocator. llvm-svn: 117912
* Rename alignof -> alignOf to avoid irritating C++'0x compilers,Chris Lattner2010-10-301-1/+1
| | | | | | PR8423 llvm-svn: 117775
* Make the deserialization of macro definitions lazy, so that we canDouglas Gregor2010-10-301-0/+15
| | | | | | | | | load identifiers without loading their corresponding macro definitions. This is likely to improve PCH performance slightly, and reduces deserialization stack depth considerably when using preprocessor metaprogramming. llvm-svn: 117750
* Update remaining attribute macros to new style.Chandler Carruth2010-10-231-4/+2
| | | | llvm-svn: 117204
* Extend the preprocessing record and libclang with support forDouglas Gregor2010-10-203-16/+70
| | | | | | | | | inclusion directives, keeping track of every #include, #import, etc. in the translation unit. We keep track of the source location and kind of the inclusion, how the file name was spelled, and the underlying file to which the inclusion resolved. llvm-svn: 116952
* Add a __has_attribute macro that works much like __has_feature and ↵Anders Carlsson2010-10-202-3/+15
| | | | | | __has_builtin. llvm-svn: 116906
* Really^2 fix <rdar://problem/8361834>, this time without crashing.Ted Kremenek2010-10-192-14/+33
| | | | | | | | | Now MICache is a linked list (per the FIXME), where we tradeoff between MacroInfo objects being in MICache and MIChainHead. MacroInfo objects in the MICache chain are already "Destroy()'ed", so they can be reused. When inserting into MICache, we need to remove them from the regular linked list so that they aren't destroyed more than once. llvm-svn: 116869
* Revert most of r116862. It isn't quite the right fix for a memory leak in ↵Ted Kremenek2010-10-191-5/+1
| | | | | | Preprocessor. llvm-svn: 116864
* Really fix: <rdar://problem/8361834> MacroInfo::AddTokenToBody() leaks memoryTed Kremenek2010-10-191-2/+6
| | | | | | | | | The problem was not the management of MacroInfo objects, but that when we recycle them via the MICache the memory of the underlying SmallVector (within MacroInfo) was not getting released. This is because objects stashed into MICache simply are reused with a placement new, and never have their destructor called. llvm-svn: 116862
* Simplify loop. No functionality change.Ted Kremenek2010-10-191-4/+1
| | | | llvm-svn: 116861
* Simplify lifetime management of MacroInfo objects in Preprocessor by having ↵Ted Kremenek2010-10-192-26/+11
| | | | | | | | | | | | the Preprocessor maintain them in a linked list of allocated MacroInfos. This requires only 1 extra pointer per MacroInfo object, and allows us to blow them away in one place. This fixes an elusive memory leak with MacroInfos (whose exact location I couldn't still figure out despite substantial digging). Fixes <rdar://problem/8361834>. llvm-svn: 116842
* In ~Preprocessor(), also cleanup the MacroInfo objects left-over from stray ↵Ted Kremenek2010-10-191-0/+7
| | | | | | | | "#pragma push_macro" uses. This fixes a potential memory leak. llvm-svn: 116826
* Fix typo in comment.Ted Kremenek2010-10-191-1/+1
| | | | llvm-svn: 116825
* allow I128 suffixes in msextensions mode just like i128 suffixes, patchChris Lattner2010-10-141-1/+1
| | | | | | by Martin Vejnar! llvm-svn: 116460
* move logic for computing signed integer overflow when constant foldingChris Lattner2010-10-131-27/+22
| | | | | | into APInt. llvm-svn: 116453
* Add support for UCNs for character literalsNico Weber2010-10-091-25/+55
| | | | llvm-svn: 116129
* Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked aDouglas Gregor2010-10-081-0/+1
| | | | | | bit by me). llvm-svn: 116122
* Add support for 4-byte UCNs like \U12345678. Warn about UCNs in c90 mode.Nico Weber2010-10-061-9/+30
| | | | llvm-svn: 115743
* Implement the C++0x "trailing return type" feature, e.g.,Douglas Gregor2010-10-011-0/+1
| | | | | | | | | | auto f(int) -> int from Daniel Wallin! (With a few minor bug fixes from me). llvm-svn: 115322
* In MeasureTokenLength, the FileLoc supplied to the lexer must point to the ↵Sebastian Redl2010-09-301-1/+2
| | | | | | start of the buffer, or we risk overflow. llvm-svn: 115117
* Fix coding standard mistake from my last commit.Michael J. Spencer2010-09-271-1/+1
| | | | | | That, and keep aKor happy :P. llvm-svn: 114816
* Lexer: Implement GCC's version of pragma message.Michael J. Spencer2010-09-271-15/+26
| | | | llvm-svn: 114814
* Allow the use of C++0x deleted functions as an extension in C++98.Anders Carlsson2010-09-241-1/+1
| | | | llvm-svn: 114762
* Revert "CMake: Update to use standard CMake dependency tracking facilities ↵Michael J. Spencer2010-09-131-7/+3
| | | | | | | | | | | | | instead" This reverts commit r113631 Conflicts: CMakeLists.txt lib/CodeGen/CMakeLists.txt llvm-svn: 113817
* CMake: Update to use standard CMake dependency tracking facilities insteadMichael J. Spencer2010-09-101-3/+7
| | | | | | of whatever we were using before... llvm-svn: 113631
OpenPOWER on IntegriCloud