summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* PR15100: look through type sugar when determining whether we have one of theRichard Smith2013-01-291-1/+2
| | | | | | forms of 'main' which we accept as an extension. llvm-svn: 173758
* Actually remove the hack which was blocking the Borland-style attributes fromRichard Smith2013-01-291-7/+0
| | | | | | | working, and add the missing attribute spellings. This brings _pascal, _fastcall, _stdcall and _cdecl to life in -fborland-extensions mode. llvm-svn: 173749
* Replace AS_MSTypespec with AS_Keyword, for representing any attribute spelledRichard Smith2013-01-292-12/+5
| | | | | | | | | as a keyword. Rationalize existing attributes to use it as appropriate, and to not lie about some __declspec attributes being GNU attributes. In passing, remove a gross hack which was discarding attributes which we could handle. This results in us actually respecting the __pascal keyword again. llvm-svn: 173746
* Finish semantic analysis for [[carries_dependency]] attribute.Richard Smith2013-01-282-8/+56
| | | | | | | | | | 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
* Undo my re-wording of the "ARC forbids Objective-C objects in ..."Douglas Gregor2013-01-281-1/+1
| | | | | | error. Jordan is right. llvm-svn: 173713
* Forbid the use of objects in unions in Objective-C++ ARC. FixesDouglas Gregor2013-01-281-32/+30
| | | | | | <rdar://problem/13098104>. llvm-svn: 173708
* Tests and a minor bugfix for [dcl.attr.depend]p1 (C++11 [[carries_dependency]]Richard Smith2013-01-281-1/+1
| | | | | | attribute). llvm-svn: 173645
* Add a -pedantic warning: an anonymous union within an anonymous union is notRichard Smith2013-01-281-0/+6
| | | | | | | permitted in standard C++, despite being silently accepted by many (all?) major C++ implementations. llvm-svn: 173643
* Fix mismatch between pointer and pointee type when diagnosing an incorrectRichard Smith2013-01-261-3/+2
| | | | | | object argument type for a member call. llvm-svn: 173554
* Remove function that is newly dead as of r173538.Nick Lewycky2013-01-261-4/+0
| | | | llvm-svn: 173550
* Revert r172285 (suppressing a 'redundant' -Wc++98-compat warning) and add aRichard Smith2013-01-261-1/+0
| | | | | | testcase for a situation it caused us to miss. llvm-svn: 173540
* Preserve Sema::UndefinedInternals across PCH boundaries. FixesNick Lewycky2013-01-263-17/+15
| | | | | | -Wundefined-internal warnings with PCH. llvm-svn: 173538
* patch for PR9027 and // rdar://11861085Fariborz Jahanian2013-01-251-0/+4
| | | | | | | | | | | Title: [PR9027] volatile struct bug: member is not loaded at -O; This is caused by last flag passed to @llvm.memcpy being false, not honoring that aggregate has at least one 'volatile' data member (even though aggregate itself has not been qualified as 'volatile'. As a result, optimization optimizes away the memcpy altogether. Patch review by John MaCall (I still need to fix up a test though). llvm-svn: 173535
* The standard ARM C++ ABI dictates that inline functions areJohn McCall2013-01-253-4/+26
| | | | | | | | never key functions. We did not implement that rule for the iOS ABI, which was driven by what was implemented in gcc-4.2. However, implement it now for other ARM-based platforms. llvm-svn: 173515
* First pass at abstracting out a class for the target C++ ABI.John McCall2013-01-251-5/+10
| | | | llvm-svn: 173514
* Silence unintended fallthrough diagnostic on a case label preceded with a ↵Alexander Kornienko2013-01-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | normal label. Summary: It's unlikely that a fallthrough is unintended in the following code: switch (n) { ... label: case 1: ... goto label; ... } Reviewers: rsmith, doug.gregor Reviewed By: doug.gregor CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D329 llvm-svn: 173486
* Don't suggest to insert [[clang::fallthrough]] before empty cases. Fix for ↵Alexander Kornienko2013-01-251-5/+10
| | | | | | multiple case labels. llvm-svn: 173458
* Sync 'in class initialization of static const double' extension up with GCC,Richard Smith2013-01-251-8/+14
| | | | | | | | | | | | | and split it out of -Wgnu into its own warning flag. * In C++11, this is now a hard error (GCC has no extension here in C++11 mode). The error can be disabled with -Wno-static-float-init, and has a fixit to add 'constexpr'. * In C++98, this is still an ExtWarn, but is now controlled by -Wstatic-float-init as well as -Wgnu. llvm-svn: 173414
* Clean up: since we have FunctionDecl::IsInline, make it store the right valueRichard Smith2013-01-251-0/+9
| | | | | | | | | | | | for template instantiations, and use it to simplify the implementation of FunctionDecl::isInlined(). This incidentally changes the result of isInlined on a declared-but-not-defined non-inline member function from true to false. This is sort of a bug fix, but currently isInlined is only called on function definitions, so it has no visible effects. llvm-svn: 173397
* Patch to check for integer overflow. It has beenFariborz Jahanian2013-01-244-12/+29
| | | | | | commented on and approved by Richard Smith. llvm-svn: 173377
* [ms-inline asm] Add an error when trying to compile MS-style inline assemblyChad Rosier2013-01-241-2/+9
| | | | | | | for an unsupported architecture. rdar://13063988 llvm-svn: 173364
* PR14922: when printing an attribute, use the real syntax of the attribute ↵Michael Han2013-01-245-207/+414
| | | | | | | | | | | | | (GNU, C++11, MS Declspec) instead of hardcoded GNU syntax. Introduce a spelling index to Attr class, which is an index into the attribute spelling list of an attribute defined in Attr.td. This index will determine the actual spelling used by an attribute, as it incorporates both the syntax and naming of the attribute. When constructing an attribute AST node, the spelling index is computed based on attribute kind, scope (if it's a C++11 attribute), and name, then passed to Attr that will use the index to print itself. Thanks to Richard Smith for the idea and review. llvm-svn: 173358
* Start checking nonnull (as well as format and argument_with_type_tag) onNick Lewycky2013-01-241-0/+7
| | | | | | overloaded binary operators. llvm-svn: 173315
* Fix some wonky formatting, remove spurious emacs major mode marker. NoNick Lewycky2013-01-242-10/+8
| | | | | | functionality change! llvm-svn: 173314
* Micro cleanup: use an array of const char, rather than an array of char, as theRichard Smith2013-01-231-1/+1
| | | | | | | type of the string literal implicitly used for a raw user-defined literal call. No test; this has no semantic impact. llvm-svn: 173309
* Implement -Wvla correctlyDmitri Gribenko2013-01-231-0/+5
| | | | | | | | | | | | | GCC implements -Wvla as "warn on every VLA" (this is useful to find every VLA, for example, if they are forbidden by coding guidelines). Currently Clang implements -Wvla as "warn on VLA when it is an extension". The attached patch makes our behavior match GCC. The existing vla extwarn is moved under -Wvla-extension and is still included into -Wgnu. This fixes PR5953. llvm-svn: 173286
* Use 'const Decl *' throughout code completion in SemaDmitri Gribenko2013-01-234-134/+144
| | | | llvm-svn: 173277
* Add a new LangOpt NativeHalfType. This option allows for native half/fp16Joey Gouly2013-01-235-13/+66
| | | | | | | | operations (as opposed to storage only half/fp16). Also add some semantic checks for OpenCL half types. llvm-svn: 173254
* Make __attribute__((nonnull)) use the general expression evaluator to search forNick Lewycky2013-01-231-2/+14
| | | | | | | nulls instead of limiting itself to the language-defined "null pointer constant". llvm-svn: 173227
* Small code change to improve performanceFariborz Jahanian2013-01-221-2/+6
| | | | | | in my last patch, suggested by Argyrios. llvm-svn: 173182
* objectiveC (take two): don't warn when in -Wselector mode andFariborz Jahanian2013-01-221-18/+30
| | | | | | | an unimplemented selector is consumed by "respondsToSelector:". // rdar://12938616 llvm-svn: 173179
* objectiveC: don't warn when in -Wselector mode andFariborz Jahanian2013-01-211-14/+17
| | | | | | | an unimplemented selector is consumed by "respondsToSelector:". // rdar://12938616 llvm-svn: 173097
* Eliminate Sema::CompareProperties(), which was walking over a pile ofDouglas Gregor2013-01-212-62/+68
| | | | | | | | | lexical declarations looking for properties when we could more efficiently check for property mismatches at property declaration time. Good for ~1% of -fsyntax-only time when most of the properties we're checking against come from an AST file. llvm-svn: 173079
* Eliminate the oddly-named Sema::ComparePropertiesInBaseAndSuper, whichDouglas Gregor2013-01-212-46/+28
| | | | | | | | | | did a redundant traversal of the lexical declarations in the superclass. Instead, when we declare a new property, look into the superclass to see whether we're redeclaring the property. Goot for 1% of -fsyntax-only time on Cocoa.h and a little less than 3% on my modules test case. llvm-svn: 173073
* Replace some unnecessary O(N^2) lookups for properties withDouglas Gregor2013-01-211-40/+53
| | | | | | | DeclContext lookups. The performance win is negligible in my tests, but it's the Right Thing To Do (TM). llvm-svn: 173068
* Add a fixit for _Noreturn main,Dmitri Gribenko2013-01-211-2/+8
| | | | | | add tests for fixits removing static and inline from main llvm-svn: 173024
* Implement OpenCL event_t as Clang builtin type, including event_t related ↵Guy Benyei2013-01-205-7/+99
| | | | | | OpenCL restrictions (OpenCL 1.2 spec 6.9) llvm-svn: 172973
* Fixed trailing whitespace.Michael Gottesman2013-01-201-44/+44
| | | | llvm-svn: 172939
* Reapply r172878 with test case.Ted Kremenek2013-01-191-3/+9
| | | | llvm-svn: 172888
* Whitespace.NAKAMURA Takumi2013-01-191-1/+1
| | | | llvm-svn: 172881
* Revert r172878, "Reword warning about using a *static* variable within its ↵NAKAMURA Takumi2013-01-191-10/+4
| | | | | | | | own initialization." It broke, at least, linux, msvc and mingw bots. llvm-svn: 172879
* Reword warning about using a *static* variable within its own initialization.Ted Kremenek2013-01-191-4/+10
| | | | | | | | | The warning is still under -Wuninitialized (although technically this is defined behavior), but under a subgroup -Wstatic-self-init. This addresses PR 10265. llvm-svn: 172878
* Remove windows line endings.David Blaikie2013-01-181-6/+6
| | | | llvm-svn: 172865
* Once we've collected the template arguments for aDouglas Gregor2013-01-181-3/+7
| | | | | | | | partially-substituted parameter pack in a template, forget about the partially-substituted parameter pack: it is now completed. Fixes <rdar://problem/12176336>. llvm-svn: 172859
* When checking the parameter types of an Objective-C method, don'tDouglas Gregor2013-01-181-2/+0
| | | | | | | decay the parameter type immediately; let CheckParameter() do its job. Fixes <rdar://problem/12071218>. llvm-svn: 172780
* One can override an Objective-C ARC ownership qualifier that came fromDouglas Gregor2013-01-171-0/+10
| | | | | | | a template parameter; make that also include one that came from 'auto'. Fixes <rdar://problem/12078752>. llvm-svn: 172770
* In Objective-C ARC, completely ignore ownership qualifiers on theDouglas Gregor2013-01-171-0/+38
| | | | | | | | return type of a function by canonicalizing them away. They are useless anyway, and conflict with our rules for template argument deduction and __strong. Fixes <rdar://problem/12367446>. llvm-svn: 172768
* Defer checking for unsequenced operations on the RHS of && and || in order toRichard Smith2013-01-171-7/+17
| | | | | | reduce stack usage and hopefully bring back the linux x86_64 buildbot. llvm-svn: 172765
* Parsing support for C11's _Noreturn keyword. No semantics yet.Richard Smith2013-01-172-3/+18
| | | | llvm-svn: 172761
* -Wunsequenced: if the LHS of an &&, || or ?: is not constant, check forRichard Smith2013-01-171-6/+22
| | | | | | | | | unsequenced operations in the RHS. We don't compare the RHS with the rest of the expression yet; such checks will need care to avoid diagnosing unsequenced operations which are both in conditionally-evaluated subexpressions which actually can't occur together, such as in '(b && ++x) + (!b && ++x)'. llvm-svn: 172760
OpenPOWER on IntegriCloud