summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
...
* Initialize the non-target-dependent fields of the Preprocessor in its ↵Argyrios Kyrtzidis2012-06-021-48/+47
| | | | | | | | | | | constructor so we can destroy it even if it was constructed with "DelayInitialization = true", and we didn't end up calling Preprocessor::Initialize. Fixes crashes in rdar://11558355 llvm-svn: 157892
* Lexer::ReadToEndOfLine: Only build the string if it's actually used and do ↵Benjamin Kramer2012-05-182-13/+12
| | | | | | so in a less malloc-intensive way. llvm-svn: 157064
* [preprocessor] Make sure that MacroExpands callbacks are always in source order.Argyrios Kyrtzidis2012-05-101-3/+21
| | | | | | Fixes assertion hit in the preprocessing record. rdar://11426523 llvm-svn: 156557
* In StringLiteralParser::init, make sure we emit an error whenArgyrios Kyrtzidis2012-05-031-14/+13
| | | | | | | | failing to lex the string, as suggested by Eli. Part of rdar://11305263. llvm-svn: 156081
* In StringLiteralParser::init(), fail gracefully if the string isArgyrios Kyrtzidis2012-05-031-1/+6
| | | | | | | | | not as we expect; it may be due to racing issue of a file coming from PCH changing after the PCH is loaded. rdar://11353109 llvm-svn: 156043
* Implements boxed expressions for Objective-C. <rdar://problem/10194391>Patrick Beard2012-04-191-0/+1
| | | | llvm-svn: 155082
* Support -Wc++98-compat-pedantic as requested:Seth Cantrell2012-04-131-4/+4
| | | | | | http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120409/056126.html llvm-svn: 154655
* C++11 no longer requires files to end with a newlineSeth Cantrell2012-04-131-1/+2
| | | | llvm-svn: 154643
* Add a query macro for C++11 N3276, decltype does not require completeDouglas Gregor2012-04-101-0/+1
| | | | | | return types, from Michel Morin! llvm-svn: 154428
* ext_reserved_user_defined_literal must not default to Error in ↵Francois Pichet2012-04-071-1/+3
| | | | | | | | MicrosoftMode. Hence create ext_ms_reserved_user_defined_literal that doesn't default to Error; otherwise MSVC headers won't parse. Fixes PR12383. llvm-svn: 154273
* [Lex] Add support for 'user specified system frameworks' (see test case).Daniel Dunbar2012-04-051-7/+30
| | | | | | - Developers of system frameworks need a way for their framework to be treated as a "system framework" during development. Otherwise, they are unable to properly test how their framework behaves when installed because of the semantic changes (in warning behavior) applied to system frameworks. llvm-svn: 154105
* [Lex] HeaderSearch: Introduce a FrameworkCacheEntry structure to hold the ↵Daniel Dunbar2012-04-051-13/+11
| | | | | | | | FrameworkMap items. - No functionality change. llvm-svn: 154104
* Simplify.Daniel Dunbar2012-04-051-2/+1
| | | | llvm-svn: 154103
* [preprocessor] In Preprocessor::CachingLex() check whether there were more ↵Argyrios Kyrtzidis2012-04-041-7/+11
| | | | | | | | | | | | | tokens cached during the non-cached lex, otherwise we are going to drop them. Fixes a bogus "_Pragma takes a parenthesized string literal" error when expanding consecutive _Pragmas in a macro argument. Part of rdar://11168596 llvm-svn: 153994
* Add feature check "cxx_local_type_template_args" describing supportDouglas Gregor2012-04-041-0/+2
| | | | | | | for templates with local template arguments, from Michel Morin! Fixes PR12337. llvm-svn: 153983
* Correct handling of _Pragma macro inside a macro argument.Argyrios Kyrtzidis2012-04-033-5/+66
| | | | | | | | | | | | | | | | If we are pre-expanding a macro argument don't actually "activate" the pragma at that point, activate the pragma whenever we encounter it again in the token stream. This ensures that we will activate it in the correct location or that we will ignore it if it never enters the token stream, e.g: \#define EMPTY(x) \#define INACTIVE(x) EMPTY(x) INACTIVE(_Pragma("clang diagnostic ignored \"-Wconversion\"")) This also fixes the crash in rdar://11168596. llvm-svn: 153959
* Fixed MacroInfo definition range for function like macros with empty body.Abramo Bagnara2012-03-311-3/+2
| | | | llvm-svn: 153819
* Make ModuleMapParser own its TargetInfo, so it doesn't get leaked.Benjamin Kramer2012-03-291-2/+2
| | | | llvm-svn: 153648
* [preprocessor] Handle correctly inclusion directives that have macro ↵Argyrios Kyrtzidis2012-03-272-18/+45
| | | | | | | | | | | | | | | | | | expansions, e.g "#include MACRO(STUFF)". -As an inclusion position for the included file, use the file location of the file where it was included but *after* the macro expansions. We want the macro expansions to be considered as before-in-translation-unit for everything in the included file. -In the preprocessing record take into account that only inclusion directives can be encountered as "out-of-order" (by comparing the start of the range which for inclusions is the hash location) and use binary search if there is an extreme number of macro expansions in the include directive. Fixes rdar://11111779 llvm-svn: 153527
* Simplify some users of DenseMap::erase.Benjamin Kramer2012-03-241-4/+1
| | | | llvm-svn: 153389
* Turns #import in MS Mode into an error.Aaron Ballman2012-03-181-2/+18
| | | | llvm-svn: 153009
* From Vassil Vassilev:Axel Naumann2012-03-162-8/+11
| | | | | | | | | | | | | | Enable incremental parsing by the Preprocessor, where more code can be provided after an EOF. It mainly prevents the tearing down of the topmost lexer. To be used like this: PP.enableIncrementalProcessing(); while (getMoreSource()) { while (Parser.ParseTopLevelDecl(ADecl)) {...} } PP.enableIncrementalProcessing(false); llvm-svn: 152914
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-119-109/+109
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Improve diagnostics for UCNs referring to control characters and members of theRichard Smith2012-03-091-24/+41
| | | | | | | | | | basic source character set in C++98. Add -Wc++98-compat diagnostics for same in literals in C++11. Extend such support to cover string literals as well as character literals, and mark N2170 as done. This seems too minor to warrant a release note to me. Let me know if you disagree. llvm-svn: 152444
* User-defined literals are done.Richard Smith2012-03-091-2/+2
| | | | llvm-svn: 152396
* When checking the encoding of an 8-bit string literal, don't just check theRichard Smith2012-03-081-13/+8
| | | | | | | first codepoint! Also, don't reject empty raw string literals for spurious "encoding" issues. Also, don't rely on undefined behavior in ConvertUTF.c. llvm-svn: 152344
* Add support for cooked forms of user-defined-integer-literal andRichard Smith2012-03-082-4/+20
| | | | | | | user-defined-floating-literal. Support for raw forms of these literals to follow. llvm-svn: 152302
* Implement C++11 [lex.ext]p10 for string and character literals: a ud-suffix notRichard Smith2012-03-081-1/+14
| | | | | | | | | | | | | | | | | | starting with an underscore is ill-formed. Since this rule rejects programs that were using <inttypes.h>'s macros, recover from this error by treating the ud-suffix as a separate preprocessing-token, with a DefaultError ExtWarn. The approach of treating such cases as two tokens is under discussion for standardization, but is in any case a conforming extension and allows existing codebases to keep building while the committee makes up its mind. Reword the warning on the definition of literal operators not starting with underscores (which are, strangely, legal) to more explicitly state that such operators can't be called by literals. Remove the special-case diagnostic for hexfloats, since it was both triggering in the wrong cases and incorrect. llvm-svn: 152287
* User-defined literal support for character literals.Richard Smith2012-03-081-0/+3
| | | | llvm-svn: 152277
* Add -Wc++11-compat warning for string and character literals followed byRichard Smith2012-03-071-5/+12
| | | | | | | identifiers, in cases where those identifiers would be treated as user-defined literal suffixes in C++11. llvm-svn: 152198
* Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,Ted Kremenek2012-03-061-0/+4
| | | | | | | | | | | | | NSNumber, and boolean literals. This includes both Sema and Codegen support. Included is also support for new Objective-C container subscripting. My apologies for the large patch. It was very difficult to break apart. The patch introduces changes to the driver as well to cause clang to link in additional runtime support when needed to support the new language features. Docs are forthcoming to document the implementation and behavior of these features. llvm-svn: 152137
* User-defined literals: reject string and character UDLs in all places where theRichard Smith2012-03-067-17/+99
| | | | | | | | | | grammar requires a string-literal and not a user-defined-string-literal. The two constructs are still represented by the same TokenKind, in order to prevent a combinatorial explosion of different kinds of token. A flag on Token tracks whether a ud-suffix is present, in order to prevent clients from needing to look at the token's spelling. llvm-svn: 152098
* [preprocessor] Enhance PreprocessingRecord to keep track of locations of ↵Argyrios Kyrtzidis2012-03-052-4/+99
| | | | | | | | | conditional directives. Introduce PreprocessingRecord::rangeIntersectsConditionalDirective() which returns true if a given range intersects with a conditional directive block. llvm-svn: 152018
* [preprocessor] Enhance the preprocessor callbacks:Argyrios Kyrtzidis2012-03-051-27/+29
| | | | | | | | -Add location parameter for the directives callbacks -Skip callbacks if the directive is inside a skipped range. -Make sure the directive callbacks are invoked in source order. llvm-svn: 152017
* Lexing support for user-defined literals. Currently these lex as the same tokenRichard Smith2012-03-052-6/+88
| | | | | | | kinds as the underlying string literals, and we silently drop the ud-suffix; those issues will be fixed by subsequent patches. llvm-svn: 152012
* Add a pile of tests for unrestricted unions, and advertise support for them.Richard Smith2012-03-031-1/+1
| | | | llvm-svn: 151992
* Remove unused variable.Benjamin Kramer2012-03-031-1/+0
| | | | llvm-svn: 151989
* Adding support for #pragma include_alias in MS compatibility mode. This ↵Aaron Ballman2012-03-022-0/+126
| | | | | | implements PR 10705. llvm-svn: 151949
* Change @import to @__experimental_modules_import. We are not ready to ↵Ted Kremenek2012-03-012-7/+7
| | | | | | | | commit to a particular syntax for modules, and don't have time to push it forward in the near future. llvm-svn: 151841
* Implement double underscore names support in __has_attributeJean-Daniel Dupas2012-03-011-1/+6
| | | | llvm-svn: 151809
* Revert r151800, which was committed without review and has correctness issues.Richard Smith2012-03-012-108/+0
| | | | llvm-svn: 151804
* Implements support for #pragma include_alias in ms compatibility mode. ↵Aaron Ballman2012-03-012-0/+108
| | | | | | Fixes PR10705. llvm-svn: 151800
* Move suport for redefining operator keywords from -fms-extensions to ↵Nico Weber2012-03-011-1/+1
| | | | | | -fms-compatibility. llvm-svn: 151776
* Allow operator keywords to be #defined in ms-ext mode.Nico Weber2012-02-291-1/+8
| | | | | | | | | | | | | | Fixes PR10606. I'm not sure if this is the best way to go about it, but I locally enabled this code path without the msext conditional, and all tests pass, except for test/Preprocessor/cxx_oper_keyword.cpp which explicitly checks that operator keywords can't be redefined. I also parsed chromium/win with a clang with and without this patch. It introduced no new errors, but removes 43 existing errors. llvm-svn: 151768
* Initializer lists are now supported.Sebastian Redl2012-02-251-1/+1
| | | | llvm-svn: 151458
* Accept __has_feature(__feature__) as a synonym for __has_feature(feature) (andRichard Smith2012-02-251-2/+13
| | | | | | likewise for __has_extension). Patch by Jonathan Sauer! llvm-svn: 151445
* Don't record nested macro expansions in the preprocessing record,Argyrios Kyrtzidis2012-02-252-9/+6
| | | | | | | | it can only bring pain when dealing with preprocessor abuse (see: boost). rdar://10898986 llvm-svn: 151427
* Implement a new type trait __is_trivially_constructible(T, Args...)Douglas Gregor2012-02-241-0/+1
| | | | | | | | | | | | | | | | that provides the behavior of the C++11 library trait std::is_trivially_constructible<T, Args...>, which can't be implemented purely as a library. Since __is_trivially_constructible can have zero or more arguments, I needed to add Yet Another Type Trait Expression Class, this one handling arbitrary arguments. The next step will be to migrate UnaryTypeTrait and BinaryTypeTrait over to this new, more general TypeTrait class. Fixes the Clang side of <rdar://problem/10895483> / PR12038. llvm-svn: 151352
* Provide the __is_trivially_assignable type trait, which providesDouglas Gregor2012-02-231-0/+1
| | | | | | | compiler support for the std::is_trivially_assignable library type trait. llvm-svn: 151240
* Clang now supports lambda expressions.Douglas Gregor2012-02-231-1/+1
| | | | llvm-svn: 151231
OpenPOWER on IntegriCloud