summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ODRHash.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [ODRHash] Add support for TemplateArgument types.Richard Trieu2017-06-021-1/+19
| | | | llvm-svn: 304592
* [ODRHash] Support TemplateSpecializationTypeRichard Trieu2017-05-311-1/+27
| | | | llvm-svn: 304261
* [ODRHash] Revert r303450 to fix buildbotRichard Trieu2017-05-191-90/+2
| | | | | | | r303450 [ODRHash] Support TemplateName and TemplateArgument llvm-svn: 303459
* [ODRHash] Support TemplateName and TemplateArgumentRichard Trieu2017-05-191-2/+90
| | | | llvm-svn: 303450
* [ODRHash] Support NestedNameSpecifierRichard Trieu2017-05-171-1/+29
| | | | llvm-svn: 303233
* [ODRHash] Support more types in the ODR checker.Richard Trieu2017-05-171-0/+50
| | | | | | Added support for TagType, TypeWithKeyword, and all children types. llvm-svn: 303231
* [ODRHash] Loosen checks on typedefs.Richard Trieu2017-05-091-1/+1
| | | | | | | 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-0/+82
| | | | | | types. llvm-svn: 301989
* Revert r300001 "Revert r298824 & r298816, recommit r298742 & r298754"Hans Wennborg2017-04-121-100/+0
| | | | | | It caused PR32640. llvm-svn: 300074
* Revert r298824 & r298816, recommit r298742 & r298754Richard Trieu2017-04-111-0/+100
| | | | | | | | | | | | | r299989 fixes the underlying issue by waiting long enough to late parsed arguments to be processed before doing an calculating the hash. r298742 [ODRHash] Add error messages for mismatched parameters in methods. r298754 [ODRHash] Add support for array and decayed types. llvm-svn: 300001
* Revert r298742 "[ODRHash] Add error messages for mismatched parameters in ↵Vassil Vassilev2017-03-261-59/+0
| | | | | | | | methods." I failed to revert this in r298816. llvm-svn: 298824
* Revert 298754 and 298742.Vassil Vassilev2017-03-261-41/+0
| | | | | | They broke llvm modules builds and our internal modules infrastructure. llvm-svn: 298816
* [ODRHash] Add support for array and decayed types.Richard Trieu2017-03-251-0/+41
| | | | llvm-svn: 298754
* [ODRHash] Add error messages for mismatched parameters in methods.Richard Trieu2017-03-241-0/+59
| | | | llvm-svn: 298742
* [ODRHash] Hash typedefs and usings statements in classes.Richard Trieu2017-03-081-0/+17
| | | | llvm-svn: 297246
* [ODRHash] Add support for detecting different method properties.Richard Trieu2017-03-041-1/+10
| | | | | | | | Now print diagnostics for static, virtual, inline, volatile, and const differences in methods. Also use DeclarationName instead of IdentifierInfo for additional robustness in diagnostic printing. llvm-svn: 296932
* [ODRHash] Add basic support for CXXRecordDeclRichard Trieu2017-02-281-0/+9
| | | | llvm-svn: 296521
* [ODRHash] Move inherited visitor call to end of function.Richard Trieu2017-02-251-2/+2
| | | | llvm-svn: 296221
* [ODRHash] Finish FieldDecl support by handling mutable and initializers.Richard Trieu2017-02-241-0/+3
| | | | | | https://reviews.llvm.org/rL296170 llvm-svn: 296198
* [ODRHash] Add handling of bitfieldsRichard Trieu2017-02-241-0/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D21675 llvm-svn: 296170
* [ODRHash] Add handling of TypedefType and DeclarationNameRichard Trieu2017-02-241-1/+65
| | | | | | Differential Revision: https://reviews.llvm.org/D21675 llvm-svn: 296078
* [ODRHash] Handle types in ODR hashing.Richard Trieu2017-02-231-2/+62
| | | | | | | | | | Fields will now have their types added to the hash, allowing for detection of mismatched field types. This detection allows the existing ODR checking to produce the correct message. Differential Revision: https://reviews.llvm.org/D21675 llvm-svn: 295931
* [ODRHash] Add IdentiferInfo and FieldDecl support.Richard Trieu2017-02-231-1/+23
| | | | | | | | | IdentifierInfo is hashed based on the stored string. FieldDecl versus other Decl is now detected, as well as differently named fields. Differential Revision: https://reviews.llvm.org/D21675 llvm-svn: 295911
* [ODRHash] static_cast and Stmt hashing.Richard Trieu2017-02-221-4/+23
| | | | | | | | | | Add support for static_cast in classes. Add pointer-independent profiling for Stmt's, sharing most of the logic with Stmt::Profile. This is the first of the deep sub-Decl diffing for error messages. Differential Revision: https://reviews.llvm.org/D21675 llvm-svn: 295890
* Fix -Wunused-private-field warning by removing unused ODRHash reference ↵Simon Pilgrim2017-02-221-4/+3
| | | | | | field from ODRDeclVisitor llvm-svn: 295828
* Add more ODR checking.Richard Trieu2017-02-221-0/+152
| | | | | | | | | | Add the basics for the ODRHash class, which will only process Decl's from a whitelist, which currently only has AccessSpecDecl. Different access specifiers in merged classes can now be detected. Differential Revision: https://reviews.llvm.org/D21675 llvm-svn: 295800
* Revert r295421, new ODR checker for modules, to fix build bot.Richard Trieu2017-02-171-935/+0
| | | | llvm-svn: 295427
* Add better ODR checking for modules.Richard Trieu2017-02-171-0/+935
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A slightly weaker form of ODR checking than previous attempts, but hopefully won't break the modules build bot. Future work will be needed to catch all cases. When objects are imported for modules, there is a chance that a name collision will cause an ODR violation. Previously, only a small number of such violations were detected. This patch provides a stronger check based on AST nodes. The information needed to uniquely identify an object is taken from the AST and put into a one-dimensional byte stream. This stream is then hashed to give a value to represent the object, which is stored with the other object data in the module. When modules are loaded, and Decl's are merged, the hash values of the two Decl's are compared. Only Decl's with matched hash values will be merged. Mismatch hashes will generate a module error, and if possible, point to the first difference between the two objects. The transform from AST to byte stream is a modified depth first algorithm. Due to references between some AST nodes, a pure depth first algorithm could generate loops. For Stmt nodes, a straight depth first processing occurs. For Type and Decl nodes, they are replaced with an index number and only on first visit will these nodes be processed. As an optimization, boolean values are saved and stored together in reverse order at the end of the byte stream to lower the ammount of data that needs to be hashed. Compile time impact was measured at 1.5-2.0% during module building, and negligible during builds without module building. Differential Revision: https://reviews.llvm.org/D21675 llvm-svn: 295421
* Revert r295284: Add better ODR checking for modules.Richard Trieu2017-02-161-940/+0
| | | | | | Fix modules build bot. llvm-svn: 295293
* Add better ODR checking for modules.Richard Trieu2017-02-161-0/+940
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recommit r293585 that was reverted in r293611 with new fixes. The previous issue was determined to be an overly aggressive AST visitor from forward declared objects. The visitor will now only deeply visit certain Decl's and only do a shallow information extraction from all other Decl's. When objects are imported for modules, there is a chance that a name collision will cause an ODR violation. Previously, only a small number of such violations were detected. This patch provides a stronger check based on AST nodes. The information needed to uniquely identify an object is taken from the AST and put into a one-dimensional byte stream. This stream is then hashed to give a value to represent the object, which is stored with the other object data in the module. When modules are loaded, and Decl's are merged, the hash values of the two Decl's are compared. Only Decl's with matched hash values will be merged. Mismatch hashes will generate a module error, and if possible, point to the first difference between the two objects. The transform from AST to byte stream is a modified depth first algorithm. Due to references between some AST nodes, a pure depth first algorithm could generate loops. For Stmt nodes, a straight depth first processing occurs. For Type and Decl nodes, they are replaced with an index number and only on first visit will these nodes be processed. As an optimization, boolean values are saved and stored together in reverse order at the end of the byte stream to lower the ammount of data that needs to be hashed. Compile time impact was measured at 1.5-2.0% during module building, and negligible during builds without module building. Differential Revision: https://reviews.llvm.org/D21675 llvm-svn: 295284
* Revert r293585 "Add better ODR checking for modules."Sam McCall2017-01-311-892/+0
| | | | | | | | | | | We're seeing what we believe are false positives. (It's hard to tell with the available diagnostics, and I'm not sure how to reduce them yet). I'll send Richard reproduction details offline. djasper/chandlerc suggested this should be a warning for now, to make rolling it out feasible. llvm-svn: 293611
* Add better ODR checking for modules.Richard Trieu2017-01-311-0/+892
When objects are imported for modules, there is a chance that a name collision will cause an ODR violation. Previously, only a small number of such violations were detected. This patch provides a stronger check based on AST nodes. The information needed to uniquely identify an object is taked from the AST and put into a one-dimensional byte stream. This stream is then hashed to give a value to represent the object, which is stored with the other object data in the module. When modules are loaded, and Decl's are merged, the hash values of the two Decl's are compared. Only Decl's with matched hash values will be merged. Mismatch hashes will generate a module error, and if possible, point to the first difference between the two objects. The transform from AST to byte stream is a modified depth first algorithm. Due to references between some AST nodes, a pure depth first algorithm could generate loops. For Stmt nodes, a straight depth first processing occurs. For Type and Decl nodes, they are replaced with an index number and only on first visit will these nodes be processed. As an optimization, boolean values are saved and stored together in reverse order at the end of the byte stream to lower the ammount of data that needs to be hashed. Compile time impact was measured at 1.5-2.0% during module building, and negligible during builds without module building. Differential Revision: https://reviews.llvm.org/D21675 llvm-svn: 293585
OpenPOWER on IntegriCloud