summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
Commit message (Collapse)AuthorAgeFilesLines
...
* Parsing/Sema for OMPCollapseClause.Alexander Musman2014-05-271-2/+8
| | | | | | Actual usage in Sema for collapsing loops will in some future patch. llvm-svn: 209660
* Emit used/dllexport inline method definitions in nested classes (PR19743, ↵Hans Wennborg2014-05-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR11170) The previous code that was supposed to handle this didn't work since parsing of inline method definitions is delayed to the end of the outer class definition. Thus, when HandleTagDeclDefinition() got called for the inner class, the inline functions in that class had not been parsed yet. Richard suggested that the way to do this is by handling inline method definitions through a new ASTConsumer callback. I really wanted to call ASTContext::DeclMustBeEmitted() instead of checking for attributes, but doing that causes us to compute linkage, and then we fail with "error: unsupported: typedef changes linkage of anonymous type, but linkage was already computed" on tests like this: (from SemaCXX/undefined-internal.cpp) :-/ namespace test7 { typedef struct { void bar(); void foo() { bar(); } } A; } Differential Revision: http://reviews.llvm.org/D3809 llvm-svn: 209549
* Implemented support for "pragma clang optimize on/off", based on attribute ↵Dario Domizioli2014-05-231-0/+53
| | | | | | | | | | | | | | | | 'optnone'. This patch implements support for selectively disabling optimizations on a range of function definitions through a pragma. The implementation is that all function definitions in the range are decorated with attribute 'optnone'. #pragma clang optimize off // All function definitions in here are decorated with 'optnone'. #pragma clang optimize on // Compilation resumes as normal. llvm-svn: 209510
* Improved recovery of switch statementSerge Pavlov2014-05-211-27/+34
| | | | | | | | | Make better diagnostic produced by erroneous switch statement. It fixes PR19022. Differential Revision: http://reviews.llvm.org/D3137 llvm-svn: 209302
* [C++11] Use 'nullptr'. Parser edition.Craig Topper2014-05-2113-314/+329
| | | | llvm-svn: 209275
* Replace a fake enum class with the real thing.Richard Smith2014-05-164-185/+185
| | | | llvm-svn: 208943
* Replace completely bogus ambiguous-compound-literal-in-C++ code with somethingRichard Smith2014-05-151-2/+4
| | | | | | that isn't always wrong. llvm-svn: 208844
* PR19748: Make sure we don't lose colon protection after the parenthesized ↵Richard Smith2014-05-152-14/+18
| | | | | | type-id in a cast-expression. llvm-svn: 208843
* [OPENMP] Removed unnecessary enums from OpenMP constructsAlexey Bataev2014-05-121-5/+2
| | | | llvm-svn: 208516
* Wrap to 80 columns. No behavior change.Nico Weber2014-05-101-8/+12
| | | | llvm-svn: 208475
* Fix an outdated comment.Richard Smith2014-05-081-4/+3
| | | | llvm-svn: 208366
* Suggest fix-it ':' when '=' used in for-range-declarationIsmail Pazarbasi2014-05-082-12/+27
| | | | | | | | | | Fix for PR19176. Clang will suggest a fix-it hint for cases like: int arr[] = {1, 2, 3, 4}; for (auto i = arr) ^ : llvm-svn: 208299
* [OPENMP] Initial codegen for '#pragma omp parallel'Alexey Bataev2014-05-061-2/+3
| | | | llvm-svn: 208077
* [OPENMP] 'proc_bind' clause support - Parsing and sema analysis for OpenMP ↵Alexey Bataev2014-05-061-4/+10
| | | | | | clause 'proc_bind' llvm-svn: 208060
* During parsing, update the range of the Declarator to include the identifier.Richard Trieu2014-05-051-0/+1
| | | | llvm-svn: 208011
* Wrap a few lines at 80 columns, change a confusing indent. No behavior change.Nico Weber2014-05-032-6/+7
| | | | llvm-svn: 207921
* Rewrite NRVO determination. Track NRVO candidates on the parser Scope and ↵Nick Lewycky2014-05-032-3/+2
| | | | | | | | apply the NRVO candidate flag to all possible NRVO candidates here, and remove the flags in computeNRVO or upon template instantiation. A variable now has NRVO applied if and only if every return statement in that scope returns that variable. This is nearly optimal. Performs NRVO roughly 7% more often in a bootstrap build of clang. Patch co-authored by Richard Smith. llvm-svn: 207890
* Fix PR 19630, don't crash when file ends with whitespace.Richard Trieu2014-05-021-1/+2
| | | | llvm-svn: 207883
* Cut off parsing early during code completionAlp Toker2014-05-022-5/+4
| | | | | | | | | These calls to ConsumeCodeCompletionToken() caused parsing to continue needlessly when an immediate cutOffParsing() would do. Document the function to clarify its correct usage. llvm-svn: 207823
* Handle -fdelayed-template-parsing of out-of-line definitions ofHans Wennborg2014-05-021-31/+10
| | | | | | | | | | | class template member classes (PR19613) Also improve this code in general by implementing suggestions from Richard. Differential Revision: http://reviews.llvm.org/D3555?id=9020 llvm-svn: 207822
* Fix another leak in ParseMicrosoftAsmStatement(), found by LSan.Nico Weber2014-04-231-2/+3
| | | | llvm-svn: 207040
* Fix a memory leak found by LSan.Nico Weber2014-04-231-3/+4
| | | | llvm-svn: 207013
* Update Target::createMCAsmParser calls for the LLVM interface change.Evgeniy Stepanov2014-04-231-1/+5
| | | | | | Patch by Yuri Gorshenin. llvm-svn: 206970
* [OPENMP] parsing 'linear' clause (for directive 'omp simd')Alexander Musman2014-04-221-11/+30
| | | | | | Differential Revision: http://reviews.llvm.org/D3272 llvm-svn: 206891
* Refactor all the checking for missing 'template<>'s when a declaration has aRichard Smith2014-04-171-12/+5
| | | | | | template-id after its scope specifier into a single place. llvm-svn: 206442
* Partial revert of r206229, to get the build bots green again.Aaron Ballman2014-04-151-8/+9
| | | | llvm-svn: 206237
* Fixing a typo, updating the diagnostic wording and logic based on ↵Aaron Ballman2014-04-152-6/+6
| | | | | | post-commit review feedback. Amends r206186. llvm-svn: 206229
* Properly diagnose Microsoft __declspec attributes which have optional ↵Aaron Ballman2014-04-141-2/+13
| | | | | | | | | | argument lists when the arguments are elided. eg) __declspec(deprecated()) // error __declspec(deprecated) // OK __declspec(deprecated("")) // OK llvm-svn: 206191
* Properly diagnose standard C++ attributes which have optional argument lists ↵Aaron Ballman2014-04-142-11/+33
| | | | | | | | | | | when the arguments are elided. eg) [[deprecated()]] // error [[deprecated]] // OK [[deprecated("")]] // OK [[gnu::deprecated()]] // OK llvm-svn: 206186
* Improve error recovery around colon.Serge Pavlov2014-04-133-11/+40
| | | | | | | | | | Parse of nested name spacifier is modified so that it properly recovers if colon is mistyped as double colon in case statement. This patch fixes PR15133. Differential Revision: http://llvm-reviews.chandlerc.com/D2870 llvm-svn: 206135
* PR19339: Disambiguate lambdas with init-captures from designated initializersRichard Smith2014-04-132-39/+23
| | | | | | properly. llvm-svn: 206128
* [MS-ABI] Add support for #pragma section and related pragmasWarren Hunt2014-04-084-9/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the msvc pragmas section, bss_seg, code_seg, const_seg and data_seg as well as support for __declspec(allocate()). Additionally it corrects semantics and adds diagnostics for __attribute__((section())) and the interaction between the attribute and the msvc pragmas and declspec. In general conflicts should now be well diganosed within and among these features. In supporting the pragmas new machinery for uniform lexing for msvc pragmas was introduced. The new machinery always lexes the entire pragma and stores it on an annotation token. The parser is responsible for parsing the pragma when the handling the annotation token. There is a known outstanding bug in this implementation in C mode. Because these attributes and pragmas apply _only_ to definitions, we process them at the time we detect a definition. Due to tentative definitions in C, we end up processing the definition late. This means that in C mode, everything that ends up in a BSS section will end up in the _last_ BSS section rather than the one that was live at the time of tentative definition, even if that turns out to be the point of actual definition. This issue is not known to impact anything as of yet because we are not aware of a clear use or use case for #pragma bss_seg but should be fixed at some point. Differential Revision=http://reviews.llvm.org/D3065#inline-16241 llvm-svn: 205810
* Add support for MSVC's __FUNCSIG__Reid Kleckner2014-04-082-0/+2
| | | | | | | | | | | It is very similar to GCC's __PRETTY_FUNCTION__, except it prints the calling convention. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D3311 llvm-svn: 205780
* -fms-extensions: Error out on #pragma init_segReid Kleckner2014-04-031-0/+18
| | | | | | | | | | | | | By ignoring this pragma with a warning, we're essentially miscompiling the user's program. WebKit / Blink use this pragma to disable dynamic initialization and finalization of some static data, and running the dtors crashes the program. Error out for now, so that /fallback compiles the TU correctly with MSVC. This pragma should be implemented some time this month, and we can remove this hack. llvm-svn: 205554
* Render anonymous entities as '(anonymous <thing>)' (and lambdas as '(lambda ↵David Blaikie2014-04-021-1/+1
| | | | | | | | | | | | at ... )') For namespaces, this is consistent with mangling and GCC's debug info behavior. For structs, GCC uses <anonymous struct> but we prefer consistency between all anonymous entities but don't want to confuse them with template arguments, etc, so we'll just go with parens in all cases. llvm-svn: 205398
* Unify __declspec attribute argument parsing with the common attribute ↵Aaron Ballman2014-03-311-109/+51
| | | | | | | | argument parsing code. This removes a diagnostic that is no longer required (the semantic engine now properly handles attribute syntax so __declspec and __attribute__ spellings no longer get mismatched). This caused several testcases to need updating for a slightly different wording. llvm-svn: 205234
* Introduced an attribute syntax-neutral method for parsing attribute ↵Aaron Ballman2014-03-312-80/+113
| | | | | | arguments that is currently being used by GNU and C++-style attributes. This allows C++11 attributes with argument lists to be handled properly, fixing the "deprecated", "type_visibility", and capability-related attributes with arguments. llvm-svn: 205226
* [OPENMP] Implemented 'copyin' clauseAlexey Bataev2014-03-311-0/+1
| | | | llvm-svn: 205164
* MS asm: Filter out fpsw clobbersReid Kleckner2014-03-271-0/+5
| | | | | | | | | | | | | | | | When parsing MS inline assembly, we note that fpsw is an implicit def of most x87 FP operations, and add it to the clobber list. However, we don't recognize fpsw as a gcc register name, and we assert. Clang always adds an fpsr clobber, which means the same thing to LLVM, so we can just use that. This test case was broken by my LLVM change r196939. Reviewers: echristo Differential Revision: http://llvm-reviews.chandlerc.com/D2993 llvm-svn: 204878
* Objective-C. Improve diagnostic error for '@import' Fariborz Jahanian2014-03-261-3/+3
| | | | | | when modules are disabled. // rdar://15505492 llvm-svn: 204862
* Cleanup dead assignments reported by scan-buildArnaud A. de Grandmaison2014-03-231-2/+2
| | | | llvm-svn: 204569
* [OPENMP] parsing of clause 'safelen' (for directive 'omp simd')Alexey Bataev2014-03-211-1/+11
| | | | llvm-svn: 204428
* Fix crash if delayed template parsing meets an erroneous trailing return type.Richard Smith2014-03-121-24/+4
| | | | | | | Based on a patch and test by Stephan Tolksdorf! Refactoring and fixing adjacent brokenness by me. llvm-svn: 203733
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-127-41/+41
| | | | | | class. llvm-svn: 203641
* Allow GNU-style attributes on lambda expressions.Aaron Ballman2014-03-121-3/+12
| | | | llvm-svn: 203628
* Gracefully handle an attribute specifier following a lambda introducer when ↵Aaron Ballman2014-03-111-6/+18
| | | | | | the parameter list wasn't present. llvm-svn: 203565
* [C++11] Replace OwningPtr include with <memory>.Ahmed Charles2014-03-091-1/+1
| | | | llvm-svn: 203389
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-073-16/+17
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* [OPENMP] Clause 'num_threads'Alexey Bataev2014-03-061-0/+2
| | | | llvm-svn: 203087
* Remove dead return in Parser::MayBeDesignationStart().Ted Kremenek2014-03-061-2/+0
| | | | llvm-svn: 203078
OpenPOWER on IntegriCloud