summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* rewrap to 80 cols, no behavior changeNico Weber2014-07-081-2/+3
| | | | llvm-svn: 212574
* MS compat: Allow lookup of types from dependent bases in functionsReid Kleckner2014-07-081-2/+11
| | | | | | | | | | | | | | | | | | | | | | If we want to resolve the remaining FIXMEs here, we probably want to extend the main lookup mechanism to perform lookup into dependent bases, but we would have to tread lightly. Adding more name lookup has major impact on compile time. If we did extend the main mechanism, we would add a flag to LookupResult that allows us to find names from dependent base classes where the base is a specialization of a known template. The final LookupResult would still return LookupResult::NotFoundInCurrentInstantiation, but it would have a collection of Decls. If we find a real lookup result, we would clear the flag and the existing lookup results and begin accumulating only real lookup results. We would structure the lookup as a secondary lookup between normal lookup and typo correction for normal compilation, but for MSVC compatibility mode, we would always enable this extra lookup into dependent bases. llvm-svn: 212566
* Allow more lookup of types in dependent base classesReid Kleckner2014-07-081-0/+66
| | | | | | | | | | | | | | | | | | | | MSVC appears to perform name lookup into dependent base classes when the dependent base class has a known primary template. This allows them to know whether some unqualified ids are types or not, which allows them to parse more class templates without typename keywords. We can do the same thing when type name lookup fails, and if we find a single type decl in one of our dependent base classes, recover as though the user wrote 'typename MyClass::TypeFromBase'. This allows us to parse some COM smart pointer classes in wrl/client.h from the Windows 8 SDK. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D4237 llvm-svn: 212561
* Sema: Don't allow CVR qualifiers before structorsDavid Majnemer2014-07-082-27/+48
| | | | | | | | | We would silently accept volatile ~S() when the user probably intended to write virtual ~S(). This fixes PR20238. llvm-svn: 212555
* PR20227: materialize a temporary when dynamic_casting a class prvalue to aRichard Smith2014-07-081-1/+9
| | | | | | reference type. llvm-svn: 212551
* [OPENMP] Parsing and sema analysis for 'omp parallel sections' directive.Alexey Bataev2014-07-082-1/+76
| | | | llvm-svn: 212516
* Rename static function to better describe its purposeAlp Toker2014-07-081-4/+4
| | | | llvm-svn: 212502
* [OPENMP] Added initial support for 'omp parallel for'.Alexey Bataev2014-07-072-29/+133
| | | | llvm-svn: 212453
* Switch over a few uses of param_begin() to parameters()Alp Toker2014-07-075-30/+30
| | | | llvm-svn: 212442
* Add an AST node for __leave statements, hook it up.Nico Weber2014-07-072-1/+7
| | | | | | | Codegen is still missing (and I won't work on that), but __leave is now as implemented as __try and friends. llvm-svn: 212425
* Sema: Check that __leave is contained in a __try block.Nico Weber2014-07-062-0/+9
| | | | | | | | | Give scope a SEHTryScope bit, set that in ParseSEHTry(), and let Sema walk the scope chain to find the SEHTry parent on __leave statements. (They are rare enough that it seems better to do the walk instead of giving Scope a SEHTryParent pointer -- this is similar to AtCatchScope.) llvm-svn: 212422
* Add parser support for __leave (sema and onward still missing).Nico Weber2014-07-061-0/+5
| | | | llvm-svn: 212421
* Make a small crash preventing change.Fariborz Jahanian2014-07-031-2/+2
| | | | llvm-svn: 212291
* [ARM] Implement ISB memory barrier intrinsicYi Kong2014-07-031-3/+4
| | | | | | | Adds support for __builtin_arm_isb. Also corrects DSB and ISB instructions modelling by adding has-side-effects property. llvm-svn: 212277
* Address review feedback for r212238.Nico Weber2014-07-031-2/+1
| | | | | | | Also, forgot to say in the commit message of r212238: Library authors will see a warning about this issue if they build with -Wsystem-headers. llvm-svn: 212243
* Enable clang to continue to parse libstdc++4.6 and stlport after r210091.Nico Weber2014-07-021-2/+53
| | | | | | | | | | r210091 made initialization checking more strict in c++11 mode. LWG2193 is about changing standard libraries to still be valid under these new rules, but older libstdc++ (e.g. libstdc++4.6 in -D_GLIBCXX_DEBUG=1 mode, or stlport) do not implement that yet. So fall back to the C++03 semantics for container classes in system headers below the std namespace. llvm-svn: 212238
* ARM: add support for v8 ldaex/stlex builtins.Tim Northover2014-07-021-4/+14
| | | | | | | | | | | | | | ARMv8 adds (to both AArch32 and AArch64) acquiring and releasing variants of the exclusive operations, in line with the C++11 memory model. This adds support for two new intrinsics to expose them to C & C++ developers directly: __builtin_arm_ldaex and __builtin_arm_stlex, in direct analogy with the versions with no implicit barrier. rdar://problem/15885451 llvm-svn: 212175
* Make FunctionDecl::getReturnTypeSourceRange() support non-builtin typesAlp Toker2014-07-021-9/+4
| | | | | | | Also document that the function is a "best-effort" facility to extract source ranges from limited AST type location info. llvm-svn: 212174
* Don't accept qualified 'int' main return types in C++ or standard C modeAlp Toker2014-07-021-22/+27
| | | | | | | | | C++ [basic.start.main]p1: "It shall have a return type of type int" ISO C is also clear about this, so only accept 'int' with qualifiers in GNUMode C. llvm-svn: 212171
* Prevent Clang from crashing on template code.Richard Trieu2014-07-021-1/+8
| | | | | | | | | | Fixes PR20110, where Clang hits an assertion failure when it expects that the sub-expression of a bit cast to pointer to also be a pointer, but gets a value instead. Differential Revision: http://reviews.llvm.org/D4280 llvm-svn: 212160
* [OPENMP] Fixed error message reporting for nesting of regionsAlexey Bataev2014-07-021-2/+2
| | | | llvm-svn: 212156
* Introduce a FunctionDecl::getReturnTypeSourceRange() utilityAlp Toker2014-07-022-50/+43
| | | | | | | | | | This source range is useful for all kinds of diagnostic QOI and refactoring work, so let's make it more discoverable. This commit also makes use of the new function to enhance various diagnostics relating to return types and resolves an old FIXME. llvm-svn: 212154
* [OPENMP] Added table with allowed nesting info for OpenMP regions (per ↵Alexey Bataev2014-06-301-0/+46
| | | | | | request from Samuel F Antao). llvm-svn: 212034
* Using of variable length arrays in captured statements and OpenMP constructs.Alexey Bataev2014-06-301-3/+102
| | | | | | Differential Revision: http://reviews.llvm.org/D4067 llvm-svn: 212010
* Extract an isReservedName() functionAlp Toker2014-06-301-18/+18
| | | | | | | | | | | | | | We'll want to share the implementation if anything else decides to check for reserved names in future, so make this little snippet of code more discoverable. Also remove the __va_list_tag and __builtin_va_list special-case checks. They're leftovers from before when the reserved name logic was added. No change in functionality. llvm-svn: 212006
* Extend -Wtautological-undefined-compare and -Wundefined-bool-conversion toRichard Trieu2014-06-281-12/+46
| | | | | | | trigger on taking the address of a reference that is returned from a function call. llvm-svn: 211989
* Import MutableArrayRef into clang namespace.Craig Topper2014-06-285-8/+8
| | | | llvm-svn: 211988
* Remove llvm:: from uses of ArrayRef.Craig Topper2014-06-283-4/+4
| | | | llvm-svn: 211987
* Extend -Wdynamic-class-memaccess to records containing dynamic classesReid Kleckner2014-06-271-12/+33
| | | | | | | | | | Reviewers: rtrieu Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4325 llvm-svn: 211972
* [OPENMP] Parsing and sema analysis for 'copyprivate' clause.Alexey Bataev2014-06-272-34/+207
| | | | llvm-svn: 211886
* Objective-C ARC. Provide diagnostic and fix-it Fariborz Jahanian2014-06-262-1/+26
| | | | | | | | | when casting a retainable object to a objc_bridge_related CF type with the suggestion of applying the method specified in the bridging attribute to the object. // rdar://15932435 llvm-svn: 211807
OpenPOWER on IntegriCloud