summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* [OPENMP] Initial parsing and sema analysis for 'atomic' directive.Alexey Bataev2014-07-222-4/+61
| | | | llvm-svn: 213639
* [OPENMP] Initial parsing and sema analysis for 'ordered' directive.Alexey Bataev2014-07-222-17/+110
| | | | llvm-svn: 213616
* Sema: correct handling for __va_start for WoASaleem Abdulrasool2014-07-221-1/+66
| | | | | | | | | | | | | | | | | | Windows ARM indicates __va_start as a variadic function. However, the function itself is treated as having 4 formal arguments: - (out) pointer to the va_list - (in) address of the last named argument - (in) slot size for the type of the last argument - address of the last named argument The last argument does not seem to have any bearing on codegen, and thus is not explicitly type checked at this point. Unlike the previous handling for __va_start, it does not currently validate if the parameter is the last named parameter (it seems that MSVC currently accepts this). llvm-svn: 213595
* Avoid crash if default argument parsed with errors.Serge Pavlov2014-07-221-1/+4
| | | | | | | | | | | | | | If function parameters have default values, and that of the second parameter is parsed with errors, function declaration would have a parameter without default value that follows a parameter with that. Such declaration breaks logic of selecting overloaded function. As a solution, put opaque object as default value in such case. This patch fixes PR20055. Differential Revision: http://reviews.llvm.org/D4378 llvm-svn: 213594
* -fms-extensions: Implement half of #pragma init_segReid Kleckner2014-07-223-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This pragma is very rare. We could *hypothetically* lower some uses of it down to @llvm.global_ctors, but given that GlobalOpt isn't able to optimize prioritized global ctors today, there's really no point. If we wanted to do this in the future, I would check if the section used in the pragma started with ".CRT$XC" and had up to two characters after it. Those two characters could form the 16-bit initialization priority that we support in @llvm.global_ctors. We would have to teach LLVM to lower prioritized global ctors on COFF as well. This should let us compile some silly uses of this pragma in WebKit / Blink. Reviewers: rsmith, majnemer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4549 llvm-svn: 213593
* Add support for '#pragma unroll'.Mark Heffernan2014-07-211-66/+60
| | | | llvm-svn: 213574
* Sema: Handle C11 atomics when diagnosing out of range comparisonsJustin Bogner2014-07-211-0/+6
| | | | | | | | This fixes a couple of asserts when analyzing comparisons involving C11 atomics that were uncovered by r205608 when we extended the applicability of -Wtautological-constant-out-of-range-compare. llvm-svn: 213573
* [OPENMP] Initial parsing and sema analysis for 'flush' directive.Alexey Bataev2014-07-212-1/+85
| | | | llvm-svn: 213512
* [OPENMP] Parsing/Sema of the OpenMP directive 'critical'.Alexander Musman2014-07-212-13/+130
| | | | llvm-svn: 213510
* PR20356: Fix all Sema warnings with mismatched ext_/warn_ versusRichard Smith2014-07-197-18/+18
| | | | | | | | ExtWarn/Warnings. Mostly the name of the warning was changed to match the semantics, but in the PR20356 cases, the warning was about valid code, so the diagnostic was changed from ExtWarn to Warning instead. llvm-svn: 213443
* [MS-ABI] Assign SEH handler indices to __try blocksWarren Hunt2014-07-193-11/+20
| | | | | | | | | Assigns indices to try blocks. These indices will used in constructing tables that the mscrt function __except_handler3 reads during SEH. Testing will occur once we actually emit the tables, in a subsequent patch. llvm-svn: 213437
* Objective-C. Patch to warn if the result of calling a property getter Fariborz Jahanian2014-07-181-3/+9
| | | | | | | | is unused (this is match behavior when property-dot syntax is used to use same getter). rdar://17514245 Patch by Anders Carlsson with minor refactoring by me. llvm-svn: 213423
* [OPENMP] Initial parsing and sema analysis for 'taskwait' directive.Alexey Bataev2014-07-182-0/+41
| | | | llvm-svn: 213363
* [OPENMP] Initial parsing and sema analysis for 'barrier' directive.Alexey Bataev2014-07-182-0/+49
| | | | llvm-svn: 213360
* [OPENMP] Initial parsing and sema analysis of 'taskyield' directive.Alexey Bataev2014-07-182-25/+74
| | | | llvm-svn: 213355
* Cleanup: remove essentially unused variable.Richard Smith2014-07-181-3/+2
| | | | llvm-svn: 213347
* Mark the vtable used when defining implicit copy and move ctorsReid Kleckner2014-07-181-0/+3
| | | | | | | | | | I don't think other implicit members like copy assignment and move assignment require this treatment, because they should already be operating on a constructed object. Fixes PR20351. llvm-svn: 213346
* SemaInit.cpp: Fix a warning with -Asserts. [-Wunused-variable]NAKAMURA Takumi2014-07-181-0/+1
| | | | llvm-svn: 213345
* PR20346: fix aggregate initialization / template instantiation bug:Richard Smith2014-07-171-0/+9
| | | | | | | | | | | | | If, during the initial parse of a template, we perform aggregate initialization and form an implicit value initialization for an array type, then when we come to instantiate the template and redo the initialization step, we would try to match the implicit value initialization up against an array *element*, not to the complete array. Remarkably, we've had this bug since ~the dawn of time, but only noticed it recently. llvm-svn: 213332
* Objective-C. deprecated attribute is not inherited on methodsFariborz Jahanian2014-07-171-0/+2
| | | | | | | overriden in interfaces and protocols (this is already the case for properties). rdar://16068470 llvm-svn: 213282
* Add an __assume side-effects warningHal Finkel2014-07-171-0/+18
| | | | | | | | | | | | In MS-compatibility mode, we support the __assume builtin. The __assume builtin does not evaluate its arguments, and we should issue a warning if __assume is provided with an argument with side effects (because these effects will be discarded). This is similar in spirit to the warnings issued by other compilers (Intel Diagnostic 2261, MS Compiler Warning C4557). llvm-svn: 213266
* [OPENMP] Initial parsing and sema analysis of 'mergeable' clause.Alexey Bataev2014-07-172-0/+19
| | | | llvm-svn: 213262
* [OPENMP] Initial support for parsing and sema analysis of 'untied' clause.Alexey Bataev2014-07-172-0/+19
| | | | llvm-svn: 213257
* Port memory barriers intrinsics to AArch64Yi Kong2014-07-171-1/+12
| | | | | | | | | | | | | Memory barrier __builtin_arm_[dmb, dsb, isb] intrinsics are required to implement their corresponding ACLE and MSVC intrinsics. This patch ports ARM dmb, dsb, isb intrinsic to AArch64. Requires LLVM r213247. Differential Revision: http://reviews.llvm.org/D4521 llvm-svn: 213250
* [OPENMP] Parsing/Sema analysis of directive 'master'Alexander Musman2014-07-172-7/+68
| | | | llvm-svn: 213237
* [OPENMP] Initial parsing and sema analysis for 'final' clause.Alexey Bataev2014-07-172-0/+46
| | | | llvm-svn: 213232
* Track the difference betweenRichard Smith2014-07-174-30/+48
| | | | | | | | | | | | -- a constructor list initialization that unpacked an initializer list into constructor arguments and -- a list initialization that created as std::initializer_list and passed it as the first argument to a constructor in the AST. Use this flag while instantiating templates to provide the right semantics for the resulting initialization. llvm-svn: 213224
* Fix FriendDecl source location and range for class templates and function ↵Nikola Smiljanic2014-07-173-8/+8
| | | | | | declarations that don't start with 'friend' keyword. Add more unittests. llvm-svn: 213220
* When list-initializing an object of class type, if we pick an initializer listRichard Smith2014-07-161-17/+24
| | | | | | | | | constructor (and pass it an implicitly-generated std::initializer_list object), be sure to mark the resulting construction as list-initialization. This fixes an assert in template instantiation where we previously thought we'd got direct non-list initialization without any parentheses. llvm-svn: 213201
* Objective-C. Changes per A. Ballman's commentFariborz Jahanian2014-07-161-6/+7
| | | | | | for my last patch. // rdar://17631257 llvm-svn: 213185
* Objective-C. Introducing __attribute__((objc_runtime_name("runtimename"))Fariborz Jahanian2014-07-161-0/+14
| | | | | | | | | to be applied to class or protocols. This will direct IRGen for Objective-C metadata to use the new name in various places where class and protocol names are needed. rdar:// 17631257 llvm-svn: 213167
* Avoid referencing the vtable when calling the ctor without emitting itReid Kleckner2014-07-161-2/+0
| | | | | | | | | | | | | | This fixes compilation errors about incomplete types used with WebKit's RefPtr template. Simply calling an out of line constructor should not instantiate all inline and defaulted virtual methods. Tested by building and testing several big piles of code on Linux. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D4429 llvm-svn: 213109
* Switching some iterator-based for loops to use range-based for loops. No ↵Aaron Ballman2014-07-151-49/+28
| | | | | | functional changes intended. llvm-svn: 213098
* Added the pack_elements range accessor. Refactoring some for loops to use ↵Aaron Ballman2014-07-152-12/+6
| | | | | | range-based for loops instead. No functional changes intended. llvm-svn: 213095
* [OPENMP] Several cosmetic fixes in comments, tests and the code for '#pragma ↵Alexey Bataev2014-07-151-0/+3
| | | | | | omp single'. llvm-svn: 213040
* Remove dead code.Richard Smith2014-07-141-11/+0
| | | | llvm-svn: 213013
* In C++98, if an rvalue reference binds to a function lvalue (or an xvalue or anRichard Smith2014-07-141-1/+1
| | | | | | | | array prvalue), treat that as a direct binding. Only the class prvalue case needs to be excluded here; the rest are extensions anyway, so we can treat them as we would in C++11. llvm-svn: 212978
* Fix typosAlp Toker2014-07-141-1/+1
| | | | | | Also consolidate 'backward compatibility' llvm-svn: 212974
* CodeGen: Let arrays be inputs to inline asmDavid Majnemer2014-07-141-5/+6
| | | | | | | | | | | An array showing up in an inline assembly input is accepted in ICC and GCC 4.8 This fixes PR20201. Differential Revision: http://reviews.llvm.org/D4382 llvm-svn: 212954
* Superficial fix for PR20218: binding a function lvalue to a const reference toRichard Smith2014-07-141-17/+28
| | | | | | | | | | | | | a function pointer is neither better nor worse than binding a function lvalue to a function rvalue reference. Don't get confused and think that both bindings are binding to a function lvalue (which would make the lvalue form win); the const reference is binding to an rvalue. The "real" bug in PR20218 is still present: we're getting the wrong answer from template argument deduction, and that's what leads us to this weird overload set. llvm-svn: 212916
* Form a CallExpr from __noop without parensReid Kleckner2014-07-111-1/+14
| | | | | | | | | | | | MSVC accepts __noop without any trailing parens and treats it like a literal zero. We don't treat __noop as an integer literal, but now at least we can parse a naked __noop expression. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D4476 llvm-svn: 212860
* Consolidate header inclusion diagnosticsAlp Toker2014-07-112-26/+25
| | | | | | | Make argument orders match, unify diagnostic IDs and reword the message to be a little less saccharine. llvm-svn: 212845
* The returns_nonnull attribute does not require a function prototype because ↵Aaron Ballman2014-07-111-1/+1
| | | | | | it affects only the return value, not any arguments. In turn, asking for a function or method result type should not require a function prototype either, so getFunctionOrMethodResultType has been relaxed. llvm-svn: 212827
* [OPENMP] Parsing and sema analysis for 'omp task' directive.Alexey Bataev2014-07-112-87/+222
| | | | llvm-svn: 212804
* Return a FixItHint instead of taking a diagnostic builderReid Kleckner2014-07-111-7/+6
| | | | | | Addressing review comments from r212784. llvm-svn: 212786
* MSVC compat: Allow lookup of friend types in enclosing namespacesReid Kleckner2014-07-101-6/+63
| | | | | | | | | | | | | | | | | | | | | | | The relevant portion of C++ standard says [namespace.memdef]p3: If the name in a friend declaration is neither qualified nor a template-id and the declaration is a function or an elaborated-type-specifier, the lookup to determine whether the entity has been previously declared shall not consider any scopes outside the innermost enclosing namespace. MSVC does not implement that rule for types. If there is a type in an enclosing namespace, they consider an unqualified tag declaration with the same name to be a redeclaration of the type from another namespace. Implementing compatibility is a simple matter of disabling our implementation of this rule for types, which was added in r177473. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D4443 llvm-svn: 212784
* PR20256: don't accidentally instantiate non-dependent default-initialization asRichard Smith2014-07-102-2/+10
| | | | | | value-initialization. llvm-svn: 212764
* Sema: Allow aliases to have incomplete typeDavid Majnemer2014-07-091-5/+7
| | | | | | | | | | | | gcc supports this behavior and it is pervasively used inside the Linux kernel. Note that both gcc and clang will reject code that attempts to do this in a C++ language mode. This fixes PR17998. llvm-svn: 212631
* Fix typos.Nikola Smiljanic2014-07-092-2/+2
| | | | llvm-svn: 212589
* rewrap to 80 cols, no behavior changeNico Weber2014-07-082-6/+7
| | | | llvm-svn: 212578
OpenPOWER on IntegriCloud