summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/odr_hash.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ODRHash] Fix wrong error message with bitfields and mutable.Weverything2020-01-141-1/+17
| | | | | Add a check to bitfield mismatches that may have caused Clang to give an error about the bitfield instead of being mutable.
* [ODRHash] Skip some typedef types.Richard Trieu2019-06-221-1/+62
| | | | | | | | | | | | | | | In some cases, a typedef only strips aways a keyword for a type, keeping the same name as the root record type. This causes some confusion when the type is defined in one modules but only forward declared in another. Skipping the typedef and going straight to the record will avoid this issue. typedef struct S {} S; S* s; // S is TypedefType here struct S; S* s; // S is RecordType here llvm-svn: 364119
* Reduce amount of work ODR hashing does.Richard Trieu2019-05-041-0/+37
| | | | | | | | | | | | | | | When a FunctionProtoType is in the original type in a DecayedType, the decayed type is a PointerType which points back the original FunctionProtoType. The visitor for ODRHashing will attempt to process both Type's, doing double work. By chaining together multiple DecayedType's and FunctionProtoType's, this would result in 2^N Type's visited only N DecayedType's and N FunctionProtoType's exsit. Another bug where VisitDecayedType and VisitAdjustedType did redundant work doubled the work at each level, giving 4^N Type's visited. This patch removed the double work and detects when a FunctionProtoType decays to itself to only check the Type once. This lowers the exponential runtime to linear runtime. Fixes https://bugs.llvm.org/show_bug.cgi?id=41625 llvm-svn: 359960
* Add triple to test case.Richard Trieu2018-09-051-1/+3
| | | | | | | This test uses enums, which have different behavior when targeting different systems. Specifying a triple will give predictable behavior to this test. llvm-svn: 341496
* [ODRHash] Extend hash to support all Type's.Richard Trieu2018-09-041-1/+563
| | | | llvm-svn: 341421
* Diagnose invalid cv-qualifiers for friend decls.Eli Friedman2018-08-031-18/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D45712 llvm-svn: 338931
* [ODRHash] Support hashing enums.Richard Trieu2018-07-251-0/+171
| | | | llvm-svn: 337978
* [ODRHash] Merge the two function hashes into one.Richard Trieu2018-07-101-0/+222
| | | | | | | | | | | Functions that are a sub-Decl of a record were hashed differently than other functions. This change keeps the AddFunctionDecl function and the hash of records now calls this function. In addition, AddFunctionDecl has an option to perform a hash as if the body was absent, which is required for some checks after loading modules. Additional logic prevents multiple error message from being printed. llvm-svn: 336632
* [ODRHash] Adjust info stored for FunctionTemplateDecl.Richard Trieu2018-06-071-0/+14
| | | | | | | Avoid storing information for definitions since those can be out-of-line and vary between modules even when the declarations are the same. llvm-svn: 334151
* [ODRHash] Support FunctionTemplateDecl in records.Richard Trieu2018-05-301-0/+439
| | | | llvm-svn: 333486
* [ODRHash] Hash template arguments of methods.Richard Trieu2018-04-251-1/+104
| | | | llvm-svn: 330789
* [ODRHash] Support pointer and reference types.Richard Trieu2018-04-131-0/+121
| | | | | | | Recommit r328404 which was reverted in rL328404. r329869 fixed the issue that caused the revert. llvm-svn: 330074
* [ODRHash] Skip more types hashing TypedefTypeRichard Trieu2018-04-121-0/+32
| | | | | | To get the underlying type for TypedefType's, also skip ElaboratedType's. llvm-svn: 329869
* Temporarily revert r328404:Eric Christopher2018-04-021-122/+0
| | | | | | | | | | | | | | commit 519b97132a4c960e8dedbfe4290d86970d92e995 Author: Richard Trieu <rtrieu@google.com> Date: Sat Mar 24 00:52:44 2018 +0000 [ODRHash] Support pointer and reference types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328404 91177308-0d34-0410-b5e6-96231b3b80d8 As it's breaking some tests. I've communicated with Richard offline about testcases. llvm-svn: 329001
* [ODRHash] Support pointer and reference types.Richard Trieu2018-03-241-0/+122
| | | | llvm-svn: 328404
* Update StmtProfile.cpp to handle zero template arguments.Richard Trieu2018-02-131-0/+15
| | | | | | | Treat having no templates arguments differently than having zero template arguments when profiling. llvm-svn: 325040
* [ODRHash] Support ODR violation detection in functions.Richard Trieu2017-12-231-12/+148
| | | | | | | Extend the hashing to functions, which allows detection of function definition mismatches across modules. This is a re-commit of r320230. llvm-svn: 321395
* Revert r320230 to fix buildbots.Richard Trieu2017-12-091-148/+12
| | | | llvm-svn: 320239
* [ODRHash] Support ODR violation detection in functions.Richard Trieu2017-12-091-12/+148
| | | | | | | Extend the hashing to functions, which allows detection of function definition mismatches across modules. llvm-svn: 320230
* Update ODR hashing testsRichard Trieu2017-11-041-120/+723
| | | | | | | | Add a mix of postive and negative tests to check that wrong Decls won't be flagged in the diagnostic. Split the check everything test and moved the pieces closer to where the related tests are. llvm-svn: 317394
* [ODRHash] Add base classes to hashing CXXRecordDecl.Richard Trieu2017-09-301-0/+120
| | | | llvm-svn: 314581
* [ODRHash] Diagnose differing template parameters.Richard Trieu2017-08-231-0/+77
| | | | llvm-svn: 311519
* [ODRHash] Revert r307743 which reverted r307720Richard Trieu2017-07-151-0/+69
| | | | | | | Reapply r307720 to allow processing of constructors and destructors. Reuse the diagnostics for CXXMethodDecl for them. llvm-svn: 308077
* [ODRHash] Avoid taking the types of FunctionDecl'sRichard Trieu2017-07-141-0/+14
| | | | | | | | FunctionDecl already hashes most of the information in the function's type. Add hashing of the return type, and skip hashing the function's type to avoid redundancy and extra work when computing the hash. llvm-svn: 307986
* [ODRHash] Revert r307720 to fix buildbot.Richard Trieu2017-07-121-69/+0
| | | | llvm-svn: 307743
* [ODRHash] Support more method types.Richard Trieu2017-07-111-0/+69
| | | | | | | Hash CXXConstructorDecl and CXXDestructorDecl. Extend the diagnostics from CXXMethodDecl to include constructors and destructors. llvm-svn: 307720
* [ODRHash] Support FriendDeclRichard Trieu2017-07-081-0/+78
| | | | llvm-svn: 307458
* [ODRHash] Revert r305104 - Skip inline namespaces when hashing.Richard Trieu2017-07-011-0/+18
| | | | | | Test inline namespaces and handle them in the ODR hash again. llvm-svn: 306926
* [ODRHash] Support Type TemplateArgumentRichard Trieu2017-06-301-0/+34
| | | | llvm-svn: 306904
* [ODRHash] Improve typedef handling.Richard Trieu2017-06-291-0/+16
| | | | | | | Follow typedef chains to find the root type when processing types, and also keep track of qualifiers. llvm-svn: 306753
* [ODRHash] Hash VarDecl members.Richard Trieu2017-06-161-2/+177
| | | | | | | These VarDecl's are static data members of classes. Since the initializers are also hashed, this also provides checking for default arguments to methods. llvm-svn: 305543
* [ODRHash] Hash TemplateArgument::Pack and TemplateTypeParmTypeRichard Trieu2017-06-151-0/+41
| | | | llvm-svn: 305440
* [ODRHash] Hash Template and TemplateExpansion in TemplateArgument.Richard Trieu2017-06-141-0/+18
| | | | llvm-svn: 305361
* [ODRHash] Hash Expr for TemplateArgument::ExpressionRichard Trieu2017-06-141-0/+33
| | | | llvm-svn: 305360
* [ODRHash] Add TemplateArgument kind to hash.Richard Trieu2017-06-131-0/+18
| | | | llvm-svn: 305328
* [ODRHash] Add diagnostic messages for typedef and type alias.Richard Trieu2017-06-121-0/+102
| | | | llvm-svn: 305238
* Revert r305110 to fix buildbotRichard Trieu2017-06-091-18/+0
| | | | llvm-svn: 305130
* [ODRHash] Add support for TemplateArgument types.Richard Trieu2017-06-091-0/+18
| | | | | | | Recommit r304592 that was reverted in r304618. r305104 should have fixed the issue. llvm-svn: 305110
* Revert r304592Richard Trieu2017-06-031-18/+0
| | | | | | | r304592 - [ODRHash] Add support for TemplateArgument types. Possibly causing one of the errors in modules build bot. llvm-svn: 304618
* [ODRHash] Add support for TemplateArgument types.Richard Trieu2017-06-021-0/+18
| | | | llvm-svn: 304592
* [ODRHash] Support TemplateSpecializationTypeRichard Trieu2017-05-311-0/+34
| | | | llvm-svn: 304261
* [ODRHash] Revert r303450 to fix buildbotRichard Trieu2017-05-191-102/+0
| | | | | | | r303450 [ODRHash] Support TemplateName and TemplateArgument llvm-svn: 303459
* [ODRHash] Support TemplateName and TemplateArgumentRichard Trieu2017-05-191-0/+102
| | | | llvm-svn: 303450
* [ODRHash] Support NestedNameSpecifierRichard Trieu2017-05-171-0/+159
| | | | llvm-svn: 303233
* [ODRHash] Support more types in the ODR checker.Richard Trieu2017-05-171-0/+72
| | | | | | Added support for TagType, TypeWithKeyword, and all children types. llvm-svn: 303231
* [ODRHash] Loosen checks on typedefs.Richard Trieu2017-05-091-0/+33
| | | | | | | When a type in a class is from a typedef, only check the canonical type. Skip checking the intermediate underlying types. This is in response to PR 32965 llvm-svn: 302505
* [ODRHash] Add support for array and decayed types, and parameter names and ↵Richard Trieu2017-05-021-31/+177
| | | | | | types. llvm-svn: 301989
* [ODRHash] Add testcase with different paramter names. NFCRichard Trieu2017-04-281-0/+46
| | | | llvm-svn: 301701
* [ODRHash] clean up test and add new examples. NFCRichard Trieu2017-04-201-124/+67
| | | | | | | | | Use a macro to generate the struct with all decls. Previously, four identical changes would be needed to update this test. This macro reduces that to one location. Added two other tests for issues that triggered false positives during testing. llvm-svn: 300814
* Revert r300001 "Revert r298824 & r298816, recommit r298742 & r298754"Hans Wennborg2017-04-121-170/+109
| | | | | | It caused PR32640. llvm-svn: 300074
OpenPOWER on IntegriCloud