summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* [AST] Incorrectly qualified unscoped enumeration as template actual parameter.Paul Robinson2017-12-211-1/+4
| | | | | | | | | | | | | | | An unscoped enumeration used as template argument, should not have any qualified information about its enclosing scope, as its visibility is global. In the case of scoped enumerations, they must include information about their enclosing scope. Patch by Carlos Alberto Enciso! Differential Revision: https://reviews.llvm.org/D39239 llvm-svn: 321312
* Re-commit r321223, which adds a printing policy to the ASTDumper.Aaron Ballman2017-12-212-19/+37
| | | | | | | | This allows you to dump C++ code that spells bool instead of _Bool, leaves off the elaborated type specifiers when printing struct or class names, and other C-isms. Fixes the -Wreorder issue and fixes the ast-dump-color.cpp test. llvm-svn: 321310
* Reverting r321223 and its follow-up commit because of failing bots due to ↵Aaron Ballman2017-12-202-35/+19
| | | | | | Misc/ast-dump-color.cpp. llvm-svn: 321229
* Silence a -Wreorder warning from r321223.Aaron Ballman2017-12-201-2/+2
| | | | llvm-svn: 321228
* Add a printing policy to the ASTDumper.Aaron Ballman2017-12-202-19/+35
| | | | | | This allows you to dump C++ code that spells bool instead of _Bool, leaves off the elaborated type specifiers when printing struct or class names, and other C-isms. llvm-svn: 321223
* Fix an assertion failure regression in isDesignatorAtObjectEnd forAlex Lorenz2017-12-201-1/+4
| | | | | | | | | | | | | | __builtin_object_size with incomplete array type in struct The commit r316245 introduced a regression that causes an assertion failure when Clang tries to cast an IncompleteArrayType to a PointerType when evaluating __builtin_object_size. rdar://36094951 Differential Revision: https://reviews.llvm.org/D41405 llvm-svn: 321222
* Revert r320942, "[ASTImporter] Support importing FunctionTemplateDecl and ↵Peter Collingbourne2017-12-201-126/+0
| | | | | | | | | | | | | | | | | CXXDependentScopeMemberExpr" Caused a test failure on Windows: [ RUN ] ImportExpr.ImportCXXDependentScopeMemberExpr C:\b\rr\tmppzcp4w\w\src\third_party\llvm\tools\clang\unittests\AST\ASTImporterTest.cpp(526): error: Value of: testImport("template <typename T> class C { T t; };" "template <typename T> void declToImport() {" " C<T> d;" " d.t;" "}", Lang_CXX, "", Lang_CXX, Verifier, functionTemplateDecl(has(functionDecl(has(compoundStmt( has(cxxDependentScopeMemberExpr()))))))) Actual: false (Could not find match) Expected: true C:\b\rr\tmppzcp4w\w\src\third_party\llvm\tools\clang\unittests\AST\ASTImporterTest.cpp(534): error: Value of: testImport("template <typename T> class C { T t; };" "template <typename T> void declToImport() {" " C<T> d;" " (&d)->t;" "}", Lang_CXX, "", Lang_CXX, Verifier, functionTemplateDecl(has(functionDecl(has(compoundStmt( has(cxxDependentScopeMemberExpr()))))))) Actual: false (Could not find match) Expected: true [ FAILED ] ImportExpr.ImportCXXDependentScopeMemberExpr (37 ms) llvm-svn: 321139
* Silence a bunch of implicit fallthrough warningsAdrian Prantl2017-12-197-12/+14
| | | | llvm-svn: 321115
* Refactor overridden methods iteration to avoid double lookups.Benjamin Kramer2017-12-176-47/+27
| | | | | | Convert most uses to range-for loops. No functionality change intended. llvm-svn: 320954
* [ASTImporter] Support importing FunctionTemplateDecl and ↵Aleksei Sidorin2017-12-171-0/+126
| | | | | | | | | | | | CXXDependentScopeMemberExpr * Also introduces ImportTemplateArgumentListInfo facility (A. Sidorin) Patch by Peter Szecsi! Differential Revision: https://reviews.llvm.org/D38692 llvm-svn: 320942
* Correct UnaryTransformTypeLoc to properly initialize.Erich Keane2017-12-141-0/+9
| | | | | | | | | The initializeLocal function of UnaryTransformTypeLoc missed the UnderlyingTInfo member. This caused a null-dereference issue, as reported in PR23421. This patch correctly initializss the UnderlyingTInfo. llvm-svn: 320765
* D40901: Refactor lazy loading of template specializations. NFCVassil Vassilev2017-12-141-39/+17
| | | | llvm-svn: 320763
* [c++20] P0515R3: Parsing support and basic AST construction for operator <=>.Richard Smith2017-12-142-0/+3
| | | | | | | | | | | | | | | Adding the new enumerator forced a bunch more changes into this patch than I would have liked. The -Wtautological-compare warning was extended to properly check the new comparison operator, clang-format needed updating because it uses precedence levels as weights for determining where to break lines (and several operators increased their precedence levels with this change), thread-safety analysis needed changes to build its own IL properly for the new operator. All "real" semantic checking for this operator has been deferred to a future patch. For now, we use the relational comparison rules and arbitrarily give the builtin form of the operator a return type of 'void'. llvm-svn: 320707
* Fix ICE when __has_unqiue_object_representations called with invalid declErich Keane2017-12-121-0/+3
| | | | llvm-svn: 320489
* Revert r320230 to fix buildbots.Richard Trieu2017-12-092-50/+0
| | | | llvm-svn: 320239
* [ODRHash] Support ODR violation detection in functions.Richard Trieu2017-12-092-0/+50
| | | | | | | Extend the hashing to functions, which allows detection of function definition mismatches across modules. llvm-svn: 320230
* [OpenCL] Fix layering violation by getOpenCLTypeAddrSpaceSven van Haastregt2017-12-061-1/+42
| | | | | | | | | | | | Commit 7ac28eb0a5 / r310911 ("[OpenCL] Allow targets to select address space per type", 2017-08-15) made Basic depend on AST, introducing a circular dependency. Break this dependency by adding the OpenCLTypeKind enum in Basic and map from AST types to this enum in ASTContext. Differential Revision: https://reviews.llvm.org/D40838 llvm-svn: 319883
* Generalize "static data member instantiated" notification to cover variable ↵Richard Smith2017-12-051-4/+16
| | | | | | | | | templates too. While here, split the "point of instantiation changed" notification out from it; these two really are orthogonal changes. llvm-svn: 319727
* Now that C++17 is official (https://www.iso.org/standard/68564.html), start ↵Aaron Ballman2017-12-042-3/+3
| | | | | | changing the C++1z terminology over to C++17. NFC intended, these are all mechanical changes. llvm-svn: 319688
* PR35456: Track definedness of variable template specializations separately fromRichard Smith2017-12-022-5/+8
| | | | | | | | | | whether they have an initializer. We cannot distinguish between a declaration of a variable template specialization and a definition of one that lacks an initializer without this, and would previously mistake the latter for the former. llvm-svn: 319605
* Move comment back to being next to the code it's a comment for.Richard Smith2017-12-021-3/+3
| | | | llvm-svn: 319601
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-12-012-60/+85
| | | | | | minor fixes (NFC). llvm-svn: 319589
* [c++2a] P0515R3: Support for overloaded operator<=>.Richard Smith2017-12-013-0/+16
| | | | | | No CodeGen support for MSABI yet, we don't know how to mangle this there. llvm-svn: 319513
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-302-24/+45
| | | | | | minor fixes (NFC). llvm-svn: 319487
* Fix __has_unique_object_representations implementationErich Keane2017-11-305-165/+197
| | | | | | | | | | As rsmith pointed out, the original implementation of this intrinsic missed a number of important situations. This patch fixe a bunch of shortcomings and implementation details to make it work correctly. Differential Revision: https://reviews.llvm.org/D39347 llvm-svn: 319446
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-291-3/+8
| | | | | | minor fixes (NFC). llvm-svn: 319384
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-291-31/+49
| | | | | | minor fixes (NFC). llvm-svn: 319376
* Use static function instead of anonymous namespaceSerge Pavlov2017-11-291-4/+2
| | | | llvm-svn: 319290
* Refactor functions PrintTemplateArgumentListSerge Pavlov2017-11-286-105/+59
| | | | | | | | | | | These functions were defined as static members of TemplateSpecializationType. Now they are moved to namespace level. Previously there were different implementations for lists containing TemplateArgument and TemplateArgumentLoc, now these implementations share the same code. This change is a result of refactoring patch D40508. NFC. llvm-svn: 319178
* [ASTImporter] Support importing CXXPseudoDestructorExprAleksei Sidorin2017-11-271-0/+34
| | | | | | | | Patch by Peter Szecsi! Differential Revision: https://reviews.llvm.org/D38843 llvm-svn: 319015
* [ASTImporter] Support TypeTraitExprAleksei Sidorin2017-11-261-0/+21
| | | | | | | | Patch by Takafumi Kubota! Differential Revision: https://reviews.llvm.org/D39722 llvm-svn: 318998
* [DeclPrinter] Allow printing fully qualified name of function declarationSerge Pavlov2017-11-231-5/+11
| | | | | | | | | | | When requesting a tooltip for a function call in an IDE, the fully qualified name helps to remove ambiguity in the function signature. Patch by Nikolai Kosjar! Differential Revision: https://reviews.llvm.org/D40013 llvm-svn: 318896
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-231-77/+99
| | | | | | minor fixes (NFC). llvm-svn: 318888
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-221-47/+54
| | | | | | minor fixes (NFC). llvm-svn: 318882
* [OPENMP] Add support for cancel constructs in `target teams distributeAlexey Bataev2017-11-221-1/+2
| | | | | | | | | parallel for`. Add support for cancel/cancellation point directives inside `target teams distribute parallel for` directives. llvm-svn: 318881
* [OPENMP] Add support for cancel constructs in [teams] distributeAlexey Bataev2017-11-221-2/+4
| | | | | | | | | parallel for directives. Added codegen/sema support for cancel constructs in [teams] distribute parallel for directives. llvm-svn: 318872
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-215-72/+125
| | | | | | minor fixes (NFC). llvm-svn: 318813
* [OPENMP] Initial support for asynchronous data update, NFC.Alexey Bataev2017-11-212-21/+26
| | | | | | | | | OpenMP 5.0 introduces asynchronous data update/dependecies clauses on target data directives. Patch adds initial support for outer task regions to use task-based codegen for future async target data directives. llvm-svn: 318781
* [ASTImporter] Support new AST nodes:Aleksei Sidorin2017-11-211-17/+295
| | | | | | | | | | | | | | | | * UnresolvedUsingType * EmptyDecl * NamespaceAliasDecl * UsingDecl * UsingShadowDecl * UsingDirectiveDecl * UnresolvedUsingValueDecl * UnresolvedUsingTypenameDecl Refactor error handling in ImportTemplateArgumentLoc() method. Add a test for inline namespaces. llvm-svn: 318776
* [Analyzer] Revert r318750 because incorrect files were added for commit.Aleksei Sidorin2017-11-211-292/+17
| | | | | | Sorry for the noise. llvm-svn: 318753
* [Analyzer] Non-determinism: stable iteration on indirect goto LabelDecl'sAleksei Sidorin2017-11-211-17/+292
| | | | | | | | | | | | | | | | | | CFG wass built in non-deterministic order due to the fact that indirect goto labels' declarations (LabelDecl's) are stored in the llvm::SmallSet container. LabelDecl's are pointers, whose order is not deterministic, and llvm::SmallSet sorts them by their non-deterministic addresses after "small" container is exceeded. This leads to non-deterministic processing of the elements of the container. The fix is to use llvm::SmallSetVector that was designed to have deterministic iteration order. Patch by Ilya Palachev! Differential Revision: https://reviews.llvm.org/D40073 llvm-svn: 318750
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-181-108/+109
| | | | | | minor fixes (NFC). llvm-svn: 318582
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-171-85/+120
| | | | | | minor fixes (NFC). llvm-svn: 318570
* [AST] Partially revert r318341 to fix two broken tests on ↵Eugene Zelenko2017-11-171-108/+80
| | | | | | llvm-clang-x86_64-expensive-checks-win (NFC). llvm-svn: 318538
* PR22763: if a defaulted (non-user-provided) special member function isRichard Smith2017-11-161-0/+6
| | | | | | | | | | | | | | | | explicitly instantiated, still emit it with each use. We don't emit a definition of the member with an explicit instantiation definition (and indeed it appears that we're not allowed to, since an explicit instantiation definition does not constitute an odr-use and only odr-use permits definition for defaulted special members). So we still need to emit a weak definition with each use. This also makes defaulted-in-class declarations behave more like implicitly-declared special members, which matches their design intent. And it matches the way this problem was solved in GCC. llvm-svn: 318474
* [DeclPrinter] Extract function PrintConstructorInitializers, NFCAlex Lorenz2017-11-161-64/+69
| | | | | | | | Patch by Nikolai Kosjar! Differential Revision: https://reviews.llvm.org/D40066 llvm-svn: 318367
* [DeclPrinter] Honor TerseOutput for constructorsAlex Lorenz2017-11-161-56/+59
| | | | | | | | Patch by Nikolai Kosjar! Differential Revision: https://reviews.llvm.org/D39957 llvm-svn: 318365
* [AST, Sema] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2017-11-151-80/+108
| | | | | | other minor fixes (NFC). llvm-svn: 318341
* PR35214: don't crash if we see an array of unknown bound added to an empty ↵Richard Smith2017-11-151-4/+5
| | | | | | but invalid designator. llvm-svn: 318258
* [modules] Fix crash in complex class merging scenario.Richard Smith2017-11-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | When we merge together class definitions, we can end up with the canonical declaration of a field not being the one that was lexically within the canonical definition of the class. Additionally, when we merge class definitions via update records (eg, for a template specialization whose declaration is instantiated in one module and whose definition is instantiated in multiple others), we can end up with the list of lexical contents for the class not including a particular declaration of a field whose lexical parent is that class definition. In the worst case, we have a field whose canonical declaration's lexical parent has no fields, and in that case this attempt to number the fields by walking the fields in the declaration of the class that contained one of the canonical fields will fail. Instead, when numbering fields in a class, do the obvious thing: walk the fields in the definition. I'm still trying to reduce a testcase; the setup that leads to the above scenario seems to be quite fragile. llvm-svn: 318245
OpenPOWER on IntegriCloud