summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* [Sema] ArrayRef-ize ParseObjCStringLiteral and ↵Craig Topper2015-12-242-13/+10
| | | | | | CodeCompleteObjCProtocolReferences. NFC llvm-svn: 256397
* [TrailingObjects] Convert ASTTemplateKWAndArgsInfo and ↵James Y Knight2015-12-242-3/+3
| | | | | | | | | | | | | | | | | | | ASTTemplateArgumentListInfo. Doing so required separating them so that the former doesn't inherit from the latter anymore. Investigating that, it became clear that the inheritance wasn't actually providing real value in any case. So also: - Remove a bunch of redundant functions (getExplicitTemplateArgs, getOptionalExplicitTemplateArgs) on various Expr subclasses which depended on the inheritance relationship. - Switched external callers to use pre-existing accessors that return the data they're actually interested in (getTemplateArgs, getNumTemplateArgs, etc). - Switched internal callers to use pre-existing getTemplateKWAndArgsInfo. llvm-svn: 256359
* Replace isa+cast with dyn_cast and obey the no else after return rule.Yaron Keren2015-12-231-6/+2
| | | | llvm-svn: 256349
* [OPENMP 4.5] Parsing/sema for 'depend(sink:vec)' clause in 'ordered' directive.Alexey Bataev2015-12-232-58/+198
| | | | | | OpenMP 4.5 adds 'depend(sink:vec)' in 'ordered' directive for doacross loop synchronization. Patch adds parsing and semantic analysis for this clause. llvm-svn: 256330
* [Sema] Make an enum local to the only method that uses it. NFCCraig Topper2015-12-231-7/+5
| | | | llvm-svn: 256319
* [Sema] Use available enum types instead of integers. As one is used in a ↵Craig Topper2015-12-231-3/+2
| | | | | | switch, this makes the compiler ensure the switch is fully covered. NFC llvm-svn: 256318
* [OpenCL] Fix atomic Builtins check for address spaces of non-atomic pointerAnastasia Stulova2015-12-221-2/+11
| | | | | | | | | | | If there are two pointers passed to an atomic Builtin, Clang doesn't allow the second (non-atomic) one to be qualified with an address space. Remove this restriction by recording the address space of passed pointers in atomics type diagnostics. llvm-svn: 256243
* [OPENMP] Revert r256238 to fix the problem with tests on Linux.Alexey Bataev2015-12-222-186/+43
| | | | llvm-svn: 256239
* [OPENMP 4.5] Parsing/sema for 'depend(sink:vec)' clause in 'ordered' directive.Alexey Bataev2015-12-222-43/+186
| | | | | | OpenMP 4.5 adds 'depend(sink:vec)' in 'ordered' directive for doacross loop synchronization. Patch adds parsing and semantic analysis for this clause. llvm-svn: 256238
* [Sema] Use range-based for loops. NFCCraig Topper2015-12-211-56/+39
| | | | llvm-svn: 256135
* Split RequireCompleteType into a function that actually requires that the typeRichard Smith2015-12-1815-114/+96
| | | | | | | | | | | | | | | | | | | is complete (with an error produced if not) and a function that merely queries whether the type is complete. Either way we'll trigger instantiation if necessary, but only the former will diagnose and recover from missing module imports. The intent of this change is to prevent a class of bugs where code would call RequireCompleteType(..., 0) and then ignore the result. With modules, we must check the return value and use it to determine whether the definition of the type is visible. This also fixes a debug info quality issue: calls to isCompleteType do not trigger the emission of debug information for a type in limited-debug-info mode. This allows us to avoid emitting debug information for type definitions in more cases where we believe it is safe to do so. llvm-svn: 256049
* [modules] Don't try to use the definition of a class ifRichard Smith2015-12-183-100/+103
| | | | | | | RequireCompleteType(..., 0) says we're not permitted to do so. The definition might not be visible, even though we know what it is. llvm-svn: 256045
* Wire a SourceLocation into IsDerivedFrom and move the RequireCompleteType callRichard Smith2015-12-189-91/+105
| | | | | | | | for the derived class into it. This is mostly just a cleanup, but could in principle be a bugfix if there is some codepath that reaches here and didn't previously require a complete type (I couldn't find any such codepath, though). llvm-svn: 256037
* [OPENMP 4.5] Parsing/sema analysis for 'depend(source)' clause in 'ordered' ↵Alexey Bataev2015-12-182-27/+59
| | | | | | | | directive. OpenMP 4.5 adds 'depend(source)' clause for 'ordered' directive to support cross-iteration dependence. Patch adds parsing and semantic analysis for this construct. llvm-svn: 255986
* ObjC properties: consider ownership of properties from protocols when ↵Douglas Gregor2015-12-181-0/+7
| | | | | | | | | | synthesizing. When determining whether ownership was explicitly written for a property when it is being synthesized, also consider that the original property might have come from a protocol. Fixes rdar://problem/23931441. llvm-svn: 255943
* [ms-inline-asm] Add support for composite structs in MS inline asmMarina Yatsina2015-12-171-27/+39
| | | | | | | | Add MS inline asm support for structs that contain fields that are also structs. Differential Revision: http://reviews.llvm.org/D15578 llvm-svn: 255890
* [OPENMP] Fix for http://llvm.org/PR25142: openmp: Assertion failed: DD && ↵Alexey Bataev2015-12-171-0/+6
| | | | | | | | "queried property of class with no definition", file AST/DeclCXX.h Added processing for template specialization during data-sharing attributes analysis llvm-svn: 255879
* [OPENMP 4.5] Parsing/sema for 'hint' clause of 'critical' directive.Alexey Bataev2015-12-152-9/+103
| | | | | | OpenMP 4.5 adds 'hint' clause to critical directive. Patch adds parsing/semantic analysis for this clause. llvm-svn: 255625
* [Sema] Make nullness warnings appear in C++.George Burgess IV2015-12-142-12/+22
| | | | | | | | | | | | | | | | | | | Given the following code: int *_Nullable ptr; int *_Nonnull nn = ptr; ...In C, clang will warn you about `nn = ptr`, because you're assigning a nonnull pointer to a nullable pointer. In C++, clang issues no such warning. This patch helps ensure that clang doesn't ever miss an opportunity to complain about C++ code. N.B. Though this patch has a differential revision link, the actual review took place over email. Differential Revision: http://reviews.llvm.org/D14938 llvm-svn: 255556
* Reordering fields to reduce padding in Clang. NFCBen Craig2015-12-141-5/+5
| | | | llvm-svn: 255552
* Allow pseudo-destructor calls on forward-declared Objective-C class pointers.John McCall2015-12-141-1/+6
| | | | | | rdar://18522255 llvm-svn: 255531
* Add parse and sema of OpenMP distribute directive with all clauses except ↵Carlo Bertolli2015-12-142-9/+175
| | | | | | dist_schedule llvm-svn: 255498
* [Sema] Add -Wparentheses warnings for '^' in '|' expressions and '&' in '^' ↵Craig Topper2015-12-131-24/+19
| | | | | | expressions to compliment '&' in '|' that is already present. Matches gcc behavior. llvm-svn: 255450
* [Sema] Write some checks for groups of BinaryOperatorKinds in terms of the ↵Craig Topper2015-12-131-6/+4
| | | | | | predicates already available in BinaryOperator. NFC llvm-svn: 255449
* Minor formatting cleanup. NFCCraig Topper2015-12-121-1/+1
| | | | llvm-svn: 255428
* [Sema] Simplify a couple if statements. Explicitly check up front that only ↵Craig Topper2015-12-121-3/+3
| | | | | | one of the expressions is a comparision op. Then if we find that either is a bitwise op, we know it must be the other one. NFC llvm-svn: 255427
* Preserve source location information for qualified names used in a constructorRichard Smith2015-12-121-2/+7
| | | | | | initializer list to name a base class. Patch by Shahms King! llvm-svn: 255420
* Allow non-defining declarations of class template partial specializations toRichard Smith2015-12-111-1/+6
| | | | | | | | | have a nested name specifier. Strictly speaking, forward declarations of class template partial specializations are not permitted at all, but that seems like an obvious wording defect, and if we allow them without a nested name specifier we should also allow them with a nested name specifier. llvm-svn: 255383
* Reapply "[Modules] Fix regression when an elaborated-type-specifier mentions ↵Ben Langmuir2015-12-111-0/+7
| | | | | | | | | a hidden tag" Now not trying to use a C++ lookup mechanism in C (d'oh). Unqualified lookup is actually fine for this case in C. llvm-svn: 255377
* Unify diagnostics for type defintitions in bad contextsReid Kleckner2015-12-111-15/+11
| | | | | | | The message for a type definition in an "if" condition was different from the other three for no particular reason. llvm-svn: 255372
* Error on redeclaring with a conflicting asm label and on redeclaring with an ↵Nick Lewycky2015-12-111-1/+16
| | | | | | asm label after the first ODR-use. Detects problems like the one in PR22830 where gcc and clang both compiled the file but with different behaviour. llvm-svn: 255371
* [OpenCL 2.0] In OpenCL v2.0 s6.5 all pointers are implicitly in genericAnastasia Stulova2015-12-111-1/+2
| | | | | | | | | | | address space unless address space is explicitly specified. Correct the behavior of NULL constant detection - generic AS void pointer should be accepted as a valid NULL constant. http://reviews.llvm.org/D15293 llvm-svn: 255346
* Reverting r255337 as it seems to kill bots. Needs investigation.Anastasia Stulova2015-12-111-2/+1
| | | | llvm-svn: 255339
* [OpenCL 2.0] In OpenCL v2.0 s6.5 all pointers are implicitly in genericAnastasia Stulova2015-12-111-1/+2
| | | | | | | | | | | address space unless address space is explicitly specified. Correct the behavior of NULL constant detection - generic AS void pointer should be accepted as a valid NULL constant. http://reviews.llvm.org/D15293 llvm-svn: 255337
* Correctly type-check the default arguments of local functionsJohn McCall2015-12-111-2/+5
| | | | | | | | when eagerly instantiating them. rdar://23721638 llvm-svn: 255325
* Revert "[Modules] Fix regression when an elaborated-type-specifier mentions ↵Ben Langmuir2015-12-111-6/+4
| | | | | | | | | | a hidden tag" This is causing assertion failures; reverting until I can fix. This reverts commit r255267 llvm-svn: 255324
* Objective-C properties: merge attributes when redeclaring 'readonly' as ↵Douglas Gregor2015-12-101-89/+158
| | | | | | | | | | | | | | 'readwrite' in an extension. r251874 stopped back-patching the AST when an Objective-C 'readonly' property is redeclared in a class extension as 'readwrite'. However, it did not properly handle merging of Objective-C property attributes (e.g., getter name, ownership, atomicity) to the redeclaration, leading to bad metadata. Merge (and check!) those property attributes so we get the right metadata and reasonable ASTs. Fixes rdar://problem/23823989. llvm-svn: 255309
* [Sema] Replace pointer-to-map with a map. NFC.George Burgess IV2015-12-101-12/+6
| | | | llvm-svn: 255288
* Do not generate DW_TAG_imported_module for anonymous namespaces (even ↵Ekaterina Romanova2015-12-101-9/+9
| | | | | | | | | | nested) for all the platforms except PS4. For PS4, generate explicit import for anonymous namespaces and mark it by DW_AT_artificial attribute. Differential Revision: http://reviews.llvm.org/D12624 llvm-svn: 255281
* [Modules] Fix regression when an elaborated-type-specifier mentions a hidden tagBen Langmuir2015-12-101-4/+6
| | | | | | | | | This makes non-C++ languages find the same decl as C++ does to workaround a regression introduced in r252960. rdar://problem/23784203 llvm-svn: 255267
* [NFC] Improve a comment from my previous commit (r255221)Faisal Vali2015-12-101-1/+1
| | | | llvm-svn: 255244
* [Sema] Use UnaryOperatorKind and BinaryOperatorKind in parameter lists ↵Craig Topper2015-12-102-22/+17
| | | | | | instead of just unsigned. Removes a few explicit casts. NFC llvm-svn: 255232
* Add parentheses to suppress a -Wparentheses warning.Craig Topper2015-12-101-2/+2
| | | | llvm-svn: 255231
* [OPENMP] Fixed processing of predetermined data-sharing attributesAlexey Bataev2015-12-101-33/+17
| | | | | | Predetermined data-shared attributes for local variables are now considered as implicit. Also, patch prohibits changin of DSA for static memebers of classes. llvm-svn: 255229
* Fix PR24694 (CWG1591): Deducing array bound and element type from ↵Faisal Vali2015-12-101-13/+52
| | | | | | | | | | | | | | | initializer list https://llvm.org/bugs/show_bug.cgi?id=24694 http://wg21.link/cwg1591 Teach DeduceFromInitializerList in SemaTemplateDeduction.cpp to deduce against array (constant and dependent sized) parameters (really, reference to arrays since they don't decay to pointers), by checking if the template parameter is either one of those kinds of arrays, and if so, deducing each initializer list element against the element type, and then deducing the array bound if needed. In brief, this patch enables the following code: template<class T, int N> int *f(T (&&)[N]); int *ip = f({1, 2, 3}); llvm-svn: 255221
* [MSVC] Fix for http://llvm.org/PR25636: indexed accessor property not ↵Alexey Bataev2015-12-101-3/+26
| | | | | | | | | supported correctly. All problems described in http://llvm.org/PR25636 are implemented except for return value of the 'put' property. This patch fixes this problem with the indexed properties Differential Revision: http://reviews.llvm.org/D15174 llvm-svn: 255218
* Fix crash on invalid initialization with std::initializer_listReid Kleckner2015-12-091-1/+2
| | | | | | | It is possible for CheckListElementTypes to fail without filling in any initializer list elements. llvm-svn: 255176
* Objective-C properties: loosen 'atomic' checking for readonly properties.Douglas Gregor2015-12-091-20/+53
| | | | | | | | | | | | | | | r251874 reworked the way we handle properties declared within Objective-C class extensions, which had the effective of tightening up property checking in a number of places. In this particular class of cases, we end up complaining about "atomic" mismatches between an implicitly-atomic, readonly property and a nonatomic, readwrite property, which doesn't make sense because "atomic" is essentially irrelevant to readonly properties. Therefore, suppress this diagnostic when the readonly property is implicitly atomic. Fixes rdar://problem/23803109. llvm-svn: 255174
* Revert r255001, "Add parse and sema for OpenMP distribute directive and all ↵NAKAMURA Takumi2015-12-092-175/+9
| | | | | | | | its clauses excluding dist_schedule." It causes memory leak. Some tests in test/OpenMP would fail. llvm-svn: 255094
* Objective-C properties: fix bogus use of "isa<>" on a QualType.Douglas Gregor2015-12-081-6/+5
| | | | | | | | | The code used "isa" to check the type and then "getAs" to look through sugar; we need to look through the sugar when checking, too, otherwise any kind of sugar (nullability qualifiers in the example; or a typedef) will thwart this semantic check. Fixes rdar://problem/23804250. llvm-svn: 255066
OpenPOWER on IntegriCloud