summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
* 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
* When we parse a pragma, keep track of how that pragma was originallyDouglas Gregor2010-09-092-25/+46
| | | | | | | | spelled (#pragma, _Pragma, __pragma). In -E mode, use that information to add appropriate newlines when translating _Pragma and __pragma into #pragma, like GCC does. Fixes <rdar://problem/8412013>. llvm-svn: 113553
* Clean up some of the CMake dependenciesDouglas Gregor2010-09-081-0/+2
| | | | llvm-svn: 113416
* fix 7320: we can't delete a trailing space if it doesn't exist.Chris Lattner2010-09-051-1/+3
| | | | llvm-svn: 113125
* Use getSpelling to get original text of theFariborz Jahanian2010-09-031-3/+1
| | | | | | c++ operator token. (radar 8328250). llvm-svn: 112977
* Patch to allow alternative representation of c++Fariborz Jahanian2010-09-031-1/+3
| | | | | | | operators (and, or, etc.) to be used as selectors to match g++'s behavior. llvm-svn: 112935
* Prevent warning when built with assert off.Fariborz Jahanian2010-08-311-0/+1
| | | | llvm-svn: 112680
* Some support for unicode string constantsFariborz Jahanian2010-08-311-3/+18
| | | | | | in wide strings. radar 8360841. llvm-svn: 112672
* Implement __has_feature(cxx_inline_namespaces)Sebastian Redl2010-08-311-0/+1
| | | | llvm-svn: 112671
* improve isHexaLiteral to work with escaped newlines and trigraphs,Chris Lattner2010-08-311-7/+8
| | | | | | patch by Francois Pichet! llvm-svn: 112602
* silence a warningChris Lattner2010-08-301-1/+1
| | | | llvm-svn: 112549
* Revert my user-defined literal commits - r1124{58,60,67} pendingAlexis Hunt2010-08-303-65/+20
| | | | | | some issues being sorted out. llvm-svn: 112493
* add a fixme.Chris Lattner2010-08-301-1/+5
| | | | llvm-svn: 112491
* use 'features' instead of 'PP->getLangOptions'.Chris Lattner2010-08-301-8/+8
| | | | llvm-svn: 112490
* Now that GCC will have #pragma push/pop (in GCC 4.6), allow theDouglas Gregor2010-08-301-31/+14
| | | | | | | #pragma without requiring it to be in the "clang" namespace, from Louis Gerbarg! llvm-svn: 112484
* In Microsoft compatibility mode, don't parse the exponent as part ofDouglas Gregor2010-08-301-1/+10
| | | | | | | the pp-number in a hexadecimal floating point literal, from Francois Pichet! Fixes PR7968. llvm-svn: 112481
* Implement C++0x user-defined string literals.Alexis Hunt2010-08-293-20/+65
| | | | | | | | | | The extra data stored on user-defined literal Tokens is stored in extra allocated memory, which is managed by the PreprocessorLexer because there isn't a better place to put it that makes sure it gets deallocated, but only after it's used up. My testing has shown no significant slowdown as a result, but independent testing would be appreciated. llvm-svn: 112458
* Complain if a __pragma isn't terminated.John McCall2010-08-291-0/+5
| | | | llvm-svn: 112392
* Add support for Microsoft's __pragma in the preprocessor.John McCall2010-08-282-5/+61
| | | | | | Patch by Francois Pichet! llvm-svn: 112391
* Tweak wording in an assertion, from dawn@burble.org.Douglas Gregor2010-08-261-1/+1
| | | | llvm-svn: 112182
* Introduce a preprocessor code-completion hook for contexts where weDouglas Gregor2010-08-252-6/+29
| | | | | | | expect "natural" language and should not provide any completions, e.g., comments, string literals, #error. llvm-svn: 112054
* Implement code completion for preprocessor expressions and in macroDouglas Gregor2010-08-242-0/+14
| | | | | | arguments. llvm-svn: 111976
* Implement preprocessor code completion where a macro name is expected,Douglas Gregor2010-08-242-1/+15
| | | | | | | e.g., after #ifdef/#ifndef or #undef, or inside a defined <macroname> expression in a preprocessor conditional. llvm-svn: 111954
* Introduce basic code-completion support for preprocessor directives,Douglas Gregor2010-08-243-22/+36
| | | | | | e.g., after a "#" we'll suggest #if, #ifdef, etc. llvm-svn: 111943
* Detabify.Eli Friedman2010-08-221-1/+1
| | | | llvm-svn: 111768
* fix PR7943, a corner case with the GNU __VA_ARGS__ comma Chris Lattner2010-08-211-0/+7
| | | | | | swallowing extension. llvm-svn: 111701
* More PCH -> AST renaming.Sebastian Redl2010-08-181-2/+2
| | | | llvm-svn: 111472
OpenPOWER on IntegriCloud