aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex
AgeCommit message (Collapse)Author
2010-10-23Update remaining attribute macros to new style.Chandler Carruth
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117204 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20Extend the preprocessing record and libclang with support forDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116952 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20Add a __has_attribute macro that works much like __has_feature and ↵Anders Carlsson
__has_builtin. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116906 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19Really^2 fix <rdar://problem/8361834>, this time without crashing.Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116869 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19Revert most of r116862. It isn't quite the right fix for a memory leak in ↵Ted Kremenek
Preprocessor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116864 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19Really fix: <rdar://problem/8361834> MacroInfo::AddTokenToBody() leaks memoryTed Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116862 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19Simplify loop. No functionality change.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116861 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19Simplify lifetime management of MacroInfo objects in Preprocessor by having ↵Ted Kremenek
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>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116842 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19In ~Preprocessor(), also cleanup the MacroInfo objects left-over from stray ↵Ted Kremenek
"#pragma push_macro" uses. This fixes a potential memory leak. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116826 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19Fix typo in comment.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116825 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14allow I128 suffixes in msextensions mode just like i128 suffixes, patchChris Lattner
by Martin Vejnar! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116460 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13move logic for computing signed integer overflow when constant foldingChris Lattner
into APInt. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116453 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-09Add support for UCNs for character literalsNico Weber
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116129 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked aDouglas Gregor
bit by me). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116122 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06Add support for 4-byte UCNs like \U12345678. Warn about UCNs in c90 mode.Nico Weber
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115743 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Implement the C++0x "trailing return type" feature, e.g.,Douglas Gregor
auto f(int) -> int from Daniel Wallin! (With a few minor bug fixes from me). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115322 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30In MeasureTokenLength, the FileLoc supplied to the lexer must point to the ↵Sebastian Redl
start of the buffer, or we risk overflow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27Fix coding standard mistake from my last commit.Michael J. Spencer
That, and keep aKor happy :P. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114816 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27Lexer: Implement GCC's version of pragma message.Michael J. Spencer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114814 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24Allow the use of C++0x deleted functions as an extension in C++98.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114762 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13Revert "CMake: Update to use standard CMake dependency tracking facilities ↵Michael J. Spencer
instead" This reverts commit r113631 Conflicts: CMakeLists.txt lib/CodeGen/CMakeLists.txt git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113817 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10CMake: Update to use standard CMake dependency tracking facilities insteadMichael J. Spencer
of whatever we were using before... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09When we parse a pragma, keep track of how that pragma was originallyDouglas Gregor
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>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113553 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08Clean up some of the CMake dependenciesDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113416 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05fix 7320: we can't delete a trailing space if it doesn't exist.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113125 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03Use getSpelling to get original text of theFariborz Jahanian
c++ operator token. (radar 8328250). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112977 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03Patch to allow alternative representation of c++Fariborz Jahanian
operators (and, or, etc.) to be used as selectors to match g++'s behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112935 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31Prevent warning when built with assert off.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112680 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31Some support for unicode string constantsFariborz Jahanian
in wide strings. radar 8360841. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112672 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31Implement __has_feature(cxx_inline_namespaces)Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112671 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31improve isHexaLiteral to work with escaped newlines and trigraphs,Chris Lattner
patch by Francois Pichet! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112602 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30silence a warningChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112549 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30Revert my user-defined literal commits - r1124{58,60,67} pendingSean Hunt
some issues being sorted out. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112493 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30add a fixme.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112491 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30use 'features' instead of 'PP->getLangOptions'.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112490 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30Now that GCC will have #pragma push/pop (in GCC 4.6), allow theDouglas Gregor
#pragma without requiring it to be in the "clang" namespace, from Louis Gerbarg! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112484 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30In Microsoft compatibility mode, don't parse the exponent as part ofDouglas Gregor
the pp-number in a hexadecimal floating point literal, from Francois Pichet! Fixes PR7968. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112481 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-29Implement C++0x user-defined string literals.Sean Hunt
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112458 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-29Complain if a __pragma isn't terminated.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112392 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-28Add support for Microsoft's __pragma in the preprocessor.John McCall
Patch by Francois Pichet! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112391 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26Tweak wording in an assertion, from dawn@burble.org.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112182 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25Introduce a preprocessor code-completion hook for contexts where weDouglas Gregor
expect "natural" language and should not provide any completions, e.g., comments, string literals, #error. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112054 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24Implement code completion for preprocessor expressions and in macroDouglas Gregor
arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111976 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24Implement preprocessor code completion where a macro name is expected,Douglas Gregor
e.g., after #ifdef/#ifndef or #undef, or inside a defined <macroname> expression in a preprocessor conditional. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111954 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24Introduce basic code-completion support for preprocessor directives,Douglas Gregor
e.g., after a "#" we'll suggest #if, #ifdef, etc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111943 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22Detabify.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111768 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21fix PR7943, a corner case with the GNU __VA_ARGS__ comma Chris Lattner
swallowing extension. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111701 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18More PCH -> AST renaming.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111472 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18CrashRecovery: Add #pragma clang __debug handle_crash, useful when debuggingDaniel Dunbar
CrashRecovery since it avoids sending a signal which may be intercepted by the debugger. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111449 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18no need to pass bumppointer allocator into macroinfo::destroyChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111364 91177308-0d34-0410-b5e6-96231b3b80d8