summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Cleanup ObjCInterfaceDecl lookup for ObjC literalsAlex Denisov2015-07-241-99/+98
| | | | llvm-svn: 243092
* Fix the equal-vector-size rule for reinterpret_casts in C++John McCall2015-07-232-21/+32
| | | | | | | | | | | | | to consider the storage size of the vector instead of its sizeof. In other words, ban <3 x int> to <4 x int> casts, which produced invalid IR anyway. Also, attempt to be a little more rigorous, or at least explicit, about when enums are allowed in these casts. rdar://21901132 llvm-svn: 243069
* Sema: Avoid a stack overflow on large CFGsDuncan P. N. Exon Smith2015-07-231-16/+24
| | | | | | | | | Large CFGs cause `checkForFunctionCall()` to overflow its stack. Break the recursion by manually managing the call stack instead. Patch by Vedant Kumar! llvm-svn: 243039
* Sema: Split out helper from checkForFunctionCall(), NFCDuncan P. N. Exon Smith2015-07-231-37/+37
| | | | | | | | | | Split out `hasRecursiveCallInPath()` from `checkForFunctionCall()` to flatten nesting and clarify the code. This also simplifies a follow-up patch that refactors the other logic in `checkForFunctionCall()`. Patch by Vedant Kumar! llvm-svn: 243038
* Downgrade error about adding 'dllimport' to used free function to warning ↵Hans Wennborg2015-07-221-3/+9
| | | | | | | | (PR24215) The code will still work as it can reference the function via its thunk. llvm-svn: 242973
* [CONCEPTS] Add diagnostics: non-defining function; non-namespace scopeHubert Tong2015-07-221-0/+26
| | | | | | | | | | | | | | | | | | | | | Summary: Create diagnostic for function concept declaration which is not a definition. Create diagnostic for concept declaration which isn't in namespace scope. Create associated tests. Reviewers: rsmith, faisalv, fraggamuffin, hubert.reinterpretcast Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11027 Patch by Nathan Wilson! llvm-svn: 242899
* [modules] Stop performing PCM lookups for all identifiers when building with ↵Richard Smith2015-07-221-0/+3
| | | | | | C++ modules. Instead, serialize a list of interesting identifiers and mark those ones out of date on module import. Avoiding the identifier lookups here gives a 20-30% speedup in builds with large numbers of modules. No functionality change intended. llvm-svn: 242868
* [Sema] Diagnose use of declaration correctly.Davide Italiano2015-07-221-9/+1
| | | | | | | | | | | | | Before we skipped that for virtual functions not fully qualified (r81507). This commit basically reverts this to the older behaviour, which seems more consistent. We now also correctly consider ill-formed calls to deleted member functions, which were silently passed before in some cases. The review contains the whole discussion. PR: 20268 Differential Revision: http://reviews.llvm.org/D11334 llvm-svn: 242857
* [modules] In C++, stop serializing and deserializing a list of declarations inRichard Smith2015-07-212-45/+26
| | | | | | | | | the identifier table. This is redundant, since the TU-scope lookups are also serialized as part of the TU DeclContext, and wasteful in a number of ways. We still emit the decls for PCH / preamble builds, since for those we want identical results, not merely semantically equivalent ones. llvm-svn: 242855
* Use range-based for loops; NFC.Aaron Ballman2015-07-211-10/+6
| | | | llvm-svn: 242846
* Use a range-based for loop; NFC.Aaron Ballman2015-07-211-2/+2
| | | | llvm-svn: 242836
* Replace some uses of Self.Context with the local variable C; NFC.Aaron Ballman2015-07-211-14/+14
| | | | llvm-svn: 242835
* Commit for http://reviews.llvm.org/D10765Michael Wong2015-07-212-1/+26
| | | | | | | for OpenMP 4 target data directive parsing and sema. This commit is on behalf of Kelvin Li. llvm-svn: 242785
* Ignore the "novtable" declspec when not using the Microsoft C++ ABI.Bob Wilson2015-07-202-4/+5
| | | | | | | | | | | | | | Clang used to silently ignore __declspec(novtable). It is implemented now, but leaving the vtable uninitialized does not work when using the Itanium ABI, where the class layout for complex class hierarchies is stored in the vtable. It might be possible to honor the novtable attribute in some simple cases and either report an error or ignore it in more complex situations, but it’s not clear if that would be worthwhile. There is also value in having a simple and predictable behavior, so this changes clang to simply ignore novtable when not using the Microsoft C++ ABI. llvm-svn: 242730
* [MS Compat] Add support for __declspec(noalias)David Majnemer2015-07-201-0/+3
| | | | | | | The attribute '__declspec(noalias)' communicates that the function only accesses memory pointed to by its pointer-typed arguments. llvm-svn: 242728
* Silence a -Wtype-limits warning; NFC.Aaron Ballman2015-07-201-1/+1
| | | | llvm-svn: 242670
* [X86, inlineasm] Improve analysis of x,Y0,Yi,Ym,Yt,L,e,Z,s asm constraints ↵Alexey Bataev2015-07-201-2/+1
| | | | | | | | | (patch by Alexey Frolov) Improve Sema checking of 9 existing inline asm constraints (‘x’, ‘Y*’, ‘L’, ‘e’, ‘Z’, ‘s’). Differential Revision: http://reviews.llvm.org/D10536 llvm-svn: 242665
* [Sema] Make an assertion stricter.Davide Italiano2015-07-191-1/+1
| | | | | | We now check for the exact range of IdealIndex. llvm-svn: 242652
* [modules] Don't save uninteresting identifiers, and don't consider identifiersRichard Smith2015-07-191-1/+1
| | | | | | | to be interesting just because they are the name of a builtin. Reduces the size of an empty module by over 80% (~100KB). llvm-svn: 242650
* Remove two unused includes.Nico Weber2015-07-191-1/+0
| | | | llvm-svn: 242648
* [AST] Remove StmtRange in favor of an iterator_range.Benjamin Kramer2015-07-181-4/+4
| | | | | | | | | StmtRange was just a convenient wrapper for two StmtIterators before we had real range support. This removes some of the implicit conversions StmtRange had leading to slightly more verbose code but also should make more obvious what's going on. No functional change intended. llvm-svn: 242615
* [Sema] Emit correct warning when copy-elision is not possible.Davide Italiano2015-07-181-0/+5
| | | | | | | | | | If we're returning a function parameter, copy elision isn't possible, so we now warn for redundant move. PR: 23819 Differential Revision: http://reviews.llvm.org/D11305 llvm-svn: 242600
* Fix alignment issues in Clang.James Y Knight2015-07-171-2/+3
| | | | | | | | | | | | | | | | | Some const-correctness changes snuck in here too, since they were in the area of code I was modifying. This seems to make Clang actually work without Bus Error on 32bit-sparc. Follow-up patches will factor out a trailing-object helper class, to make classes using the idiom of appending objects to other objects easier to understand, and to ensure (with static_assert) that required alignment guarantees continue to hold. Differential Revision: http://reviews.llvm.org/D10272 llvm-svn: 242554
* [Sema] Refactor Sema::ImplicitExceptionSpecification::CalledDeclDavide Italiano2015-07-161-16/+14
| | | | | | This (hopefully) brings more clarity. No functional changes (intended). llvm-svn: 242483
* [SemaType] Use a range loop.Davide Italiano2015-07-161-4/+2
| | | | llvm-svn: 242432
* Disable #pragma redefine_extname for C++ code as it does not make sense in ↵Aaron Ballman2015-07-161-22/+27
| | | | | | | | such a context. Patch by Andrey Bokhanko! llvm-svn: 242420
* [OPENMP] Fixed detection of canonical loops with random access iterators.Alexey Bataev2015-07-161-4/+6
| | | | | | Add handling of iterators with copy/move constructors with default arguments + converting template constructors. llvm-svn: 242382
* [OPENMP] http://llvm.org/PR24121: canonical loop rejected when comparison ↵Alexey Bataev2015-07-151-3/+30
| | | | | | | | has implicit conversions or destruction Allow to use complex iterators expressions in loops for C++. llvm-svn: 242285
* [Sema] Don't emit "pure virtual" warning for fully qualified calls.Davide Italiano2015-07-142-4/+11
| | | | | | | | | | -fapple-kext is an exception because calls will still go through the vtable in that mode. Add a note to make the user aware of that. PR: 23215 Differential Revision: http://reviews.llvm.org/D10935 llvm-svn: 242246
* Add a "maximum TLS alignment" characteristic to the target info, so itPaul Robinson2015-07-142-5/+47
| | | | | | | | | | can be different from the normal variable maximum. Add an error diagnostic for when TLS variables exceed maximum TLS alignment. Currenty only PS4 sets an explicit maximum TLS alignment. Patch by Charles Li! llvm-svn: 242198
* [Sema] Emit a better diagnostic when variable redeclarations disagreeDavid Majnemer2015-07-141-3/+10
| | | | | | | | | | | We referred to all declaration in definitions in our diagnostic messages which is can be inaccurate. Instead, classify the declaration and emit an appropriate diagnostic for the new declaration and an appropriate note pointing to the old one. This fixes PR24116. llvm-svn: 242190
* Fixed 22941: Integer template parameter as immediate 'I' expectes an integer ↵Sunil Srivastava2015-07-141-11/+13
| | | | | | | | | constant Basically fixed premature testing of integer constraints during template parsing Reviewed at http://reviews.llvm.org/D10452 llvm-svn: 242175
* [OPENMP] Drop type qualifiers from private variables.Alexey Bataev2015-07-141-0/+3
| | | | | | If the variable is marked as private in OpenMP construct, the reference to this variable should not keep type qualifiers for the original variable. Private copy is not volatile or constant, so we can use unqualified type for private copy. llvm-svn: 242133
* [OpenMP] Add TLS-based implementation for threadprivate directive.Samuel Antao2015-07-131-3/+11
| | | | llvm-svn: 242080
* Move class into an anonymous namespace. NFC.Benjamin Kramer2015-07-131-0/+2
| | | | llvm-svn: 242064
* [Sema] If lvalue to rvalue reference cast is valid don't emit diagnostic.Davide Italiano2015-07-121-2/+4
| | | | | | | | | | | | | In the test, y1 is not reference compatible to y2 and we currently assume the cast is ill-formed so we emit a diagnostic. Instead, in order to honour the standard, if y1 it's not reference-compatible to y2 then it can't be converted using a static_cast, and a reinterpret_cast should be tried instead. Richard Smith provided the correct interpretation of the standard and explanation about the subtle difference between "can't be cast" and "the cast is ill-formed". The former applies in this case. PR: 23802 llvm-svn: 241998
* Sema: Allow null names to be passed in to isAcceptableTagRedeclarationJustin Bogner2015-07-104-11/+11
| | | | | | | | | | | | | It's possible for TagRedeclarations to involve decls without a name, ie, anonymous enums. We hit some undefined behaviour if we bind these null names to the reference here. We never dereference the name, so it's harmless if it's null - make it a pointer to allow that. Fixes the Modules/submodules-merge-defs.cpp test under ubsan. llvm-svn: 241963
* Fix a couple of typos: specifc->specific.Eric Christopher2015-07-101-1/+1
| | | | llvm-svn: 241924
* Re-enable 32-bit SEH after the alignment fixReid Kleckner2015-07-101-0/+4
| | | | llvm-svn: 241878
* [CodeCompletion] Don't crash on member inits of templated constructors.Benjamin Kramer2015-07-091-3/+7
| | | | | | | Also fixes a crash (on invalid) member functions with a colon initializer. PR23948. llvm-svn: 241811
* Disable 32-bit SEH, againReid Kleckner2015-07-081-4/+0
| | | | | | | | Move the diagnostic back to codegen so that we can compile ATL on the self-host bot. We don't actually end up emitting code for the __try, so the diagnostic won't be hit. llvm-svn: 241761
* [modules] Fix merging support for forward-declared enums with fixed ↵Richard Smith2015-07-081-7/+14
| | | | | | underlying types. A visible declaration is enough to make the type complete, but not enough to make the definition visible. llvm-svn: 241743
* SemaDeclObjC.cpp: Escape \@ in comment lines. [-Wdocumentation]NAKAMURA Takumi2015-07-081-2/+2
| | | | llvm-svn: 241664
* Silence a -Wcast-qual warning; NFC.Aaron Ballman2015-07-071-11/+7
| | | | llvm-svn: 241581
* [libclang] When inferring nonnull use the contextual keyword for the ↵Douglas Gregor2015-07-071-0/+5
| | | | | | | | | | code-completion results, when appropriate. rdar://20742295 llvm-svn: 241560
* [libclang] Replace ObjC generic parameters when code-completing method ↵Douglas Gregor2015-07-071-1/+4
| | | | | | | | implementations. rdar://20643768 llvm-svn: 241559
* [libclang] Fix code-completion of block parameters that are marked with ↵Douglas Gregor2015-07-071-0/+5
| | | | | | | | nullability specifier. rdar://20755276 llvm-svn: 241558
* [libclang] Replace ObjC generic parameters in code-completion results.Douglas Gregor2015-07-072-40/+79
| | | | | | rdar://19369529 llvm-svn: 241557
* Implement variance for Objective-C type parameters.Douglas Gregor2015-07-071-3/+68
| | | | | | | | | | | | | | | Introduce co- and contra-variance for Objective-C type parameters, which allows us to express that (for example) an NSArray is covariant in its type parameter. This means that NSArray<NSMutableString *> * is a subtype of NSArray<NSString *> *, which is expected of the immutable Foundation collections. Type parameters can be annotated with __covariant or __contravariant to make them co- or contra-variant, respectively. This feature can be detected by __has_feature(objc_generics_variance). Implements rdar://problem/20217490. llvm-svn: 241549
* Implement the Objective-C __kindof type qualifier.Douglas Gregor2015-07-073-33/+96
| | | | | | | | | | The __kindof type qualifier can be applied to Objective-C object (pointer) types to indicate id-like behavior, which includes implicit "downcasting" of __kindof types to subclasses and id-like message-send behavior. __kindof types provide better type bounds for substitutions into unspecified generic types, which preserves more type information. llvm-svn: 241548
OpenPOWER on IntegriCloud