summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Support decltype in nested-name-specifiers.David Blaikie2011-12-041-0/+1
| | | | llvm-svn: 145785
* Implement support for the __is_final type trait, to determine whetherDouglas Gregor2011-12-031-0/+2
| | | | | | | a class is marked 'final', from Alberto Ganesh Barbati! Fixes PR11462. llvm-svn: 145775
* Tighten up the conditions under which we consider ourselves to beDouglas Gregor2011-11-071-2/+4
| | | | | | | entering the context of a nested-name-specifier. Fixes <rdar://problem/10397846>. llvm-svn: 143967
* Correct the grammar for __builtin_astype.Peter Collingbourne2011-11-051-1/+1
| | | | llvm-svn: 143777
* Improve the warning for cv-qualifiers on free functions, from Ahmed Charles!Douglas Gregor2011-10-191-0/+2
| | | | llvm-svn: 142478
* Add -Wc++98-compat warnings for uses of the new keywords 'alignof', 'char16_t',Richard Smith2011-10-171-1/+6
| | | | | | 'char32_t', 'constexpr', 'decltype', 'noexcept', 'nullptr' and 'static_assert'. llvm-svn: 142302
* Implement -Wc++98-compat warnings for the parser.Richard Smith2011-10-151-4/+9
| | | | llvm-svn: 142056
* Provide half floating point support as a storage only type.Anton Korobeynikov2011-10-141-0/+1
| | | | | | Lack of half FP was a regression compared to llvm-gcc. llvm-svn: 142016
* Introduce BalancedDelimiterTracker, to better track open/closeDouglas Gregor2011-10-121-48/+65
| | | | | | | delimiter pairs and detect when we exceed the implementation limit for nesting depth, from Aaron Ballman! llvm-svn: 141782
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140367
* Rename SourceLocation::getFileLocWithOffset -> getLocWithOffset.Argyrios Kyrtzidis2011-09-191-3/+3
| | | | | | It already works (and is useful with) macro locs as well. llvm-svn: 140057
* Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear ↵Francois Pichet2011-09-171-1/+1
| | | | | | | | that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag. Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag. llvm-svn: 139987
* Support code-completion for C++ inline methods and ObjC buffering methods.Argyrios Kyrtzidis2011-09-041-13/+15
| | | | | | | | | | | | | | Previously we would cut off the source file buffer at the code-completion point; this impeded code-completion inside C++ inline methods and, recently, with buffering ObjC methods. Have the code-completion inserted into the source buffer so that it can be buffered along with a method body. When we actually hit the code-completion point the cut-off lexing or parsing. Fixes rdar://10056932&8319466 llvm-svn: 139086
* Parsing of C++0x lambda expressions, from John Freeman with help fromDouglas Gregor2011-08-041-0/+10
| | | | | | David Blaikie! llvm-svn: 136876
* Add support for C++0x unicode string and character literals, from Craig Topper!Douglas Gregor2011-07-271-0/+6
| | | | llvm-svn: 136210
* Fix a stray instantiation comment in Parse.Chandler Carruth2011-07-261-3/+3
| | | | llvm-svn: 136059
* Mechanically rename SourceManager::getInstantiationLoc andChandler Carruth2011-07-251-1/+1
| | | | | | | | FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part of the API and documentation update from 'instantiation' as the term for macros to 'expansion'. llvm-svn: 135914
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-4/+4
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Convert terminology in the Lexer from 'instantiate' and variants toChandler Carruth2011-07-141-1/+1
| | | | | | | | | 'expand'. Also update the public API it provides to the new term, and propagate that update to the various clients. No functionality changed. llvm-svn: 135138
* Add 'mutable' to the function declarator chunk, to be used whenDouglas Gregor2011-07-131-0/+1
| | | | | | parsing lambda expressions, from John Freeman! llvm-svn: 135090
* Remove a no-op break after a return, and correct one of the mostChandler Carruth2011-07-081-2/+2
| | | | | | | | | confusing indentations I've seen recently... Just noticed these while making a change elsewhere. No functionality changed. llvm-svn: 134685
* Minor style cleanup.Chandler Carruth2011-07-081-6/+9
| | | | | | Original patch by John Freeman, some style tweaks by me. llvm-svn: 134683
* Move SourceManager::isAt[Start/End]OfMacroInstantiation functions to the ↵Argyrios Kyrtzidis2011-07-071-2/+1
| | | | | | Lexer, since they depend on it now. llvm-svn: 134644
* Make the Preprocessor more memory efficient and improve macro instantiation ↵Argyrios Kyrtzidis2011-07-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostics. When a macro instantiation occurs, reserve a SLocEntry chunk with length the full length of the macro definition source. Set the spelling location of this chunk to point to the start of the macro definition and any tokens that are lexed directly from the macro definition will get a location from this chunk with the appropriate offset. For any tokens that come from argument expansion, '##' paste operator, etc. have their instantiation location point at the appropriate place in the instantiated macro definition (the argument identifier and the '##' token respectively). This improves macro instantiation diagnostics: Before: t.c:5:9: error: invalid operands to binary expression ('struct S' and 'int') int y = M(/); ^~~~ t.c:5:11: note: instantiated from: int y = M(/); ^ After: t.c:5:9: error: invalid operands to binary expression ('struct S' and 'int') int y = M(/); ^~~~ t.c:3:20: note: instantiated from: \#define M(op) (foo op 3); ~~~ ^ ~ t.c:5:11: note: instantiated from: int y = M(/); ^ The memory savings for a candidate boost library that abuses the preprocessor are: - 32% less SLocEntries (37M -> 25M) - 30% reduction in PCH file size (900M -> 635M) - 50% reduction in memory usage for the SLocEntry table (1.6G -> 800M) llvm-svn: 134587
* [ARC] When casting from a pointer to an objective-c object with known ↵Argyrios Kyrtzidis2011-07-011-30/+47
| | | | | | | | | | | | ownership, if the cast type has no ownership specified, implicitly "transfer" the ownership of the cast'ed type to the cast type: id x; (NSString**)&x; // Casting as (__strong NSString**). llvm-svn: 134275
* -Remove Sema::ActOnCastOfParenListExpr and move most of its functionality toArgyrios Kyrtzidis2011-07-011-1/+1
| | | | | | | | | newly introduced Sema::BuildVectorLiteral. -Make Sema::ActOnCastExpr handle a vector initializer both when the cast'ed expression is a ParenListExpr and when it is a ParenExpr. -Ultimately make Sema::ActOnParenOrParenListExpr independent of what the cast type was. llvm-svn: 134274
* For code such as:Richard Trieu2011-07-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | int f(int x) { if (int foo = f(bar)) {} return 0; } Clang produces the following error messages: paren_imbalance.cc:2:19: error: use of undeclared identifier 'bar' if (int foo = f(bar)) {} ^ paren_imbalance.cc:2:26: error: expected ')' if (int foo = f(bar)) {} ^ paren_imbalance.cc:2:6: note: to match this '(' if (int foo = f(bar)) {} ^ The second error is incorrect. This patch will stop Clang from producing an error on parenthesis imbalance during error recovery when there isn't one. llvm-svn: 134258
* Allow the fixit for missing ':' in the ?: ternary operator if it is pointingArgyrios Kyrtzidis2011-06-241-2/+3
| | | | | | at the start of a macro instantiation. llvm-svn: 133801
* Introduce DelayedCleanupPool useful for simplifying clean-up of certain ↵Argyrios Kyrtzidis2011-06-221-4/+2
| | | | | | | | | | resources that, while their lifetime is well-known and restricted, cleaning them up manually is easy to miss and cause a leak. Use it to plug the leaking of TemplateIdAnnotation objects. rdar://9634138. llvm-svn: 133610
* Only accept __bridge_retain in system headers, as Doug suggested.John McCall2011-06-171-5/+17
| | | | llvm-svn: 133300
* As a hopefully temporary workaround for a header mistake, treatJohn McCall2011-06-171-1/+2
| | | | | | __bridge_retain as a synonym for __bridge_retained. llvm-svn: 133295
* Automatic Reference Counting.John McCall2011-06-151-2/+30
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Correct the spelling of instantiationDavid Majnemer2011-06-131-1/+1
| | | | llvm-svn: 132901
* Parse C++0x generalized initializers.Sebastian Redl2011-06-051-6/+32
| | | | llvm-svn: 132662
* Add support for builtin astype:Tanya Lattner2011-06-041-0/+30
| | | | | | | __builtin_astype(): Used to reinterpreted as another data type of the same size using for both scalar and vector data types. Added test case. llvm-svn: 132612
* Implement the __is_trivially_copyable type traitAlexis Hunt2011-05-131-0/+4
| | | | llvm-svn: 131270
* Upgrade Microsoft's __int8, __int16, __int32 and __int64 types from builtin ↵Francois Pichet2011-04-281-0/+1
| | | | | | | | | | | | | | defines to real types. Otherwise statements like: __int64 var = __int64(0); would be expanded to: long long var = long long(0); and fail to compile. llvm-svn: 130369
* Implementation of Embarcadero array type traitsJohn Wiegley2011-04-281-0/+9
| | | | | | | | | | Patch authored by John Wiegley. These are array type traits used for parsing code that employs certain features of the Embarcadero C++ compiler: __array_rank(T) and __array_extent(T, Dim). llvm-svn: 130351
* t/clang/type-traitsJohn Wiegley2011-04-271-0/+55
| | | | | | | | | | Patch authored by John Wiegley. These type traits are used for parsing code that employs certain features of the Embarcadero C++ compiler. Several of these constructs are also desired by libc++, according to its project pages (such as __is_standard_layout). llvm-svn: 130342
* Introduce a new parser annotation token for primary expressions. WhenDouglas Gregor2011-04-271-20/+12
| | | | | | | ClassifyName() builds a primary expression, generate one of these annotation tokens rather than jumping into the parser. llvm-svn: 130297
* t/clang/expr-traitsJohn Wiegley2011-04-251-0/+8
| | | | | | | | | Patch authored by David Abrahams. These two expression traits (__is_lvalue_expr, __is_rvalue_expr) are used for parsing code that employs certain features of the Embarcadero C++ compiler. llvm-svn: 130122
* Implement a new identifier-classification scheme where SemaDouglas Gregor2011-04-241-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | performs name lookup for an identifier and resolves it to a type/expression/template/etc. in the same step. This scheme is intended to improve both performance (by reducing the number of redundant name lookups for a given identifier token) and error recovery (by giving Sema a chance to correct type names before the parser has decided that the identifier isn't a type name). For example, this allows us to properly typo-correct type names at the beginning of a statement: t.c:6:3: error: use of undeclared identifier 'integer'; did you mean 'Integer'? integer *i = 0; ^~~~~~~ Integer t.c:1:13: note: 'Integer' declared here typedef int Integer; ^ Previously, we wouldn't give a Fix-It because the typo correction occurred after the parser had checked whether "integer" was a type name (via Sema::getTypeName(), which isn't allowed to typo-correct) and therefore decided to parse "integer * i = 0" as an expression. By typo-correcting earlier, we typo-correct to the type name Integer and parse this as a declaration. Moreover, in this context, we can also typo-correct identifiers to keywords, e.g., t.c:7:3: error: use of undeclared identifier 'vid'; did you mean 'void'? vid *p = i; ^~~ void and recover appropriately. Note that this is very much a work-in-progress. The new Sema::ClassifyName is only used for expression-or-declaration disambiguation in C at the statement level. The next steps will be to make this work for the same disambiguation in C++ (where functional-style casts make some trouble), then push it further into the parser to eliminate more redundant name lookups. Fixes <rdar://problem/7963833> for C and starts us down the path of <rdar://problem/8172000>. llvm-svn: 130082
* Add support for '__is_literal_type' spelling of the existingChandler Carruth2011-04-241-0/+1
| | | | | | | | '__is_literal' type trait for GCC compatibility. At least one relased version if libstdc++ uses this name for the trait despite it not being documented anywhere. llvm-svn: 130078
* Implement basic __is_trivial type-trait support, enough to close PR9472.Chandler Carruth2011-04-231-0/+2
| | | | | | | | | | | | | | | | | | This introduces a few APIs on the AST to bundle up the standard-based logic so that programmatic clients have access to exactly the same behavior. There is only one serious FIXME here: checking for non-trivial move constructors and move assignment operators. Those bits need to be added to the declaration and accessors provided. This implementation should be enough for the uses of __is_trivial in libstdc++ 4.6's C++98 library implementation. Ideas for more thorough test cases or any edge cases missing would be appreciated. =D llvm-svn: 130057
* Sort the type traits in a few places where they weren't previouslyChandler Carruth2011-04-231-5/+5
| | | | | | sorted in order to prepare for adding some new ones. llvm-svn: 130056
* C1X: implement generic selectionsPeter Collingbourne2011-04-151-0/+98
| | | | | | | As an extension, generic selection support has been added for all supported languages. The syntax is the same as for C1X. llvm-svn: 129554
* Diagnose a missing ')' on what looks like a statement expression.John McCall2011-04-061-1/+6
| | | | | | | A situation where we can get an invalid ExprResult without an error. Fixes PR8394. Patch by Justin Bogner! llvm-svn: 128979
* Insomniac refactoring: change how the parser allocates attributes so thatJohn McCall2011-03-241-10/+10
| | | | | | | | | AttributeLists do not accumulate over the lifetime of parsing, but are instead reused. Also make the arguments array not require a separate allocation, and make availability attributes store their stuff in augmented memory, too. llvm-svn: 128209
* Make sure that we always pop a function's scope *before* we callDouglas Gregor2011-03-161-0/+1
| | | | | | | | | | | ActOnFinishFunctionBody/ActOnBlockStmtExpr. This way, we ensure that we diagnose undefined labels before the jump-scope checker gets run, since the jump-scope checker requires (as its invariant) that all of the GotoStmts be wired up correctly. Fixes PR9495. llvm-svn: 127738
* Add support for the OpenCL vec_step operator, by generalising andPeter Collingbourne2011-03-111-28/+41
| | | | | | | extending the existing support for sizeof and alignof. Original patch by Guy Benyei. llvm-svn: 127475
OpenPOWER on IntegriCloud