summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/DeclSpec.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [OpenCL] Generic address space has been added in OpenCL v2.0.Anastasia Stulova2014-11-261-2/+2
| | | | | | | | | | To support it in the frontend, the following has been added: - generic address space type attribute; - documentation for the OpenCL address space attributes; - parsing of __generic(generic) keyword; - test code for the parser and diagnostics. llvm-svn: 222831
* PR21437, final part of DR1330: delay-parsing of exception-specifications. ThisRichard Smith2014-11-131-0/+8
| | | | | | | is a re-commit of Doug's r154844 (modernized and updated to fit into current Clang). llvm-svn: 221918
* [PowerPC] Initial VSX intrinsic support, with min/max for vector doubleBill Schmidt2014-10-311-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have initial support for VSX, we can begin adding intrinsics for programmer access to VSX instructions. This patch performs the necessary enablement in the front end, and tests it by implementing intrinsics for minimum and maximum using the vector double data type. The main change in the front end is to no longer disallow "vector" and "double" in the same declaration (lib/Sema/DeclSpec.cpp), but "vector" and "long double" must still be disallowed. The new intrinsics are accessed via vec_max and vec_min with changes in lib/Headers/altivec.h. Note that for v4f32, we already access corresponding VMX builtins, but with VSX enabled we should use the forms that allow all 64 vector registers. The new built-ins are defined in include/clang/Basic/BuiltinsPPC.def. I've added a new test in test/CodeGen/builtins-ppc-vsx.c that is similar to, but much smaller than, builtins-ppc-altivec.c. This allows us to test VSX IR generation without duplicating CHECK lines for the existing bazillion Altivec tests. Since vector double is now legal when VSX is available, I've modified the error message, and changed where we test for it and for vector long double, since the target machine isn't visible in the old place. This serendipitously removed a not-pertinent warning about 'long' being deprecated when used with 'vector', when "vector long double" is encountered and we just want to issue an error. The existing tests test/Parser/altivec.c and test/Parser/cxx-altivec.cpp have been updated accordingly, and I've added test/Parser/vsx.c to verify that "vector double" is now legitimate with VSX enabled. There is a companion patch for LLVM. llvm-svn: 220989
* Add RestrictQualifierLoc to DeclaratorChunk::FunctionTypeInfoHal Finkel2014-10-201-0/+3
| | | | | | | | | | | | | | Clang supports __restrict__ as a function qualifier, but DeclaratorChunk::FunctionTypeInfo lacked a field to track the qualifier's source location (as we do with volatile, etc.). This was the subject of a FIXME in GetFullTypeForDeclarator (in SemaType.cpp). This should also prove useful as we add more warnings regarding questionable uses of the restrict qualifier. There is no significant functional change (except for an improved source range associated with the err_invalid_qualified_function_type diagnostic fixit generated by GetFullTypeForDeclarator). llvm-svn: 220215
* -ms-extensions: Implement __super scope specifier (PR13236).Nikola Smiljanic2014-09-261-0/+12
| | | | | | | | | We build a NestedNameSpecifier that records the CXXRecordDecl in which __super appeared. Name lookup is performed in all base classes of the recorded CXXRecordDecl. Use of __super is allowed only inside class and member function scope. llvm-svn: 218484
* Move __vector long deprecation checking into DeclSpec::FinishHal Finkel2014-08-241-6/+3
| | | | | | | | | | | | __vector long is deprecated, but __vector long long is not. As a result, we cannot check for __vector long (to issue the deprecation warning) as we parse the type because we need to know how many 'long's we have first. DeclSpec::Finish seems like a more-appropriate place to perform the check (which places it with several other similar Altivec vector checks). Fixes PR20720. llvm-svn: 216342
* [C++11] Use 'nullptr'.Craig Topper2014-06-091-6/+6
| | | | llvm-svn: 210448
* Sema: Implement DR477David Majnemer2014-04-301-2/+29
| | | | | | | | | | | | Summary: Friend declarations shouldn't mention explicit or virtual. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3562 llvm-svn: 207682
* argument -> parameter terminology fixes for FunctionTypeInfoAlp Toker2014-02-261-14/+14
| | | | | | This is a continuation of r199686. llvm-svn: 202307
* Fix for PR9812: warn about bool instead of _Bool.Erik Verbruggen2014-01-151-33/+45
| | | | llvm-svn: 199311
* Downgrade bogus ExtWarn on duplicate 'friend' specifier to a Warning, and add aRichard Smith2014-01-101-2/+13
| | | | | | Warning for a duplicate 'constexpr' specifier. llvm-svn: 198956
* Remove OpenCL-specific type keywords and specifiersAlp Toker2013-12-181-16/+0
| | | | | | | | | | | | | | | This commit kills off custom type specifier and keyword handling of OpenCL C data types. Although the OpenCL spec describes them as keywords, we can handle them more elegantly as predefined types. This should provide better error correction and code completion as well as simplifying the implementation. The primary intention is however to simplify the C/C++ parser and save some packed bits on AST structures that had been extended in r170432 just for OpenCL. llvm-svn: 197578
* PR9547: If we're parsing a simple-declaration that contains a tag definition,Richard Smith2013-11-191-0/+6
| | | | | | | | and we see an ill-formed declarator that would probably be well-formed if the tag definition were just missing a semicolon, use that as the diagnostic instead of producing some other mysterious error. llvm-svn: 195163
* Warn on duplicate function specifierSerge Pavlov2013-11-131-12/+56
| | | | | | | | | This patch fixes PR8264. Duplicate qualifiers already are diagnozed, now the same diagnostics is issued for duplicate function specifiers. Differential Revision: http://llvm-reviews.chandlerc.com/D2025 llvm-svn: 194559
* [-fms-extensions] Permit 'override' in C++98 and 'sealed' as a synonym for ↵David Majnemer2013-10-181-0/+2
| | | | | | | | | | | | | | 'final' Summary: Some MS headers use these features. Reviewers: rnk, rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1948 llvm-svn: 192936
* [ms-cxxabi] Fix the calling convention for operator new in recordsReid Kleckner2013-10-081-0/+8
| | | | | | | | | | | | | | | | | | Summary: Operator new, new[], delete, and delete[] are all implicitly static when declared inside a record. CXXMethodDecl already knows this, but we need to account for that before we pick the calling convention for the function type. Fixes PR17371. Reviewers: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1761 llvm-svn: 192150
* "bool" should be a context-sensitive keyword in Altivec mode.Bill Schmidt2013-07-031-0/+14
| | | | | | | | | | | | | | | | | PR16456 reported that Clang implements a hybrid between AltiVec's "Keyword and Predefine Method" and its "Context Sensitive Keyword Method," where "bool" is always a keyword, but "vector" and "pixel" are context-sensitive keywords. This isn't permitted by the AltiVec spec. For consistency with gcc, this patch implements the Context Sensitive Keyword Method for bool, and stops treating true and false as keywords in Altivec mode. The patch removes KEYALTIVEC as a trigger for defining these keywords in include/clang/Basic/TokenKinds.def, and adds logic for "vector bool" that mirrors the existing logic for "vector pixel." The test case is taken from the bug report. llvm-svn: 185580
* Don't mark a type specifier as "owned" if there is no declaration to own.Douglas Gregor2013-05-141-1/+1
| | | | | | | This simplifies error recovery elsewhere, eliminating the crash in <rdar://problem/13853540>. llvm-svn: 181846
* Fix PR15845: apparently MSVC does not support implicit int in C++ mode.Richard Smith2013-04-301-2/+1
| | | | llvm-svn: 180822
* Silence a silly sign compare warning from GCC.Benjamin Kramer2013-04-271-1/+1
| | | | llvm-svn: 180673
* Implement C++1y decltype(auto).Richard Smith2013-04-261-2/+41
| | | | llvm-svn: 180610
* Parsing support for thread_local and _Thread_local. We give them the sameRichard Smith2013-04-121-16/+64
| | | | | | semantics as __thread for now. llvm-svn: 179424
* Add 178663 back.Rafael Espindola2013-04-031-11/+1
| | | | | | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green before it processed the reverted 178663, so it could not have been the culprit. Revert "Revert 178663." This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41. llvm-svn: 178682
* Revert 178663.Rafael Espindola2013-04-031-1/+11
| | | | | | | | | | Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb Revert "Don't compute a patched/semantic storage class." This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05. llvm-svn: 178681
* Don't compute a patched/semantic storage class.Rafael Espindola2013-04-031-11/+1
| | | | | | | | | | | For variables and functions clang used to store two storage classes. The one "as written" in the code and a patched one, which, for example, propagates static to the following decls. This apparently is from the days clang lacked linkage computation. It is now redundant and this patch removes it. llvm-svn: 178663
* Support C11 _Atomic type qualifier. This is more-or-less just syntactic ↵Richard Smith2013-03-281-5/+11
| | | | | | sugar for the _Atomic type specifier. llvm-svn: 178210
* Add OpenCL samplers as Clang builtin types and check sampler related ↵Guy Benyei2013-02-071-0/+2
| | | | | | restrictions. llvm-svn: 174601
* Implement OpenCL event_t as Clang builtin type, including event_t related ↵Guy Benyei2013-01-201-0/+2
| | | | | | OpenCL restrictions (OpenCL 1.2 spec 6.9) llvm-svn: 172973
* Parsing support for C11's _Noreturn keyword. No semantics yet.Richard Smith2013-01-171-1/+9
| | | | llvm-svn: 172761
* Fix Cast CodeDavid Greene2013-01-151-2/+3
| | | | | | | Eliminate a cast and resulting cast-qual warning by using a temporary as the target of memcpy. llvm-svn: 172557
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-2/+2
| | | | llvm-svn: 171367
* Add comments back that were accidentally removed in r170933.Chad Rosier2012-12-211-0/+2
| | | | llvm-svn: 170938
* Remove unused arguments and rename to conform to coding standards.Chad Rosier2012-12-211-8/+3
| | | | llvm-svn: 170933
* Re-commit r170428 changes with Linux style file endings.Guy Benyei2012-12-181-0/+12
| | | | | | Add OpenCL images as clang builtin types. llvm-svn: 170432
* Revert changes from r170428, as I accidentally changed the line endings of ↵Guy Benyei2012-12-181-12/+0
| | | | | | these files to Windows style. llvm-svn: 170431
* Add OpenCL images as clang builtin types.Guy Benyei2012-12-181-0/+12
| | | | llvm-svn: 170428
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-6/+6
| | | | | | | | | | | | | 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
* DR1528: C++11 doesn't allow repeated cv-qualifiers in declarators after all.Richard Smith2012-10-171-7/+5
| | | | llvm-svn: 166152
* Fixed FunctionTypeLoc source range.Abramo Bagnara2012-10-041-3/+7
| | | | llvm-svn: 165259
* Improved MSVC __interface support by adding first class support for it, ↵Joao Matos2012-08-311-0/+2
| | | | | | instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins. llvm-svn: 163013
* Reversing the logic since C99 mode is actually not an extension. Also, ↵Aaron Ballman2012-08-291-2/+2
| | | | | | changing the group to the singular to match the diagnostic better. llvm-svn: 162838
* Splitting the duplicated decl spec extension warning into two: one is an ↵Aaron Ballman2012-08-281-6/+16
| | | | | | ExtWarn and the other a vanilla warning. This addresses PR13705, where const char const * wouldn't warn unless -pedantic was specified under the right conditions. llvm-svn: 162793
* Improvements to vexing-parse warnings. Make the no-parameters case moreRichard Smith2012-07-301-0/+2
| | | | | | | | | | | | | accurate by asking the parser whether there was an ambiguity rather than trying to reverse-engineer it from the DeclSpec. Make the with-parameters case have better diagnostics by using semantic information to drive the warning, improving the diagnostics and adding a fixit. Patch by Nikola Smiljanic. Some minor changes by me to suppress diagnostics for declarations of the form 'T (*x)(...)', which seem to have a very high false positive rate, and to reduce indentation in 'warnAboutAmbiguousFunction'. llvm-svn: 160998
* Pedantic -pedantic correction. Duplicate cv-qualifiers are permitted in C++11Richard Smith2012-07-241-3/+5
| | | | | | unless they appear in a decl-specifier-seq. llvm-svn: 160688
* Reapply r158700 and fixup patches, minus one hunk that slipped through andAlexis Hunt2012-06-191-1/+1
| | | | | | | caused a crash in an obscure case. On the plus side, it caused me to catch another bug by inspection. llvm-svn: 158767
* Extend the support for cl-std to include 1.2.Tanya Lattner2012-06-191-3/+11
| | | | | | | Add error checking for the static qualifier which is now allowed in certain situations for OpenCL 1.2. Use the CL version to turn on this feature. Added test case for 1.2 static storage class feature. llvm-svn: 158759
* Revert r158700 and dependent patches r158716, r158717, and r158731.Jakob Stoklund Olesen2012-06-191-1/+1
| | | | | | | | The original r158700 caused crashes in the gcc test suite, g++.abi/vtable3a.C among others. It also caused failures in the libc++ test suite. llvm-svn: 158749
* Improve the specification of spellings in Attr.td.Alexis Hunt2012-06-191-1/+1
| | | | | | | | | | | | | | | | | Note that this is mostly a structural patch that handles the change from the old spelling style to the new one. One consequence of this is that all AT_foo_bar enum values have changed to not be based off of the first spelling, but rather off of the class name, so they are now AT_FooBar and the like (a straw poll on IRC showed support for this). Apologies for code churn. Most attributes have GNU spellings as a temporary solution until everything else is sorted out (such as a Keyword spelling, which I intend to add if someone else doesn't beat me to it). This is definitely a WIP. I've also killed BaseCheckAttr since it was unused, and I had to go through every attribute anyway. llvm-svn: 158700
* If parsing a trailing-return-type fails, don't pretend we didn't have one atRichard Smith2012-06-121-2/+4
| | | | | | all. Suppresses follow-on errors mentioned in PR13074. llvm-svn: 158348
* Inline a trivial clear() method.Benjamin Kramer2012-05-191-7/+0
| | | | llvm-svn: 157114
OpenPOWER on IntegriCloud