summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/Parser.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Forward #pragma comment(lib/linker) through as flags metadataReid Kleckner2013-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: Most of this change is wiring the pragma all the way through from the lexer, parser, and sema to codegen. I considered adding a Decl AST node for this, but it seemed too heavyweight. Mach-O already uses a metadata flag called "Linker Options" to do this kind of auto-linking. This change follows that pattern. LLVM knows how to forward the "Linker Options" metadata into the COFF .drectve section where these flags belong. ELF support is not implemented, but possible. This is related to auto-linking, which is http://llvm.org/PR13016. CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D723 llvm-svn: 181426
* Move PragmaCommentHandler to lib/Parse in preparation for calling SemaReid Kleckner2013-05-061-0/+10
| | | | | | | | | | | | | | Summary: No functionality change. The existing tests for this pragma only verify that we can preprocess it. Reviewers: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D751 llvm-svn: 181246
* Parsing support for thread_local and _Thread_local. We give them the sameRichard Smith2013-04-121-2/+2
| | | | | | semantics as __thread for now. llvm-svn: 179424
* OpenMP threadprivate directive parsing and semantic analysisAlexey Bataev2013-03-221-0/+10
| | | | llvm-svn: 177705
* [Sema] Semantic analysis for empty-declaration and attribute-declaration.Michael Han2013-02-221-8/+4
| | | | | | | | Introduce a new AST Decl node "EmptyDecl" to model empty-declaration. Have attributes from attribute-declaration appertain to the EmptyDecl node by creating the AST representations of these attributes and attach them to the EmptyDecl node so these attributes can be sema checked just as attributes attached to "normal" declarations. llvm-svn: 175900
* Add -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,Richard Smith2013-02-221-1/+3
| | | | | | | | | | | to control the check for the C 5.2.4.1 / C++ [implimits] restriction on nesting levels for parentheses, brackets and braces. Some code with heavy macro use exceeds the default limit of 256, but we don't want to increase it generally to avoid stack overflow on stack-constrained systems. llvm-svn: 175855
* Process and handle attributes on conditions and for loop variables. Process andRichard Smith2013-02-201-2/+10
| | | | | | | diagnose attributes on alias declarations, using directives, and attribute declarations. llvm-svn: 175649
* Finish semantic analysis for [[carries_dependency]] attribute.Richard Smith2013-01-281-1/+2
| | | | | | | | | | This required plumbing through a new flag to determine whether a ParmVarDecl is actually a parameter of a function declaration (as opposed to a function typedef etc, where the attribute is prohibited). Weirdly, this attribute (just like [[noreturn]]) cannot be applied to a function type, just to a function declaration (and its parameters). llvm-svn: 173726
* Implement C++11 semantics for [[noreturn]] attribute. This required splittingRichard Smith2013-01-171-1/+2
| | | | | | | | it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as affecting the function type, whereas [[noreturn]] does not). llvm-svn: 172691
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-1/+1
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Remove the unused Parser::ParseTranslationUnit functionHal Finkel2013-01-091-15/+0
| | | | | | | Parser::ParseTranslationUnit is now dead because the loop over ParseTopLevelDecl is in ParseAST. llvm-svn: 172005
* s/CXX0X/CXX11/g, except for __GNU_EXPERIMENTAL_CXX0X__, and update a few ↵Richard Smith2013-01-021-2/+2
| | | | | | nearby 'C++0x' comments. llvm-svn: 171372
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-4/+4
| | | | llvm-svn: 171367
* Minor cleanup.Rafael Espindola2012-12-291-5/+1
| | | | | | | | DS parameter has a default (null) value anyway, so there's no need for an if/else here. Patch by Nikola Smiljanić. llvm-svn: 171210
* Use @import rather than @__experimental_modules_import, since theDouglas Gregor2012-12-111-1/+1
| | | | | | latter is rather a mess to type. llvm-svn: 169919
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-5/+5
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Move PrettyStackTraceParserEntry to ParseAST.cppNico Weber2012-11-271-23/+0
| | | | | | | r128056 moved PrettyStackTraceParserEntry construction from Parser.h to ParseAST.cpp, so there's no need to keep this class in a header. llvm-svn: 168731
* Made the "expected string literal" diagnostic more expressiveAndy Gibbs2012-11-171-1/+2
| | | | llvm-svn: 168267
* PR12713 - crash on invalid due to unmatched parens in decltypeDavid Blaikie2012-11-071-2/+2
| | | | llvm-svn: 167547
* Have the parser initialize Sema before it consumes the firstDouglas Gregor2012-11-051-3/+5
| | | | | | | | token. This is important because the first token could actually be after an #include that triggers a module import, which might use either Sema or the AST consumer before it would have been initialized. llvm-svn: 167423
* Decouple code-completion for the SkipFunctionBodies frontend option andArgyrios Kyrtzidis2012-10-311-2/+3
| | | | | | add a test to make sure code-completion skips bodies. llvm-svn: 167141
* Currently the initial value of Tok is dependent an the stack contentsChris Lattner2012-10-271-0/+1
| | | | | | | | and could cause the Parser to crash on the first ConsumeToken(). Patcy by Bas van den Berg! llvm-svn: 166891
* Reverted back the changes made in 166868 and in 166869Mahesha S2012-10-271-234/+0
| | | | llvm-svn: 166871
* Feature:Mahesha S2012-10-271-0/+235
| | | | | | | | | | | | | | | | | | | | | OpenMP support. Sub-Feature: Support for "#pragma omp ..." registration with Preprocessor. Files Changed/Added: * include/clang/Basic/DiagnosticGroups.td (C) * include/clang/Basic/DiagnosticParseKinds.td (C) * include/clang/Basic/TokenKinds.def (C) * include/clang/Parse/Parser.h (C) * lib/Parse/Parser.cpp (C) Test Cases Changed/Added: * test/Preprocessor/pragma_omp.c (A) * test/Preprocessor/pragma_omp_ignored_warning.c (A) llvm-svn: 166869
* Permanently end the whole "pragma got handled by the parser too early"Eli Friedman2012-10-041-10/+31
| | | | | | | mess by handling all pragmas which the parser touches uniformly. <rdar://problem/12248901>, etc. llvm-svn: 165195
* If a comma operator is followed by a token which unambiguously indicates theRichard Smith2012-09-181-1/+2
| | | | | | | | start of a statement or the end of a compound-statement, diagnose the comma as a typo for a semicolon. Patch by Ahmed Bougacha! Additional test cases and minor refactoring by me. llvm-svn: 164085
* Now that ASTMultiPtr is nothing more than a array reference, make it a ↵Benjamin Kramer2012-08-231-11/+4
| | | | | | | | MutableArrayRef. This required changing all get() calls to data() and using the simpler constructors. llvm-svn: 162501
* Remove ASTOwningVector, it doesn't own anything and provides no value over ↵Benjamin Kramer2012-08-231-4/+4
| | | | | | SmallVector. llvm-svn: 162492
* Rip out remnants of move semantic emulation and smart pointers in Sema.Benjamin Kramer2012-08-231-3/+3
| | | | | | | These were nops for quite a while and only lead to confusion. ASTMultiPtr now behaves like a proper dumb array reference. llvm-svn: 162475
* Fix a bunch of -Wdocumentation warnings.Dmitri Gribenko2012-08-231-1/+1
| | | | llvm-svn: 162452
* PR41111, PR5925, PR13210: Teach tentative parsing to annotate identifiers andRichard Smith2012-08-181-29/+151
| | | | | | | | | | | | | | | | | nested names as id-expressions, using the annot_primary_expr annotation, where possible. This removes some redundant lookups, and also allows us to typo-correct within tentative parsing, and to carry on disambiguating past an identifier which we can determine will fail lookup as both a type and as a non-type, allowing us to disambiguate more declarations (and thus offer improved error recovery for such cases). This also introduces to the parser the notion of a tentatively-declared name, which is an identifier which we *might* have seen a declaration for in a tentative parse (but only if we end up disambiguating the tokens as a declaration). This is necessary to correctly disambiguate cases where a variable is used within its own initializer. llvm-svn: 162159
* Removed an unused function I added a while back.Fariborz Jahanian2012-08-101-21/+0
| | | | llvm-svn: 161714
* objective-C++: dalyed parsing of ctors with memberFariborz Jahanian2012-08-101-2/+3
| | | | | | | initializer list defined inside an objc class implementation. wip llvm-svn: 161699
* objective-C++: delayed parsing of member function withFariborz Jahanian2012-08-101-1/+2
| | | | | | | function-try-block occuring in objc's implementation block. wip. llvm-svn: 161675
* objective-C++: Delayed parsing of most commonFariborz Jahanian2012-08-101-1/+20
| | | | | | | member functions defined inside an objc class implementation. wip. llvm-svn: 161667
* Add diagnostics for comma at end of enum and for extra semicolon at namespaceRichard Smith2012-07-231-11/+20
| | | | | | | | scope to -Wc++11-extensions. Move extra semicolon after member function definition diagnostic out of -pedantic, since C++ allows a single semicolon there. Keep it in -Wextra-semi, though, since it's still questionable. llvm-svn: 160618
* Allow the parser to recover gracefully if a typename is used to introduce a ↵Francois Pichet2012-07-221-3/+5
| | | | | | | | | | decltype type. In Microsoft mode, we emit a warning instead of an error. This fixes a couple of errors when parsing the MSVC 11 RC headers with clang. llvm-svn: 160613
* Move helper class into an anonymous namespace.Benjamin Kramer2012-07-131-0/+2
| | | | llvm-svn: 160172
* Better parser recovery in Objective-C containers.Jordan Rose2012-07-091-1/+1
| | | | | | | | | | | | | | Previously it was possible to get an infinite-loop-on-invalid with a namespace decl within @interface. Since 'namespace' is normally a safe place to retry top-level parsing, we just didn't consume the token. This adds a flag that tracks whether we have temporarily left Objective-C scope to parse a C-like declaration, and uses that to better recover from parse problems by stopping at possible method declarations and at @end. To fix the original problem, we do /not/ stop at 'namespace' when in an Objective-C @interface or @protocol context (but still do in @implementation). llvm-svn: 159941
* Added a new memberfor Parser, to be used soonFariborz Jahanian2012-07-061-0/+21
| | | | | | | for doing delayed parsing of c++ method defined in objc class implementations. llvm-svn: 159792
* objective-c++ parsing. Turn off delayed parsingFariborz Jahanian2012-07-051-3/+1
| | | | | | | | | of out-of-line c++ method definition which happens to be inside an objc class implementation until I can figure out how to do it. This is to fix a broken project. llvm-svn: 159772
* Obj-C++11 parser: fix broken parsing of c-functionFariborz Jahanian2012-07-031-1/+0
| | | | | | defined in class implementations. llvm-svn: 159691
* Obj-C++11 parser: turn off buffering ofFariborz Jahanian2012-07-031-0/+1
| | | | | | | c-function defined in objc class implementation for now. llvm-svn: 159690
* objective-c: just as we have done for method definitions,Fariborz Jahanian2012-07-021-2/+4
| | | | | | | | c-functions declared in implementation should have their parsing delayed until the end so, they can access forward declared private methods. // rdar://10387088 llvm-svn: 159626
* Support the use of "=delete" and "=default" with delayed templateDouglas Gregor2012-06-281-0/+1
| | | | | | parsing. Fixes <rdar://problem/11700604>. llvm-svn: 159380
* Clean up a large number of C++11 attribute parse issues, including parsingAlexis Hunt2012-06-231-13/+20
| | | | | | | | | | | | | | | | | | attributes in more places where we didn't and catching a lot more issues. This implements nearly every aspect of C++11 attribute parsing, except for: - Attributes are permitted on explicit instantiations inside the declarator (but not preceding the decl-spec) - Attributes are permitted on friend declarations of functions. - Multiple instances of the same attribute in an attribute-list (e.g. [[noreturn, noreturn]], not [[noreturn]] [[noreturn]] which is conforming) are allowed. The first two are marked as expected-FIXME in the test file and the latter is probably a defect and is currently untested. Thanks to Richard Smith for providing the lion's share of the testcases. llvm-svn: 159072
* Unbreak GCC build: GCC doesn't like clang::Parser::CommentHandler and class ↵Dmitri Gribenko2012-06-201-3/+3
| | | | | | clang::CommentHandler to have same name. llvm-svn: 158780
* Structured comment parsing, first step.Dmitri Gribenko2012-06-201-1/+21
| | | | | | | | | * Retain comments in the AST * Serialize/deserialize comments * Find comments attached to a certain Decl * Expose raw comment text and SourceRange via libclang llvm-svn: 158771
* Whenever we have a BalancedDelimiterTracker, we have a 'nested' scopeDouglas Gregor2012-06-061-4/+4
| | | | | | | where '>' is going to behave as an operator (and not as a '>' closing a template argument list). llvm-svn: 158111
* Remove unused private member variables found by clang's new ↵Benjamin Kramer2012-06-061-4/+3
| | | | | | -Wunused-private-field. llvm-svn: 158086
OpenPOWER on IntegriCloud