summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow address space qualifiers on OpenCL array parametersFraser Cormack2014-04-151-2/+6
| | | | llvm-svn: 206275
* Improve error recovery around colon.Serge Pavlov2014-04-131-4/+3
| | | | | | | | | | 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
* [MS-ABI] Add support for #pragma section and related pragmasWarren Hunt2014-04-081-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix clang-tidy warning (argument comments don't match parameter names).Richard Smith2014-04-071-3/+3
| | | | llvm-svn: 205715
* PR19305: Don't issue -Wunused-variable warnings on variable templates. It's notRichard Smith2014-04-021-2/+4
| | | | | | | | | | | meaningful to odr-use the VarDecl inside a variable template. (Separately, it'd be nice to track referenced-ness for templates, and warn on unused ones, but that's really a distinct issue...) Move a test that generates and tests a warning-suppressing error out to its own test file, so it doesn't have weird effects on the other tests in the same file. llvm-svn: 205448
* Sema: Require external linkage for dll attributesNico Rieck2014-03-311-0/+16
| | | | llvm-svn: 205198
* Sema: Check dll attributes on redeclarationsNico Rieck2014-03-311-11/+62
| | | | | | | A redeclaration may not add dllimport or dllexport attributes. dllexport is sticky and can be omitted on redeclarations while dllimport cannot. llvm-svn: 205197
* Enforce the restriction that a parameter to a kernel functionDavid Tweed2014-03-271-2/+15
| | | | | | | | | cannot be a pointer to the private address space (as clarified in the OpenCL 1.2 specification). Patch by Fraser Cormack! llvm-svn: 204941
* PR19252: Fix crash if alignas is used with an auto-typed variable. Don't checkRichard Smith2014-03-271-4/+3
| | | | | | the type of the variable until it's known. llvm-svn: 204887
* Treat dllimport globals without explicit storage class as externNico Rieck2014-03-231-0/+38
| | | | | | | dllimport implies a definition which means the 'extern' keyword is optional when declaring imported variables. llvm-svn: 204576
* [C++11] Replacing Scope iterators decl_begin() and decl_end() with ↵Aaron Ballman2014-03-171-3/+1
| | | | | | iterator_range decls(). Updating all of the usages of the iterators with range-based for loops, and removing the no-longer-needed iterator versions. llvm-svn: 204052
* [C++11] Replacing FunctionProtoType iterators param_type_begin() and ↵Aaron Ballman2014-03-171-16/+7
| | | | | | param_type_end() with iterator_range param_types(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 204045
* Objective-C. Redo turning off designated initialization warnings onFariborz Jahanian2014-03-141-5/+10
| | | | | | | | 'init' methods which are unavailable. Subclasses of NSObject have to implement such methods as a common pattern to prevent user's own implementation. // rdar://16305460 llvm-svn: 203984
* [C++11] Removing the found_decls_begin() and found_decls_end() APIs and ↵Aaron Ballman2014-03-141-3/+2
| | | | | | replacing with a range-only found_decls() API. llvm-svn: 203975
* [C++11] Replacing ObjCInterfaceDecl iterators known_extensions_begin() and ↵Aaron Ballman2014-03-131-4/+1
| | | | | | known_extensions_end() with iterator_range known_extensions(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203857
* [C++11] Replacing CXXRecordDecl iterators capture_begin() and capture_end() ↵Aaron Ballman2014-03-131-10/+9
| | | | | | with iterator_range captures(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203817
* [C++11] Replacing CXXRecordDecl iterators bases_begin() and bases_end() with ↵Aaron Ballman2014-03-131-3/+2
| | | | | | iterator_range bases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203803
* Fix crash if delayed template parsing meets an erroneous trailing return type.Richard Smith2014-03-121-0/+24
| | | | | | | Based on a patch and test by Stephan Tolksdorf! Refactoring and fixing adjacent brokenness by me. llvm-svn: 203733
* DR1346: a parenthesized braced-init-list cannot be used as the initializer whenRichard Smith2014-03-121-0/+5
| | | | | | performing auto type deduction. llvm-svn: 203683
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-121-2/+2
| | | | | | class. llvm-svn: 203640
* [C++11] Replacing DeclBase iterators specific_attr_begin() and ↵Aaron Ballman2014-03-101-27/+15
| | | | | | specific_attr_end() with iterator_range specific_attrs(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203474
* [C++11] Replacing Decl iterators attr_begin() and attr_end() with ↵Aaron Ballman2014-03-081-9/+6
| | | | | | | | iterator_range attrs(). Updating all of the usages of the iterators with range-based for loops. This is a reapplication of r203236 with modifications to the definition of attrs() and following the new style guidelines on auto usage. llvm-svn: 203362
* [C++11] Replacing RecordDecl iterators field_begin() and field_end() with ↵Aaron Ballman2014-03-081-3/+1
| | | | | | iterator_range fields(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203355
* [C++11] Replacing EnumDecl iterators enumerator_begin() and enumerator_end() ↵Aaron Ballman2014-03-081-4/+3
| | | | | | with iterator_range enumerators(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203353
* [C++11] Replacing DeclBase iterators decls_begin() and decls_end() with ↵Aaron Ballman2014-03-071-30/+22
| | | | | | iterator_range decls(). The same is true for the noload versions of these APIs. Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203278
* Renaming the chains() ranged iterator to chain() per suggestion by Richard ↵Aaron Ballman2014-03-071-1/+1
| | | | | | Smith. llvm-svn: 203262
* [C++11] Replacing IndirectFieldDecl iterators chain_begin() and chain_end() ↵Aaron Ballman2014-03-071-3/+2
| | | | | | with iterator_range chains(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203261
* [C++11] Replacing FunctionDecl iterators param_begin() and param_end() with ↵Aaron Ballman2014-03-071-6/+2
| | | | | | iterator_range params(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203248
* Fully reverting r203236 -- it seems the only bots that are happy are the ↵Aaron Ballman2014-03-071-6/+9
| | | | | | MSVC bots. llvm-svn: 203237
* [C++11] Replacing iterators attr_begin() and attr_end() with iterator_range ↵Aaron Ballman2014-03-071-9/+6
| | | | | | attrs(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203236
* [C++11] Replacing iterators redecls_begin() and redecls_end() with ↵Aaron Ballman2014-03-061-6/+3
| | | | | | iterator_range redecls(). Updating all of the usages of the iterators with range-based for loops, which allows the begin/end forms to be removed entirely. llvm-svn: 203179
* Tests for DR370-380.Richard Smith2014-03-051-2/+2
| | | | | | | Also promote a couple of Warnings on ill-formed code found by this testing to ExtWarns. llvm-svn: 203021
* AST: Remove layering violation with SemaDavid Majnemer2014-03-051-4/+8
| | | | | | Scope lives in Sema and cannot be used in AST. Shuffle things around. llvm-svn: 202993
* [-cxx-abi microsoft] Implement local manglings accuratelyDavid Majnemer2014-03-051-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The MSVC ABI appears to mangle the lexical scope into the names of statics. Specifically, a counter is incremented whenever a scope is entered where things can be declared in such a way that an ambiguity can arise. For example, a class scope inside of a class scope doesn't do anything interesting because the nested class cannot collide with another nested class. There are problems with this scheme: - It is unreliable. The counter is only incremented when a previously never encountered scope is entered. There are cases where this will cause ambiguity amongst declarations that have the same name where one was introduced in a deep scope while the other was introduced right after in the previous lexical scope. - It is wasteful. Statements like: {{{{{{{ static int foo = a; }}}}}}} will make the mangling of "foo" larger than it need be because the scope counter has been incremented many times. Because of these problems, and practical implementation concerns. We choose not to implement this scheme if the local static or local type isn't visible. The mangling of these declarations will look very similar but the numbering will make far more sense, this scheme is lifted from the Itanium ABI implementation. Reviewers: rsmith, doug.gregor, rnk, eli.friedman, cdavis5x Reviewed By: rnk CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2953 llvm-svn: 202951
* Add [extern_c] attribute for modules, allowing a C module to be imported ↵Richard Smith2014-03-021-1/+35
| | | | | | within an extern "C" block in C++ code. llvm-svn: 202615
* argument -> parameter terminology fixes for FunctionTypeInfoAlp Toker2014-02-261-20/+19
| | | | | | This is a continuation of r199686. llvm-svn: 202307
* Sema: Definition of dllimport globals is not allowedNico Rieck2014-02-261-0/+7
| | | | | | | Upgrades the warning to an error and clarifies the message by treating the definition as error instead of the attribute. llvm-svn: 202300
* [Win32 ABI] Defer operator delete checks until vtable is marked usedHans Wennborg2014-02-241-9/+0
| | | | | | | | | | We were previously checking at every destructor declaration, but that was a bit excessive. Since the deleting destructor is emitted with the vtable, do the check when the vtable is marked used. Differential Revision: http://llvm-reviews.chandlerc.com/D2851 llvm-svn: 202046
* Do not add enums to prototype scope in C++ modes.Peter Collingbourne2014-02-221-23/+7
| | | | | | | | | | | | | | The language forbids defining enums in prototypes, so this check is normally redundant, but if an enum is defined during template instantiation it should not be added to the prototype scope. While at it, clean up the code that deals with tag definitions in prototype scope and expand the visibility warning to cover the case where an anonymous enum is defined. Differential Revision: http://llvm-reviews.chandlerc.com/D2742 llvm-svn: 201927
* OpenCL: fix for the restriction on pointers to functions.Pekka Jaaskelainen2014-02-201-6/+19
| | | | | | Patch from Anastasia Stulova! llvm-svn: 201788
* Implement DR577David Majnemer2014-02-191-17/+0
| | | | | | | | DR18 previously forebode typedefs to be used as parameter types if they were of type 'void'. DR577 allows 'void' to be used as a function parameter type regardless from where it came. llvm-svn: 201631
* Enable correcting a member declaration where the type is class template,Kaelyn Uhrain2014-02-131-9/+15
| | | | | | | | | and the class name is shadowed by another member. Recovery still needs to be figured out, which is non-trivial since the parser has already gone down a much different path than if it had recognized the class template as type instead of seeing the member that shadowed the class template. llvm-svn: 201360
* MS ABI: Add support for #pragma pointers_to_membersDavid Majnemer2014-02-101-2/+3
| | | | | | | | | | | | | | | | | | | Introduce a notion of a 'current representation method' for pointers-to-members. When starting out, this is set to 'best case' (representation method is chosen by examining the class, selecting the smallest representation that would work given the class definition or lack thereof). This pragma allows the translation unit to dictate exactly what representation to use, similar to how the inheritance model keywords operate. N.B. PCH support is forthcoming. Differential Revision: http://llvm-reviews.chandlerc.com/D2723 llvm-svn: 201105
* Clarify comment. Remove braces from single-statement block.David Blaikie2014-02-091-4/+4
| | | | llvm-svn: 201040
* MS ABI: Don't be so hasty to judge an inheritance modelDavid Majnemer2014-02-071-1/+1
| | | | | | | | If we are in the middle of defining the class, don't attempt to validate previously annotated declarations. We may not have seen base specifiers or virtual method declarations yet. llvm-svn: 200959
* DR101, PR12770: If a function is declared in the same context as aRichard Smith2014-02-061-12/+28
| | | | | | | | using-declaration, and they declare the same function (either because the using-declaration is in the same namespace as the declaration it imports, or because they're both extern "C"), they do not conflict. llvm-svn: 200897
* Add implicit declarations of allocation functions when looking them up forRichard Smith2014-02-041-13/+16
| | | | | | | | redeclaration, not just when looking them up for a use -- we need the implicit declaration to appropriately check various properties of them (notably, whether they're deleted). llvm-svn: 200729
* Diagnose typedef names for linkage purposes that would changeJohn McCall2014-01-301-0/+21
| | | | | | | | | | | | | | a previously-computed linkage as an unsupportable error condition. Per discussion on cfe-commits, this appears to be a difficult-to-resolve flaw in our implementation approach; we may pursue this as a language defect, but for now it's better to diagnose it as unsupported than to produce inconsistent results (or assertions). Anything that we can do to limit how often this diagnostic fires, such as the changes in r200380, is probably for the best, though. llvm-svn: 200438
* Sema: Diagnose improper application of inheritance keywordsDavid Majnemer2014-01-291-1/+10
| | | | | | | | | | | We would previously allow inappropriate inheritance keywords to appear on class declarations. We would also allow inheritance keywords on templates which were not fully specialized; this was divergent from MSVC. Differential Revision: http://llvm-reviews.chandlerc.com/D2585 llvm-svn: 200423
* Short-circuit a couple of queries (and avoid corruptingJohn McCall2014-01-291-1/+7
| | | | | | | | | | | | | | the linkage cache) when type-checking static local variables. There's a very deep problem here where the linkage of a declaration can suddenly massively change as soon as it's given a typedef name; these fixes, while optimizations in their own right, are really just targeted workarounds. rdar://15928125 llvm-svn: 200380
OpenPOWER on IntegriCloud